Codes and ciphers are forms of secret communication. In general, a code replaces words, phrases, or sentences with groups of letters or numbers. A cipher rearranges letters or uses substitutes to disguise a message.
The technology of secret communication is called cryptology. It has two opposing parts: communications security and communications intelligence. People use communications security, also called COMSEC, to make messages secret. The study and practice of COMSEC methods is called cryptography. Communications intelligence, also called COMINT, consists of learning about messages without the permission of the communicators. COMINT includes eavesdropping, bugging rooms, wiretapping telephone conversations, and cracking the codes or ciphers of enemy forces. Solving such secret communications is called cryptanalysis.
In cryptology, the original message is called the plaintext. Its secret form is the ciphertext or cryptogram. The mathematical process that changes one into the other is the cryptographic algorithm. A key controls the operations of an algorithm. The receiver of a ciphertext must have been given the algorithm and key to convert the ciphertext back into plaintext. Encrypting is the process of converting plaintext into ciphertext. Decrypting is the process by which the intended receiver changes ciphertext back into plaintext.
There are two types of cryptosystems, or types of algorithms: (1) secret-key or symmetrical systems and (2) public-key or asymmetrical systems. In a secret-key system, the same key is used for both encryption and decryption. Anyone knowing the key can both encrypt and decrypt messages. In a public-key system, there are two keys. One key encrypts a message and another key decrypts it.

