What is the difference between a cipher and a hash?

A cipher is an algorithm used to encrypt and decrypt data, while a hash is a one-way algorithm used to generate a unique fixed-length output from a given input.

Cipher example: AES (Advanced Encryption Standard) is a type of cipher used to encrypt and decrypt data.

Hash example: SHA-256 (Secure Hash Algorithm) is a type of hash used to generate a unique fixed-length output from a given input.

What is the difference between a cipher and a code?

A cipher is an algorithm for performing encryption or decryption—a series of well-defined steps that can be followed as a procedure. An example of a cipher is the Advanced Encryption Standard (AES).

A code is a system of symbols, letters, words, or signals that are used instead of ordinary words and numbers to send messages or store information. An example of a code is Morse code.