A cipher is an algorithm that converts data (plaintext) to an obfuscated form that is not directly readable. Ciphers are usually used with the intention of hiding the contents of a message or document from unauthorized persons. Ciphers can also be used to verify identity on the Internet.
Cipher algorithms usually require a special "key" that can be used to encrypt the message. Usually, the key provides sufficient information for easy decryption of the ciphertext, however, some ciphers require a different keys for decryption. These algorithms are termed "asymmetric" key ciphers.
Most ciphers are reversible, but there do exist algorithms that are non-reversible, termed one-way ciphers, or trap-door algorithms. These are commonly used for comparing passwords: the correct password is encrypted with the algorithm. Passwords that are then entered are encrypted with the same algorithm. The encrypted forms are then compared. This method prevents the actual password from existing in a non-secure form.