Crypto Techniques VK
Crypto Techniques VK
Crypto Techniques VK
Techniques
Vikas Kaul
1
Outline
I. Introduction to Cryptography
II. Conventional Encryption Principles
III. Characteristics of Cryptographic Techniques
IV. Symmetric Encryption
V. Asymmetric Encryption
VI. Classical Encryption Algorithms
VII. Block vs Stream Ciphers
VIII. Results and Conclusion
IX. References
2
I. Introduction to Cryptography
Plaintext - original message
3
II. Conventional Encryption Principles
Secret Key
Ciphertext
Decryption algorithm
4
III.Characteristics of Cryptographic
Techniques
Classified along three independent dimensions:
The type of operations used for transforming plaintext to
ciphertext
substitution / transposition / product
The number of keys used
symmetric (single key)
asymmetric (two-keys)
The way in which the plaintext is processed
block
stream
5
IV. Symmetric Encryption
In classical cryptography,the
same secret key is used for
encryption and decryption.
sender and recipient share a
common key
It is for this reason that
classical cryptography is also
referred to as symmetric key
cryptography.
Also called conventional /
secret-key / single-key.
6
V. Asymmetric Encryption
The encryption and
decryption keys are
different.
Also one of the key is placed
in the public domain.
Called asymmetric key
cryptography, public key
cryptography, etc.
VI.Classical Ciphers
Caesar Cipher
Monoalphabetic Cipher
Playfair Cipher
Polyphabetic Cipher
Vigenère Cipher
Transposition Cipher
Rail Fence Cipher
Cryptography -Part -I 8
Caesar Cipher
Earliest known substitution cipher by Julius Caesar
Letters of plaintext are replaced by other letters or by numbers or symbols
Replaces each letter by 3rd letter after
Example:
meet me after the toga party
PHHW PH DIWHU WKH WRJD SDUWB
Mathematically give each letter a number
abcdefghij k l m n o p q r s t u v w x y z
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Then have Caesar cipher as:
c = E(p) = (p + k) mod (26)
p = D(c) = (c – k) mod (26)
Key space: {0, 1, ..., 25}
Vulnerable to brute-force attacks.
9
Monoalphabetic Cipher
Rather than just shifting the alphabet
Could shuffle (jumble) the letters arbitrarily
Each plaintext letter maps to a different random ciphertext letter
Hence key is 26 letters long
Example:
Plain: abcdefghijklmnopqrstuvwxyz
Cipher: DKVQFIBJWPESCXHTMYAUOLRGZN
Plaintext: ifwewishtoreplaceletters
Ciphertext: WIRFRWAJUHYFTSDVFSFUUFYA
10
Playfair Cipher
Not even the large number
of keys in a mono
alphabetic cipher provides
security
One approach to improving
security was to encrypt
multiple letters
a 5X5 matrix of letters
based on a keyword
fill in letters of keyword
(minus duplicates)
fill rest of matrix with other
letters
eg. using the keyword
MONARCHY
11
Playfair Cipher
Rules:
• If a pair is a repeated letter, insert filler like 'X’.
• If both letters fall in the same row, replace each with the
letter to its right (circularly).
• If both letters fall in the same column, replace each with the
the letter below it (circularly).
• Otherwise, each letter is replaced by the letter in the same
row but in the column of the other letter of the pair.
Issue:
The cryptanalysis of the Playfair cipher is also aided by the fact
that a digram and its reverse will encrypt in a similar
fashion.That is, if AB encrypts to XY, then BA will encrypt
to YX.
Plaintext:"Hide the gold in the tree stump“
14
Vigenere Cipher
Polyalphabetic substitution based
on the following tableau
For example, the first letter of the
plaintext, A, is paired with L, the
first letter of the key. So use
row L and column A of the
Vigenère square, namely L.
Plaintext: ATTACKATDAW
Key: LEMONLEMONL
Ciphertext: LXFOPVEFRNH
Hill Cipher
The Hill cipher is a polygraphic
substitution cipher
Each letter is represented by a
number modulo 26
To encrypt a message, each block
of n letters is multiplied by an
invertible n × n matrix,
again modulus26
To decrypt the message, each block is
multiplied by the inverse of the matrix
used for encryption.
Unfortunately, the basic Hill cipher is
vulnerable to a known-plaintext attack
because it is completely linear.
Transposition Cipher
Mapping is performed by some
sort of permutation on the
plaintext letters.
Also called permutation
ciphers.
Shuffle the plaintext, without
altering the actual letters used.
Example: Row Transposition Ciphertext:
Ciphers. ETGTIMDFGXEMHHEMAIRDENOOYTITES
The cipher can be made more
secure by performing multiple
rounds of such permutations.
17
Rail Fence Cipher
The message is then read off in
rows. For example, if we have 3
"rails" and a message of 'WE ARE
DISCOVERED. FLEE AT ONCE',
the cipherer writes out.
The rail fence cipher is not very
strong; the number of practical
keys (the number of rails) is small
enough that a cryptanalyst can try
them all by hand.
Block vs Stream Ciphers
Block ciphers process messages in blocks, Stream ciphers process messages a bit or
each of which is then en/decrypted byte at a time when en/decrypting
like a substitution on very big characters partition the text into small (e.g. 1
64-bits or more bit)blocks and let the encoding of each
Encipher, decipher multiple bits at once block depend on many previous blocks.
for each block, a different “key” is
Each block enciphered independently
Problem: identical plaintext blocks produce generated.
identical ciphertext blocks High speed and low hardware complexity.
Example: two database records Usually simple and much faster
MEMBER: HOLLY INCOME Examples are FISH,SNOW,RC4 etc
$100,000
MEMBER: HEIDI INCOME
$100,000
Encipherment:
ABCQZRME GHQMRSIB
CTXUVYSS RMGRPFQN
ABCQZRME ORMPABRZ
CTXUVYSS RMGRPFQN
Examples :DES,RC5,Blowfish,IDEA r.
DES