Encryption
Encryption has long been used by militaries and governments to facilitate secret communication. It is now commonly used in protecting information within many kinds of civilian systems. For example, the Computer Security Institute reported that in 2007, 71% of companies surveyed utilized encryption for some of their data in transit, and 53% utilized encryption for some of their data in storage. Encryption can be used to protect data "at rest", such as information stored on computers and storage devices (e.g. USB flash drives). In recent years, there have been numerous reports of confidential data, such as customers' personal records, being exposed through loss or theft of laptops or backup drives; encrypting such files at rest helps protect them if physical security measures fail. Digital rights management systems, which prevent unauthorized use or reproduction of copyrighted material and protect software against reverse engineering (see also copy protection), is another somewhat different example of using encryption on data at rest.
Block cipher
A block cipher consists of two paired algorithms, one for encryption, "E", and the other for decryption, "D". Both algorithms accept two inputs: an input block of size "n" bits and a key of size "k" bits; and both yield an "n"-bit output block. The decryption algorithm "D" is defined to be the inverse function of encryption, i.e., "D" = "E". More formally, a block cipher is specified by an encryption function
which takes as input a key "K" of bit length "k", called the "key size", and a bit string "P" of length "n", called the "block size", and returns a string "C" of "n" bits. "P" is called the plaintext, and "C" is termed the ciphertext. For each "K", the function "E"("P") is required to be an invertible mapping on {0,1}. The inverse for "E" is defined as a function
taking a key "K" and a ciphertext "C" to return a plaintext value "P", such that