2. Ingredients of Symmetric Encryption:
• Plain Text : An original / intelligible message or data
• Cipher text: coded message
• Enciphering/Encryption: process of converting plain text to cipher
text
• Deciphering/ Decryption: restoring the plain text from the ciphertext
• Key: the secret material used for performing encryption
3. Introduction to Crypto-terminologies
• Cryptography is an important aspect when we deal with network
security. ‘Crypto’ means secret or hidden. Cryptography is the science
of secret writing with the intention of keeping the data secret.
Cryptanalysis, on the other hand, is the science or sometimes the art
of breaking cryptosystems. These both terms are a subset of what is
called as Cryptology.
4. Classification –
The flowchart depicts that
cryptology is only one of the
factors involved in securing
networks. Cryptology refers to
study of codes, which involves
both writing (cryptography)
and solving (cryptanalysis)
them. Below is a classification
of the crypto-terminologies
and their various types.
5. 1. Cryptography – • Cryptography is classified into symmetric cryptography, asymmetric
cryptography and hashing. Below are the description of these types.
6. Symmetric key
cryptography
• It involves usage of one secret
key along with encryption and
decryption algorithms which help
in securing the contents of the
message. The strength of
symmetric key cryptography
depends upon the number of key
bits. It is relatively faster than
asymmetric key cryptography.
There arises a key distribution
problem as the key has to be
transferred from the sender to
receiver through a secure
channel.
7. Asymmetric key
cryptography
• It is also known as public key cryptography because it
involves usage of a public key along with secret key. It
solves the problem of key distribution as both parties
uses different keys for encryption/decryption. It is not
feasible to use for decrypting bulk messages as it is
very slow compared to symmetric key cryptography.
8. Hashing –
It involves taking the plain-text and converting it to a
hash value of fixed size by a hash function. This
process ensures integrity of the message as the hash
value on both, sender’s and receiver’s side should
match if the message is unaltered.
9. Steganography:
• “covered writing,” in contrast with cryptography, which means “secret
writing.” Eg: writing with soap in cloth will be visible when we make it
wet.
10. Types of Operation for Encryption:
• Substitution: Replacing one entity with other
• Transposition: Shuffling the entities
12. Classical attacks
It can be divided into
a)Mathematical analysis
b) Brute-force attacks.
Brute-force attacks runs the encryption algorithm for all possible cases
of the keys until a match is found. Encryption algorithm is treated as a
black box. Analytical attacks are those attacks which focuses on
breaking the cryptosystem by analysing the internal structure of the
encryption algorithm.
13. Social Engineering attack –
It is something which is dependent on the human factor. Tricking
someone to reveal their passwords to the attacker or allowing access to
the restricted area comes under this attack. People should be cautious
when revealing their passwords to any third party which is not trusted.
14. Implementation attacks –
Implementation attacks such as side-channel analysis can be used to
obtain a secret key. They are relevant in cases where the attacker can
obtain physical access to the cryptosystem.
16. Symmetric Cipher Model
Plaintext: The original intelligible message or data that is fed into the
algorithm as input
Encryption algorithm: The encryption algorithm performs various
substitutions and transformations on the plaintext
Secret key: The secret key is also an input to the encryption algorithm
Ciphertext: The scrambled unintelligible message produced as output
Decryption algorithm: It takes the ciphertext and the secret key to
produce the original plaintext
24. Classical Cryptographic Techniques
• have two basic components of classical
ciphers: substitution and transposition
• in substitution ciphers letters are replaced by other letters
• in transposition ciphers the letters are arranged in a different order
• these ciphers may be:
• monoalphabetic - only one substitution/ transposition is used, or
• polyalphabetic - where several substitutions/ transpositions are used
• several such ciphers may be concatentated together to form
a product cipher
25. Caesar Cipher - a monoalphabetic cipher
• replace each letter of message by a letter a fixed distance away eg use
the 3rd letter on
• reputedly used by Julius Caesar
• eg.
• L FDPH L VDZ L FRQTXHUHG
• I CAME I SAW I CONQUERED
26. Caesar Cipher - a monoalphabetic cipher
• ie mapping is
• ABCDEFGHIJKLMNOPQRSTUVWXYZ
• DEFGHIJKLMNOPQRSTUVWXYZABC
• can describe this cipher as:
• Encryption E_(k) : i -> i + k mod 26
• Decryption D_(k) : i -> i - k mod 26
27. Cryptanalysis of the Caesar Cipher
only have 26 possible ciphers
could simply try each in turn - exhaustive key search
GDUCUGQFRMPCNJYACJCRRCPQ
HEVDVHRGSNQDOKZBDKDSSDQR
Plain - IFWEWISHTOREPLACELETTERS
JGXFXJTIUPSFQMBDFMFUUFST
KHYGYKUJVQTGRNCEGNGVVGTU
Cipher - LIZHZLVKWRUHSODFHOHWWHUV
MJAIAMWLXSVITPEGIPIXXIVW
28. Cryptanalysis of the Caesar Cipher
• also can use letter frequency analysis
• Single Letter Double Letter Triple Letter
• E TH THE
• T HE AND
• R IN TIO
• N ER ATI
• I RE FOR
• O ON THA
• A AN TER
• S EN RES
29. Caesar Cipher
Plaintext: meet me after the party
Ciphertext: PHHW PH DIWHU WKH SDUWB
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
D E F G H I G K L M N O P Q R S T U V W X Y Z A B C
• Letter 3rd letter
Gaius Julius Caesar: Roman Dictator, 1st century BC
30. Caesar Cipher
C = E(K, P) = (P + K) mod 26
P = D(K, C) = (C - K) mod 26
a b c d e f g h i j k l m
0 1 2 3 4 5 6 7 8 9 10 11 12
n o p q r s t u v w x y z
13 14 15 16 17 18 19 20 21 22 23 24 25
31. Playfair Cipher
• In this scheme, pairs of letters are encrypted,
instead of single letters as in the case of simple
substitution cipher.
• In playfair cipher, initially a key table is created. The
key table is a 5×5 grid of alphabets that acts as the
key for encrypting the plaintext. Each of the 25
alphabets must be unique and one letter of the
alphabet (usually J) is omitted from the table as we
need only 25 alphabets instead of 26. If the
plaintext contains J, then it is replaced by I.
• The sender and the receiver deicide on a particular
key, say ‘tutorials’. In a key table, the first
characters (going left to right) in the table is the
phrase, excluding the duplicate letters. The rest of
the table will be filled with the remaining letters of
the alphabet, in natural order. The key table works
out to be −
32. Playfair Cipher
• Process of Playfair Cipher
• First, a plaintext message is split into pairs of two letters (digraphs). If
there is an odd number of letters, a Z is added to the last letter. Let us
say we want to encrypt the message “hide money”. It will be written
as −
• HI DE MO NE YZ
• The rules of encryption are −
• If both the letters are in the same column, take the letter below each one
(going back to the top if at the bottom)
33. Rules for playfair cipher
T U O R I
‘H’ and ‘I’ are in
same column,
hence take letter
below them to
replace. HI → QC
A L S B C
D E F G H
K M N P Q
V W X Y Z
34. Rules for playfair cipher
• If both letters are in the same row, take the letter to the right of each
one (going back to the left if at the farthest right)
•T U O R I
‘D’ and ‘E’ are in
same row,
hence take
letter to the
right of them to
replace. DE →
EF
A L S B C
D E F G H
K M N P Q
V W X Y Z
35. Rules for playfair cipher
• If neither of the preceding two rules are true, form a rectangle with
the two letters and take the letters on the horizontal opposite corner
of the rectangle.
36. Hill Cipher
• Hill cipher is a polygraphic substitution cipher based on linear
algebra.Each letter is represented by a number modulo 26. Often the
simple scheme A = 0, B = 1, …, Z = 25 is used, but this is not an
essential feature of the cipher. To encrypt a message, each block of n
letters (considered as an n-component vector) is multiplied by an
invertible n × n matrix, against modulus 26. To decrypt the message,
each block is multiplied by the inverse of the matrix used for
encryption.
• The matrix used for encryption is the cipher key, and it should be
chosen randomly from the set of invertible n × n matrices (modulo
26).
37. Hill Cipher
• We have to encrypt the message ‘ACT’ (n=3).The key is ‘GYBNQKURP’
which can be written as the nxn matrix:
• The message ‘ACT’ is written as vector:
38. Hill Cipher
• The enciphered vector is given as:
• which corresponds to ciphertext of ‘POH’
39. Decryption
• To decrypt the message, we turn the ciphertext back into a vector,
then simply multiply by the inverse matrix of the key matrix
(IFKVIVVMI in letters).The inverse of the matrix used in the previous
example is:
40. Hill Cipher
• For the previous Ciphertext ‘POH’:
• which gives us back ‘ACT’.
41. Row Transposition cipher
• Given a plain-text message and a numeric key, cipher/de-cipher the
given text using Columnar Transposition Cipher
• The Columnar Transposition Cipher is a form of transposition cipher
just like Rail Fence Cipher. Columnar Transposition involves writing
the plaintext out in rows, and then reading the ciphertext off in
columns one by one.
42. Encryption
• In a transposition cipher, the order of the alphabets is re-arranged to obtain the cipher-
text.
• The message is written out in rows of a fixed length, and then read out again column by
column, and the columns are chosen in some scrambled order.
• Width of the rows and the permutation of the columns are usually defined by a keyword.
• For example, the word HACK is of length 4 (so the rows are of length 4), and the
permutation is defined by the alphabetical order of the letters in the keyword. In this
case, the order would be “3 1 2 4”.
• Any spare spaces are filled with nulls or left blank or placed by a character (Example: _).
• Finally, the message is read off in columns, in the order specified by the keyword.
•
44. Decryption
• To decipher it, the recipient has to work out the column lengths by
dividing the message length by the key length.
• Then, write the message out in columns again, then re-order the
columns by reforming the key word.