Unit 2
Unit 2
Unit 2
messages
Cryptanalysis
• The process of attempting to discover the
plaintext or key is known as cryptanalysis.
• The strategy used by the cryptanalyst depends
on nature of the encryption scheme and the
information available to the cryptanalyst.
Average time required for exhaustive
key search
Bit 0 1 2 3 4 5 6 7 Bit 0 1 2 3 4 5 6 7
1 58 50 42 34 26 18 10 2 1 40 8 48 16 56 24 64 32
9 60 52 44 36 28 20 12 4 9 39 7 47 15 55 23 63 31
17 62 54 46 38 30 22 14 6 17 38 6 46 14 54 22 62 30
25 64 56 48 40 32 24 16 8 25 37 5 45 13 53 21 61 29
33 57 49 41 33 25 17 9 1 33 36 4 44 12 52 20 60 28
41 59 51 43 35 27 19 11 3 41 35 3 43 11 51 19 59 27
49 61 53 45 37 29 21 13 5 49 34 2 42 10 50 18 58 26
57 63 55 47 39 31 23 15 7 57 33 1 41 9 49 17 57 25
Since right input is 32-bit and round key is a 48-bit, we first need to
expand right input to 48 bits.
Permutation logic is graphically depicted in the following illustration −
The graphically depicted permutation logic is generally described as table in DES specification illustrated as shown −
Encryption (Round) (cont.)
■ E ■ P
32 1 2 3 4 5 16 7 20 21 29 12 28 17
4 5 6 7 8 9
1 15 23 26 5 18 31 10
8 9 10 11 12 13
2 8 24 14 32 27 3 9
12 13 14 45 16 17
16 17 18 19 20 21 9 13 30 6 22 11 4 25
20 21 22 23 24 25
24 25 26 27 28 29
28 29 30 31 32 1
Expansion Expansion
Encryption (Round) (cont.)
■ S-box
[1
]
DES Key Schedule
• forms subkeys used in each round
– initial permutation of the key (PC1) which selects
56-bits in two 28-bit halves
– 16 stages consisting of:
• rotating each half separately either 1 or 2 places
depending on the key rotation schedule K
• selecting 24-bits from each half & permuting them by
PC2 for use in round function F
• Concerns about:
– The algorithm and the key length (56-bits)
DES Analysis
The DES satisfies both the desired properties of block cipher. These two properties
make cipher very strong.
• Avalanche effect − A small change in plaintext results in the very grate change in
the ciphertext.
• Completeness − Each bit of ciphertext depends on many bits of plaintext.
During the last few years, cryptanalysis have found some weaknesses in DES when key
selected are weak keys. These keys shall be avoided.
DES has proved to be a very well designed block cipher. There have been no significant
cryptanalytic attacks on DES other than exhaustive key search.
Time to break a code (106
decryptions/µs)
Double DES and Triple DES
Double DES
(or)
Double DEA
Triple DES
(or)
Triple DEA
With two
Triple DEA
with 3 keys
• C = ciphertext
C = EK3[DK2[EK1[P]]]
• P = Plaintext
• EK[X] = encryption of X using key K
• DK[Y] = decryption of Y using key K
⮚ designed to have:
● resistance against known attacks
● speed and code compactness on many CPUs
AES Structure
Process
AES
Structure
Some Comments on AES
⮚ uses one table of 16x16 bytes containing a permutation of all 256 8-bit values
⮚ each byte of state is replaced by byte indexed by row (left 4-bits) & column (right 4-
bits)
Substitute Bytes
Example
Shift Rows
4th back
Two problems:
1. two identical plain text block produce two identical
cipher blocks
2. blocks can be rearranged or modified.
Example: An eavesdropper:
1. can see which sets of employees have identical or
similar salaries and
2. he can alter his own salary to match another
employee with higher salary.
ECB Scheme
Remarks on ECB
• Typical application:
– secure transmission of short pieces of information (e.g. a
temporary encryption key)
Cipher Block Chaining (CBC)
• Solve security deficiencies in ECB
– Repeated same plaintext block result different ciphertext block
75
2. Message Authentication without Message Encryption -
Message Authentication Code
MACM=F(KAB,M)
If received code matches the calculated code, then:
(67452301,efcdab89,98badcfe,10325476,c3d2e1f0)
81
use 4 rounds of 20 bit operations on message block & buffer
Message Digest Generation Using
Secure Hash Algorithm – 1 (SHA-1)
82
SHA-1 Processing of single 512-Bit Block
SHA-1 Compression Function
85
SHA-1 Compression Function
thus:
86
Other Secure HASH functions
HMAC
• Use a MAC derived from a cryptographic
hash code, such as SHA-1.
• Motivations:
– Cryptographic hash functions executes faster
in software than encryptoin algorithms such as
DES
– Library code for cryptographic hash functions
is widely available
– No export restrictions from the US
A cryptographic hash function: hash function which takes an input (or 'message') and returns a
fixed-size alphanumeric string, which is called the hash value (sometimes called a message digest, a
•To allow for easy replaceability of the embedded hash functions in case
faster or more secure hash functions are found or required.