Crypto Mod2@Azdocuments - in
Crypto Mod2@Azdocuments - in
com
MODULE 2
SYMMETRIC CIPHERS: Traditional Block Cipher structure, Data
encryption standard (DES), The AES Cipher.
Text Books:
Explore Electronics 1
CRYPTOGRAPHY https://deepaharivinod.blogspot.com
MODULE 2
SYMMETRIC CIPHERS
Symmetric key cryptography, also known as private key cryptography,
utilizes a single key for both encryption of the plaintext and decryption of the
cipher text. The key itself must be shared between the sender and the receiver,
and this process, known as key exchange, constitutes an entire subtopic
of cryptography.
Block ciphers
A block cipher is one in which a block of plaintext is treated as a whole
and used to produce a cipher text block of equal length.
Typically, a block size of 64 or 128 bits is used.
As with a stream cipher, the two users share a symmetric encryption key
Plaintext: 227 bytes Block size: 16bytes =227/16=14 blocks & 3 bytes
Total block 15 in which last block contain 3 bytes and padding bytes
Explore Electronics 2
CRYPTOGRAPHY https://deepaharivinod.blogspot.com
Stream ciphers
A stream cipher is one that encrypts a digital data stream one bit or one
byte at a time. Examples: one time pad
In which the key stream (ki) is as long as the plaintext bit stream (pi).
If the cryptographic key stream is random, then this cipher is unbreakable
by any means other than acquiring the key stream.
However, the key stream must be provided to both users in advance via
some independent and secure channel.
Explore Electronics 3
CRYPTOGRAPHY https://deepaharivinod.blogspot.com
A stream cipher is one that encrypts a digital data stream one bit or one
byte at a time. Examples of classical stream ciphers are the autokeyed Vigenere
Explore Electronics 4
CRYPTOGRAPHY https://deepaharivinod.blogspot.com
cipher and the Vernam cipher. A block cipher is one in which a block of
plaintext is treated as a whole and used to produce a ciphertext block of equal
length.
Feistel cipher is based on the idea that instead of using Ideal block cipher
which degrades performance, a “substitution-permutation network” can be used.
Explore Electronics 5
CRYPTOGRAPHY https://deepaharivinod.blogspot.com
Explore Electronics 6
CRYPTOGRAPHY https://deepaharivinod.blogspot.com
Block size: Larger block sizes mean greater security but reduced
encryption/decryption speed for a given Traditionally, a block size of 64
bits used which gives enough security without greatly affecting the speed.
Key size: Larger key size means greater security but may decrease
encryption/ decryption speed. The greater security achieved by greater
resistance to brute-force attacks and greater confusion. Key sizes of 64
bits or less now widely considered to inadequate, and 128 bits has
become a common size.
The number of rounds: The essence of the Feistel cipher that a single
round offers inadequate security but that multiple rounds offer increased
security. A typical size 16 rounds.
Sub key generation algorithm: Greater complexity in this algorithm
leads to greater difficulty of cryptanalysis
Round function F: Again, greater complexity generally means greater
resistance to cryptanalysis.
Explore Electronics 7
CRYPTOGRAPHY https://deepaharivinod.blogspot.com
o The permuted output then passed through sixteen rounds of the same
function, which involves both permutation and substitution functions. The
left and right halves from the last round swapped to produce pre output.
o The right-hand portion of the figure shows the way in which the 56-bit
key used.
o Then, a sub key (ki) produced for each of the sixteen rounds by the
combination of a left circular shift and a permutation.
o The permutation functions the same for each round, but a different sub
key produced because of the repeated shifts of the key bits.
Explore Electronics 8
CRYPTOGRAPHY https://deepaharivinod.blogspot.com
Explore Electronics 9
CRYPTOGRAPHY https://deepaharivinod.blogspot.com
Explore Electronics 11
CRYPTOGRAPHY https://deepaharivinod.blogspot.com
labeled C0 and D0. At each round, Ci-1 and Di-1 are separately subjected to a
circular left shift, or rotation, of 1 or 2 bits These shifted values serve as input to
the next round. They also serve as input to Permuted Choice Two which
produces a 48-bit output that serves as input to the function F(Ri-1, Ki).
DES Decryption
As with any Feistel cipher, decryption uses the same algorithm as
encryption, except that the application of the sub keys is reversed. Additionally,
the initial and final permutations are reversed
Explore Electronics 12
CRYPTOGRAPHY https://deepaharivinod.blogspot.com
Explore Electronics 13
CRYPTOGRAPHY https://deepaharivinod.blogspot.com
Shiftrows
Each of the four rows of the matrix is shifted to the left. Any entries that ‘fall
off’ are re-inserted on the right side of row. Shift is carried out as follows −
The result is a new matrix consisting of the same 16 bytes but shifted
with respect to each other.
MixColumns
Addroundkey
The 16 bytes of the matrix are now considered as 128 bits and are
XORed to the 128 bits of the round key. If this is the last round then the output
is the ciphertext. Otherwise, the resulting 128 bits are interpreted as 16 bytes
and we begin another similar round.
Explore Electronics 14
CRYPTOGRAPHY https://deepaharivinod.blogspot.com
Decryption Process
The process of decryption of an AES ciphertext is similar to the encryption
process in the reverse order. Each round consists of the four processes
conducted in the reverse order −
Since sub-processes in each round are in reverse manner, unlike for a Feistel
Cipher, the encryption and decryption algorithm needs to be separately
implemented, although they are very closely related.
Explore Electronics 15