Encryption uses mathematical algorithms to convert plain text into ciphertext, which is unreadable without a key. The key is used to decrypt the ciphertext and convert it back into plain text. The key can be either a secret password or a pair of keys (a public key and a private key).