module-1 elementary cryptography
module-1 elementary cryptography
Elementary cryptosystem:
Symmetric encryption, also referred to as conventional encryption or single-key
encryption, was the only type of encryption in use prior to the development of
public-key encryption in the 1970s. It remains by far the most widely used of the
two types of encryption.
Plaintext: This is the original intelligible message or data that is fed into the
algorithm as input.
Secret key: The secret key is also input to the encryption algorithm. The key is a
value independent of the plaintext and of the algorithm. The algorithm will
produce a different output depending on the specific key being used at the time.
The exact substitutions and transformations performed by the algorithm depend
on the key.
2. Sender and receiver must have obtained copies of the secret key in a secure
fashion and must keep the key secure. If someone can discover the key and
knows the algorithm, all communication using this key is readable. We
assume that it is impractical to decrypt a message on the basis of the
ciphertext plus knowledge of the encryption/decryption algorithm. In other
words, we do not need to keep the algorithm secret; we need to keep only
the key secret. This feature of symmetric encryption is
With the message X and the encryption key K as input, the encryption algorithm
forms the ciphertext Y = [Y1, Y2, ..., YN]. We can write this As Y = E(K, X) This
notation indicates that Y is produced by using encryption algorithm E as a function
of the plaintexXt , with the specific function determined by the value of the key K.
Cryptography
2. The number of keys used. If both sender and receiver use the same key,
the system is referred to as symmetric, single-key, secret-key, or
conventional encryption. If the sender and receiver use different keys, the
system is referred to as asymmetric, two-key, or public-key encryption.
Cryptanalysis
Table below summarizes the various types of cryptanalytic attacks, based on the
amount of information known to the cryptanalyst. The most difficult problem is
presented when all that is available is the cipher text only. In some cases, not
even the encryption algorithm is known, but in general we can assume that the
opponent does know the algorithm used for encryption. One possible attack under
these circumstances is the brute-force approach of trying all possible keys. If the
key space is very large, this becomes impractical. Thus, the opponent must rely
on an analysis of the cipher text itself, generally applying various statistical tests
to it.
Substitution Techniques:
Caesar Cipher
The earliest known use of a substitution cipher, and the simplest, was by Julius
Caesar. The Caesar cipher involves replacing each letter of the alphabet with the
letter standing three places further down the alphabet. For example,
Then the algorithm can be expressed as follows. For each plaintext letter p,
substitute the ciphertext letter C:
C = E(3, p) = (p + 3) mod 26
A shift may be of any amount, so that the general Caesar algorithm is
C = E(k, p) = (p + k) mod 26
where k takes on a value in the range 1 to 25. The decryption algorithm is simply
p = D(k, C) = (C k) mod 26
Monoalpabetic ciphers
In generalised Caeser cipher the number of possible key is 25. If, instead, the cipher= line can be any
permutation of the 26 alphabetic characters, then there are 26! or greater than 4 * 1026 possible keys.
Cryptanalysis scope on Monoalphabetic cipher : If the cryptanalyst knows the nature of the plaintext
(e.g., non-compressed English text), then the analyst can exploit the
regularities of the language.
Vigenere Cipher
Vigenere Cipher is a method of encrypting alphabetic text. It uses a simple form of polyalphabetic
substitution. A polyalphabetic cipher is any cipher based on substitution, using multiple substitution
alphabets. The encryption of the original text is done using theVigenère square or Vigenère table.
• The table consists of the alphabets written out 26 times in different rows, each alphabet shifted
cyclically to the left compared to the previous alphabet, corresponding to the 26 possible.Caesar
Ciphers
• At different points in the encryption process, the cipher uses a different alphabet from one of the
rows.
• The alphabet used at each point depends on a repeating keyword.
Example:
Input : Plaintext : GEEKSFORGEEKS
Keyword : AYUSH
Output : Ciphertext : GCYCZFMLYLEIM
For generating key, the given keyword is repeated in a circular manner until it matches the length of
the plain text. The keyword "AYUSH" generates the key "AYUSHAYUSHAYU" The plain text is then
encrypted using the process explained below.
One-time pad cipher is a type of Vignere cipher which includes the following features −
Why is it Unbreakable?
The key is unbreakable owing to the following features −
•The key is as long as the given message.
•The key is truly random and specially auto-generated.
•Key and plain text calculated as modulo 10/26/2.
•Each key should be used once and destroyed by both sender and receiver.
•There should be two copies of key: one with the sender and other with the receiver.
Playfair cipher : In Playfair cipher, two consecutive letters in the plaintext, called digrams, are
taken at a time and translated into cipher text digrams.