ISModule-2 1
ISModule-2 1
CRYPTOGRAPHY
Objectives
• What is Cryptography
• Plain Text and Cipher Text
• Substitution Techniques
• Transposition Techniques
• Encryption and Decryption
• Symmetric and Asymmetric Key
Cryptography
• Steganography
• Exercises
What is Cryptography
Fig. 3.2
Plain Text and Cipher Text… Cont
Fig. 3.3
Substitution Techniques
• Caesar Cipher
– Scheme illustrated in fig. 3.1 – proposed by
Julius Caesar – Caesar Cipher
– Substitution Cipher Techniques – char plain
text are replaced by other char, number or
symbols
– Caesar cipher is a very weak scheme – reverse
the Caesar Cipher process
Substitution Techniques … Caesar Cipher… Cont..
Fig. 3.4
Fig. 3.5
Example of Breaking Caesar Cipher
Exercises
Fig. 3.6
Table: 3.1
Exercises
• Mono-alphabetic cipher
– Major weakness of the Caesar Cipher – predictability
– Mono-alphabetic cipher – use random substitution ( A
can replace with B through Z) and so on
– Mathematically – permutation or combination of the
26 alphabet (26x25x24x23x…2) or 4 x 1026 – hard to
crack
– But it useless, if the cipher text – short.
Substitution Techniques.. Homophonic
Fig. 3.7
Substitution Techniques.. Polyalphabetic
Fig. 3.9
• It has 2 techniques
– Basic Technique
– Simple Columnar Transposition Technique with
Multiple Rounds
Basic Techniques
• The algorithm shown in fig. 3.10
Fig. 3.10
Fig. 3.12
Fig. 3.13
Vernam Cipher
• Also called One-Time-Pad – implement using a random
set of non-repeating characters as the input cipher text
• Once use never use again
• The length of the input cipher text = plain text
• Algorithm described in Fig. 3.14 Fig. 3.14
• Apply the Vernam Cipher algorithm to plain text
message HOW ARE YOU using one time-pad
NCBTZQARX
• The steps shown in fig. 3.15
• More secure (discarded one-time-pad after
used) and suitable for small plain text message
but not practical for large.
• Implemented at AT&T – help of a device –
Vernam Machine
Fig. 3.15
Book Cipher
Fig. 3.16
Fig. 3.17
• In computer communication – sender send the
encrypt message through the network.
• Receiver received the message and decrypt it to
plain text.
• To encrypt and decrypt the message –
encryption and decryption algorithm
• Usage both must be same each other –
otherwise the decryption cannot success
• Others method using key = one time pad in
Vernam Technique
• Algorithm – know to everyone– to made the
message secure – use the key.
Fig. 3.18
• There are 2 cryptography mechanism
– Symmetric key Cryptography = use same key to
encrypt and decrypt the message
– Asymmetric key Cryptography – use different key
in encrypt and decrypt the message
Fig. 3.19
Symmetric and Asymmetric Key Cryptography
• Algorithm Types
– Stream Ciphers
– Block Ciphers
Step 4 Key 16 16
rounds rounds Key
Key
Transformation 64-bit ->56-bit
key -> 48 bit
sub-key
Expansion
Permutation
S-Box
Substitution
32-bit
P-Box RPT
Permutation
Discarding of every 8th bit of original 64-bit key (shaded positions are discarded)
Compression Permutation
Expansion Permutation (EP)
S-box Substitution
S-box Substitution
The substitution is performed by 8 substitution
boxes called S-boxes.
Each of the 8 S-boxes has 6-bit input and a 4-bit
output.
The 48 bit input block is divided into 8 sub-
blocks (each of 6 bits),and each such sub-block
is given to S-box.
What is the logic used by S-box substitution for
selecting only 4 of the 6 bits?
Every S-box as a table with 4 rows(0 to 3) and
16 columns (0 to 15).
S-box Substitution
S-box 1
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
0
1
2
3
S-box 2
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
0
1
2
3
….
S-box 8
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
0
1
2
3
Selection of S-box output based on input
b6 Selecting an
b1 b2 b3 b4 b5
entry in a S-box
based on the 6
4-bit column number bit input
2-bit row number
1 0 1 1 0 1
1 0 1 1 0 1
Old LPT
New LPT
Final Permutation
1. At the end of the 16 rounds, the Final Permutation is performed (only once)
2. The output of the Final Permutation is the 64-bit encrypted block.
DES Decryption:-
1.The same algorithm used for encryption in DES also works for Decryption.
2. The only difference between the encryption and decryption process is the
reversal of key portions.
3. The original key k was divided into K1, K2, K3,….K16 encryption rounds,
then for decryption, the key should be used as K16, K15, K14,……K1.
Variations of DES
Initially it was
PES (Proposed Encryption Standard)-1990
IPES(Improved Proposed Encryption Standard)-1991
IDEA(International Data Encryption Algorithm)-1992
IDEA is not popular as DES: 2 reasons
It is patent unlike DES (must be licensed before it can
be used in commercial applications.)
DES has a long history and track record compared to
IDEA.
PGP(Pretty Good Privacy) is based on IDEA.
IDEA
IDEA is a block cipher.
It works on 64-bit plain text blocks.
The key is longer, 128-bit key.
IDEA is reversible like DES (Same algorithm used
for encryption and decryption)
The 64-bit plain text divided into
4 blocks(p1,p2,p3,p4) each of 16-bit.
IDEA has 8 rounds.
In Each round, 6 sub-keys are generated. Each
sub-key is of 16 bits.
Broad Level steps in IDEA
Details of one round in IDEA
Details of one round in IDEA
83-128,1-50
(96bits)
Sub-Key generation for 5,6,7,8
Round : 5 96 bits(76-128,
1-43) Used
32 bits (44-75)
Unused
Round : 6 64bits(101-128,
1-36 )Used
64 bits(37-
100) Unused
Round : 7,8
32 bits(126-
128,1-29) Used
96 bits(30-
125) Unused
Output Transformation (OT)
1. For Output Transformation we
need 4 keys. K49,K50,K51,K52
IDEA Decryption
same as encryption.
The decryption keys
inverse of the encryption sub-keys.
Strength of IDEA
IDEA uses 128-bit key
Key size is double than of DES.
To break IDEA, 2128 encryption operations required