# What is Cipher?

Legal Definition
In cryptography, a cipher (or cypher) is an algorithm for performing encryption or decryption—a series of well-defined steps that can be followed as a procedure. An alternative, less common term is encipherment. To encipher or encode is to convert information into cipher or code. In common parlance, 'cipher' is synonymous with 'code', as they are both a set of steps that encrypt a message; however, the concepts are distinct in cryptography, especially classical cryptography.

Codes generally substitute different length strings of characters in the output, while ciphers generally substitute the same number of characters as are input. There are exceptions and some cipher systems may use slightly more, or fewer, characters when output versus the number that were input.

Codes operated by substituting according to a large codebook which linked a random string of characters or numbers to a word or phrase. For example, "UQJHSE" could be the code for "Proceed to the following coordinates." When using a cipher the original information is known as plaintext, and the encrypted form as ciphertext. The ciphertext message contains all the information of the plaintext message, but is not in a format readable by a human or computer without the proper mechanism to decrypt it.

The operation of a cipher usually depends on a piece of auxiliary information, called a key (or, in traditional NSA parlance, a cryptovariable). The encrypting procedure is varied depending on the key, which changes the detailed operation of the algorithm. A key must be selected before using a cipher to encrypt a message. Without knowledge of the key, it should be extremely difficult, if not impossible, to decrypt the resulting ciphertext into readable plaintext.

Most modern ciphers can be categorized in several ways

• By whether they work on blocks of symbols usually of a fixed size (block ciphers), or on a continuous stream of symbols (stream ciphers).
• By whether the same key is used for both encryption and decryption (symmetric key algorithms), or if a different key is used for each (asymmetric key algorithms). If the algorithm is symmetric, the key must be known to the recipient and sender and to no one else. If the algorithm is an asymmetric one, the enciphering key is different from, but closely related to, the deciphering key. If one key cannot be deduced from the other, the asymmetric key algorithm has the public/private key property and one of the keys may be made public without loss of confidentiality.
-- Wikipedia
Legal Definition
An arithmetical character, used for numerical notation. Vide Figures, and 13 Vin. Ab. 210; 18 Eng. C. L. R. 95; 1 Ch. Cr. Law, 176.

2. By cipher is also understood a mode of secret writing. Public ministers and other public agents frequently use ciphers in their correspondence, and it is sometimes very useful so to correspond in times of war. A key is given to each minister before his departure, namely, the cipher for writing ciphers, (chiffre chiffrant,) and the cipher for deciphering (chiffre dechiffrant.) Besides these, it is usual to give him a common cipher, (chiffre banal,) -which is known to all the ministers of the same power, who occasionally use it in their correspondence with each other.

3. When it is suspected that, a cipher becomes known to the cabinet where the minister is residing, recourse is had to a preconcerted sign in order to annul, entirely or in part, what has been written in cipher, or rather to indicate that the contents are to be understood in an inverted or contrary sense. A cipher of reserve is also employed in extraordinary cases.
-- Bouviers Law Dictionary