# Introduction to cryptography and commonly used cryptographic algorithms and techniques

Cryptography is the study of  ” Secret (crypto-) writing (-graphy). It can be described as the study of protecting information weather in transit or at rest, by using techniques to render the information unusable to anyone who does not possess the means to decrypt it.

Cryptanalysis is the science of recovering the plaintext from the ciphertext without access to the key.

### General Goals of Cryptography

• Confidentiality: Assuring that only authorized parties are able to understand the data.
• Integrity: Ensuring that when a message is sent over a network, the message that arrives is the same as the message that was originally sent.
• Authentication: Ensuring that whoever supplies or accesses sensitive data is an authorized party.
• Nonrepudiation: Ensuring that the intended recipient actually received the message & ensuring that the sender actually sent the message.

### Common Types of Attacks

• Ciphertext-Only Attack
• Known-Plaintext Attack
• Chosen-Plaintext Attack
• Chosen-Ciphertext Attack
• Dictionary Attacks

### Steganography- “Concealed Writing”

• It is the art and science of writing hidden messages in an object(wave file, graphic, audio or video) in such a way that no one, apart from the sender and intended recipient, suspects the existence of the message.
• The least significant bit of each byte of the image can be replaced with bits of the secret message.
• Example of still imagery steganography. Left hand side image is the original cover image, where as right hand side does embedding a text file into the cover Image make the stego image.
• The advantage of steganography, over cryptography alone, is that messages do not attract attention.

### Hashing Techniques

• Cryptographic hashing functions are used to ensure the integrity of data using an integrity checksum.
• Hashing functions are one-way functions.  This means that the ciphertext (i.e., the checksum) cannot be used to reconstruct the plaintext.
• The checksum (the ciphertext) is much smaller than the plaintext.
• Hashing functions provide a kind of digital fingerprint.
• The security of the hashing function is related to the size of the resulting checksum (in bits)
• Examples of Hashing Algorithms:
• MD5 (Message-Digest algorithm 5)
• SHA (Secure Hash Algorithm)

### Digital Signatures

• Goals
• It should be proof of authenticity and should be impossible to forge.
• It should be impossible to alter the signed document without detection.
• It should be impossible to transplant the signature to another document.
• Technology
• A hash function to help generate the digital signature, S.
• Symmetric (secret key) cryptography to encrypt the message, M.
• Public key cryptography to share the secret key used to encrypt and decrypt the message, M.