CNS Algo
CNS Algo
CNS Algo
Symmetric encryption transforms plaintext into ciphertext using a secret key and
an encryption algorithm. Using the same key and a decryption algorithm, the
plaintext is recovered from the ciphertext.
The two types of attack on an encryption algorithm are cryptanalysis and brute-
force.
• Plaintext
• Encryption algorithm
• Secret key
• Ciphertext
• Decryption algorithm
There are two requirements for secure use of conventional encryption:
Cryptanalysis:
Cryptanalytic attacks rely on the nature of the algorithm plus perhaps some knowledge
of the general characteristics of the plaintext or even some sample plaintext–ciphertext
pairs. This type of attack exploits the characteristics of the algorithm to attempt to
deduce a specific plaintext or to deduce the key being used.
Brute-force attack:
The attacker tries every possible key on a piece of cipher text until an intelligible
translation into plaintext is obtained. On an average, half of all possible keys must be
tried to achieve success.
Types of Attacks on Encrypted Messages
Average Time Required for Exhaustive Key Search
Substitution Techniques
The two basic building blocks of all encryption techniques are substitution and
transposition.
A substitution technique is one in which the letters of plaintext are replaced by other
letters or by numbers or symbols.1 If the plaintext is viewed as a sequence of bits, then
substitution involves replacing plaintext bit patterns with ciphertext bit patterns.
Caesar Cipher
The earliest known, and the simplest, use of a substitution cipher was by Julius
Caesar. The Caesar cipher involves replacing each letter of the alphabet with
the letter standing three places further down the alphabet.
plain: a b c d e f g h i j k l m n o p q r s t u v w x y z
cipher: D E F G H I J K L M N O P Q R S T U V W X Y Z A B 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 takes on a value in the range 1 to 25.The decryption algorithm is simply
p = D(k,C) = (C- k) mod 26
Monoalphabetic Cipher
A monoalphabetic substitution is a cipher in which each
occurrence of a plaintext symbol is replaced by a corresponding
ciphertext symbol to generate ciphertext based on the single
alphabetic key
Polyalphabetic Cipher
1. Vigenere Cipher
1. Repeating plaintext letters that are in the same pair are separated with a
filler letter, such as x, so that balloon would be treated as ba lx lo on.
2. Two plaintext letters that fall in the same row of the matrix are each
replaced by the letter to the right, with the first element of the row
circularly following the last. For example, ar is encrypted as RM.
3. Two plaintext letters that fall in the same column are each replaced by
the letter beneath, with the top element of the column circularly
following the last. For example, mu is encrypted as CM.
4. Otherwise, each plaintext letter in a pair is replaced by the letter that lies
in its own row and the column occupied by the other plaintext letter.
Thus, hs
5. becomes BP and ea becomes IM (or JM, as the encipherer wishes)
One-Time Pad
• Joseph Mauborgne, proposed an improvement to the Vernam cipher that
yields the ultimate in security.
• Mauborgne suggested using a random key that is as long as the message, so
that the key need not be repeated. In addition, the key is to be used to
encrypt and decrypt a single message, and then is discarded.
• Each new message requires a new key of the same length as the new
message. Such a scheme, known as a one-time pad, is unbreakable
• It produces random output that bears no statistical relationship to the
plaintext
• The security of the one-time pad is entirely due to the randomness of the
key.
The one-time pad is the only cryptosystem that exhibits what is referred to as
Transposition Techniques
Its a very different kind of mapping achieved by performing some sort of
permutation on the plaintext letters.
The simplest such cipher is the rail fence technique, in which the plaintext is
written down as a sequence of diagonals and then read off as a sequence of rows.
Example:
Plaintext: “meet me after the toga party”
Depth: 2