Encryption is the transformation of data into a form unreadable by
anyone without a secret decryption key. Its purpose is to ensure
privacy by keeping the information hidden from anyone for whom it is
not intended, even those who can see the encrypted data. For example,
one may wish to encrypt files on a hard disk to prevent an intruder
from reading them.
In a multi-user setting, encryption allows secure communication over an insecure channel. The general scenario is as follows: Alice wishes to send a message to Bob so that no one else besides Bob can read it. Alice encrypts the message, which is called the plaintext, with an encryption key; the encrypted message, called the ciphertext, is sent to Bob. Bob decrypts the ciphertext with the decryption key and reads the message. An attacker, Charlie, may either try to obtain the secret key or to recover the plaintext without using the secret key. In a secure cryptosystem, the plaintext cannot be recovered from the ciphertext except by using the decryption key. In a symmetric cryptosystem, a single key serves as both the encryption and decryption keys.