Program runs with Cipher Block Chaining (CBC) mode.
To better understand how the encryption algorithm and cbc work:
./info/cbc.pdf
./info/s-des.pdf
Clone the program and run it with cargo (Rust's package manager)
Both parties: sending (encrypting), and receiving (decrypting), need to securely share a 10-digit binary symmetric key, and an 8-digit binary initialization vector. If the key, initialization vector, and file match, encryption and decryption should work for any type of file.
Encryption:
cargo run <key> <vector> <plaintext_filename> <ciphertext_filename>
Decryption:
cargo run <d> <key> <vector> <ciphertext_filename> <plaintext_filename>
File is now meaningless to image viewers, opening it produces this:
Produces the original file. I tried to write the code as close to the description of the algorithm as possible for the sake of readability.
P.S.: This program is for learning purposes only, this encryption can be easily broken, so do not rely on it for important files!