using the ChaCha20 algorithm.
- Supports encryption and decryption.
- Reads and writes to files.
- Takes command-line arguments to specify the operation mode, input file, and output file.
-
Encrypt a file:
cargo run -e <input_file> <output_file> -
Decrypt a file:
cargo run -d <input_file> <output_file>
-efor encryption.-dfor decryption.<input_file>is the file to be encrypted/decrypted.<output_file>is the result file to store the encrypted/decrypted data.
- The key and nonce are hardcoded as zero arrays for simplicity.
- The input and output files are binary, so make sure to handle them accordingly.
cargo run -e plaintext.txt encrypted.bin
cargo run -d encrypted.bin decrypted.txt