Encryption transforms plaintext into ciphertext using an algorithm and key. Encryption primarily protects confidentiality, and when used with modern authenticated modes it can also help provide integrity and authenticity of the ciphertext and associated data.