Cryptography
Encryption
Encryption is the use of algorithms (ciphers) to create an encrypted message (ciphertext) in order to make it unreadable, except for the person that the message is addressed to.
There are 2 types of encryption algorithms: symmetric and asymmetric.
Symmetric Encryption
Symmetric Encryption uses the same key in order to encrypt/decrypt a message. This means that you only have to send the key you encrypted the message with to the person who is meant to receive the message. That person will then be able to decrypt the message.
Symmetric Encryption is insecure because if the key is intercepted, then messages can be decrypted easily.
Asymmetric Encryption
Asymmetric Encryption uses a public/private key pair, addressing the key-sharing problem of Symmetric Encryption. In order to encrypt a message, you use the receiver's public key to encrypt the message and the receiver can decrypt the message with his own private key.
This fixes the key-sharing problem because it doesn't matter if the public key used to encrypt the message is intercepted, since you need the private key to decrypt it.
Hashing
Hashing is the process of using an algorithm to create a fixed-length output based on the content of the file. It can be used to verify the integrity of the file, which helps you make sure that you have downloaded the correct file or a non-corrupted file from the correct source. Different inputs that produce the same hash is called a collision. There are three main algorithms that are used for hashing.
MD5
MD5 (Message Digest Algorithm 5) is the weakest and oldest algorith that produces a 128-bit hash value expressed as a 32 digit hexadecimal value. It was created by Ronald Rivest to replace earlier algorithms like MD4. As computers became more powerful, collision attacks would become more possible. This has resulted in the decline of MD5.
SHA-1
SHA-1 (Secure Hash Algorithm 1) is an algorithm created by the NSA in 1993, which produces a 160-bit hash value - expressed by a 40 digit hexadecimal value. Just like MD5, it has been vulnerable to collision attacks, so it is not used as often.
SHA-256
SHA-256 (Secure Hash Algorithm 256) is yet another algorithm created by the NSA in 2001, producing a 256-bit hash value, which is expressed as a 64-bit hexadecimal value. It is currently the most popular hashing alogorithm and is used in major projects like TLS and PGP.
Steganography
Steganography is the practice of hiding secret messages inside regular files such as images or videos. Attackers often use steganography to run scripts on macro-enabled documents. There are multiple methods to hide messages in regular files.
Metadata
Metadata is data embedded into a file to provide information about the file. It is common in music to identify the artist, album title etc. or in photography for the location and copyrights. However, it is possible to edit the tags in the metadata to any value you want.
The ExifTool utility can be used for viewing and manipulating metadata.
Least Significant Bit (LSB)
You can change the LSB in each pixel to form the data you wish to hide and because it doesn't cause a massive change to the file, it can go unnoticed.
Steghide is a good utility to do this. It supports compression, encryption and passwords.