CRYPTOGRAPHY NOTES Module 1 (1)
CRYPTOGRAPHY NOTES Module 1 (1)
SEMESTER – VII
Course Code 18CS744
Module 1
1. Plaintext: This is the original message or data that you want to keep secure. It is the input
to the encryption process.
2. Ciphertext: This is the result of encrypting the plaintext. It's the coded or scrambled version
of plaintext, which is not easily readable without the proper decryption key.
3. Encryption: The process of converting plaintext into ciphertext is called encryption or
enciphering. This is done to protect the confidentiality and integrity of the information.
4. Decryption: The reverse process of converting ciphertext back into plaintext is called
decryption or deciphering. Decryption is performed with a specific decryption key to reveal
the original message.
5. Cryptography: This is the field of study that deals with secure communication techniques,
including encryption and decryption methods. It focuses on protecting information from
unauthorized access or tampering.
6. Cryptographic System or Cipher: A cryptographic system, often referred to as a cipher, is a
specific set of algorithms, keys, and protocols used for encryption and decryption. Different
ciphers have varying levels of complexity and security.
7. Cryptanalysis: Cryptanalysis is the study of analyzing and breaking cryptographic systems
or ciphers without knowledge of the decryption key. It involves attempting to find
vulnerabilities in the encryption method to recover the plaintext without the proper key.
8. Cryptology: Cryptology is the broader field that encompasses both cryptography and
cryptanalysis. It deals with the study of secure communication and includes both the design
of secure systems (cryptography) and the efforts to break or compromise them
(cryptanalysis).
• Plaintext: The original, understandable message or data fed into the algorithm as input.
• Encryption Algorithm: This algorithm applies various substitutions and transformations to
the plaintext.
• Secret Key: An input independent of both the plaintext and algorithm, influencing the
algorithm's output. The exact transformations depend on the key.
• Cryptanalytic Attacks: There are two main approaches to attacking encryption systems:
• Cryptanalysis: Utilizes knowledge of the algorithm and characteristics of plaintext
to deduce specific plaintext or the encryption key.
• Brute-Force Attack: Tries every possible key on ciphertext until a readable
translation into plaintext is obtained. On average, half of all possible keys must be
tried for success.
• Attack Types Based on Information Known to Cryptanalyst:
• Ciphertext-Only Attack: Most challenging, only ciphertext is known.
• Known-Plaintext Attack: Analyst has knowledge of some plaintext and
corresponding ciphertext.
• Probable-Word Attack: Focuses on specific information in the message, aiding
decryption.
• Chosen-Plaintext Attack: Analyst can choose messages to encrypt, potentially
revealing the key structure.
Substitution Techniques:
Classical encryption methods demonstrate key principles in symmetric encryption and potential
cryptanalytic attacks. The fundamental elements in all encryption techniques are substitution and
transposition.
Substitution techniques involve replacing letters, numbers, or symbols in the plaintext with other
characters, or in the case of binary data, substituting bit patterns in the plaintext with
corresponding bit patterns in the ciphertext.
A monoalphabetic substitution cipher uses a single fixed substitution for each letter, providing
limited security. The security can be significantly improved by using a monoalphabetic substitution
cipher with homophones. In this method, a single letter can be replaced with multiple substitutes
known as homophones. These homophones can be assigned to each letter in rotation or randomly,
and the number of substitutes for each letter can be proportional to the relative frequency of that
letter. This approach effectively obliterates single-letter frequency information.
However, even with homophones, monoalphabetic ciphers are relatively easy to break because
they don't fully eliminate multiple-letter patterns in the ciphertext, such as diagram frequencies.
To further enhance security, two principal methods are used in substitution ciphers:
1. Encrypting Multiple Letters: Instead of encrypting one letter at a time, multiple letters of
plaintext can be encrypted together to obscure the structure further.
2. Using Multiple Cipher Alphabets: Employing multiple cipher alphabets provides additional
security. Each alphabet can be used in rotation or based on specific criteria, such as key
positions.
These methods help reduce the likelihood of patterns and regularities from the plaintext surviving
in the ciphertext, making cryptanalysis more challenging.
Encryption Process:
1. Divide the plaintext into pairs of letters (digraphs). If there is an odd number of letters/both
letters are same, add a filler letter (commonly "X") at the end.
2. For each digraph: a. Determine the positions (row and column) of the two letters in the key
matrix. b. Apply the following rules to each pair of letters:
Step 1: If the two letters are in the same row, replace them with the letters to their right,
wrapping around if necessary.
Step 2: If the two letters are in the same column, replace them with the letters below them,
wrapping around if necessary.
Step 3: If the two letters form a rectangle in the grid (neither in the same row nor the same
column), replace them with the letters at the opposite corners of the rectangle.
Step 4: If none of the above cases apply, replace the first letter with the letter in the same
row as the first letter but in the column of the second letter, and vice versa. c. Record the
new digraph in the ciphertext.
Using the Playfair Cipher with the key "playfairexample" and the message "hide the gold in the
tree stump" yields the ciphertext: "BMODZBXDNABEKUDMUIXMMOUVIF."
• Plaintext (P) is obtained by multiplying the ciphertext (C) with the decryption key (𝐾 −1 ) and
taking the result modulo 26.
• Key: You have a keyword or key phrase, which you repeat as needed to match the length
of the plaintext. For example, if your keyword is "KEY," and your plaintext is "HELLO,"
you'd repeat the keyword as "KEYKE" to match the length of "HELLO."
• Encryption: Each letter in the plaintext is shifted according to the corresponding letter in
the key. The shift is typically done using a Caesar cipher-like method. In a Caesar cipher,
• Decryption: To decrypt the ciphertext, you use the same key and shift each letter in the
ciphertext backward by the corresponding letter in the key.
Problem -1:
Key: deceptive
Message: “we are discovered save yourself
Key : deceptivedeceptivedeceptive
Plaintext : wearediscoveredsaveyourself
Ciphertext : zIcvTWqngRzgvTWavzHcqyglmgJ
In Vigenère cipher analysis, determining the keyword length is crucial. If identical sequences in the
plaintext occur at multiples of the keyword length, they generate identical ciphertext sequences.
Detecting such repeated sequences in the ciphertext, an analyst can guess the keyword length by
finding common factors in the displacements.
Once the keyword length (let's call it 'm') is known, the cipher essentially consists of 'm'
monoalphabetic substitution ciphers. Each group of 'm' positions in the message is encrypted using
the same monoalphabetic cipher. This allows the analyst to apply known frequency characteristics
of the language to attack each monoalphabetic cipher separately.
To eliminate the periodic nature of the keyword, an alternative approach involves using a
nonrepeating keyword that matches the message's length. Vigenère introduced the concept of an
autokey system, where the keyword is combined with the plaintext to create a running key for
encryption.
Vernam Cipher
The Vernam Cipher, also known as the one-time pad, is a type of encryption technique that offers
perfect secrecy when used correctly. It was invented by Gilbert Vernam in 1917 and is based on
the principle of using a random and secret key that is as long as the message itself.