Rust Encryption

Wednesday, Aug 5, 2026

Rust Encryption

This is a project I've been working on to encrypt my data and sync it across devices. The idea came out of curiosity, not knowing how end to end encryption works, even though so many apps advertise it these days and wanting to get better at Rust.

It's helped me learn a lot about the cryptography, and file operations. Like the difference between symmetric and asymmetric encryption as well as hybrid encryption where I utilize both.

Symmetric Encryption

Symmetric encryption is when data is encrypted with a single key and only that key can decrypt it, like a key generated with a password. This is probably what most people think of when they think of encryption, I know that's what I thought for a long time. What confused me before I started this project was how can something be secure if you still have to come up with some way to send an unencrypted key for someone else to decrypt your message? The answer is asymmetric encryption.

Asymmetric Encryption

Asymmetric Encryption is when you generate random private keys that can be used to create public keys that can be sent to other people in the open. This one is more interesting than symmetric encryption because the one private key can be used for encryption and signing. The private key can also generate a signing key and verification key, the signing key can sign a hash of a document, then the verification key can be released to the public to verify the document. One drawback though is that asymmetric encryption can only encrypt a small amount of data. So to use asymmetric encryption on a large document requires combining the the two kinds of encryption.