Net Security Chap 2
Net Security Chap 2
What is DES?
What is AES?
One of the primary objectives for the DES replacement algorithm from
the National Institute of Standards and Technology (NIST) was that
it had to be proficient in both software as well as hardware
implementation. (DES was originally only practical in hardware
implementations). C and Java reference implementation were used for
performance analysis of all the algorithms.
Security Because DES uses Because AES uses a large secret key, it
a smaller key, it is more secure.
is less secure.
o The main difference between DES and AES is that in DES, the
block is split into two halves before being processed further, but in
AES, the entire block is processed to get ciphertext.
o DES has a key size of 56 bits, which is less than AES, which has a
secret key size of 128, 192, or 256
o AES is comparatively faster than DES.
o The smaller key size of DES makes it less secure than AES.
o The Feistel Cipher principle is used in the DES algorithm, while
the substitution and permutation principle are used in the AES
o Expansion Permutation, Xor, S-box, P-box, Xor, and Swap. On the
other hands, rounds in AES include Subbytes, Shiftrows, Mix
columns, and Addroundkeys.
1. ECB mode
ECB mode stands for Electronic Code Block Mode. It is one of the
simplest modes of operation. In this mode, the plain text is divided
into a block where each block is 64 bits. Then each block is
encrypted separately. The same key is used for the encryption of
all blocks. Each block is encrypted using the key and makes the
block of ciphertext.
At the receiver side, the data is divided into a block, each of 64
bits. The same key which is used for encryption is used for
decryption. It takes the 64-bit ciphertext and, by using the key
convert the ciphertext into plain text.
As the same key is used for all blocks’ encryption, if the block of
plain text is repeated in the original message, then the ciphertext’s
corresponding block will also repeat. As the same key used for tor
all block, to avoid the repetition of block ECB mode is used for an
only small message where the repetition of the plain text block is
less.
2. CBC Mode
CBC Mode stands for Cipher block Mode at the sender side; the
plain text is divided into blocks. In this mode, IV(Initialization
Vector) is used, which can be a random block of text. IV is used to
make the ciphertext of each block unique.
The first block of plain text and IV is combined using the XOR
operation and then encrypted the resultant message using the key
and form the first block of ciphertext. The first block of ciphertext
is used as IV for the second block of plain text. The same
procedure will be followed for all blocks of plain text.
At the receiver side, the ciphertext is divided into blocks. The first
block ciphertext is decrypted using the same key, which is used for
encryption. The decrypted result will be XOR with the IV and
form the first block of plain text. The second block of ciphertext is
also decrypted using the same key, and the result of the decryption
will be XOR with the first block of ciphertext and form the second
block of plain text. The same procedure is used for all the blocks.
CBC Mode ensures that if the block of plain text is repeated in the
original message, it will produce a different ciphertext for
corresponding blocks.
Note that the key which is used in CBC mode is the same; only the
IV is different, which is initialized at a starting point.
3. CFB Mode
CFB mode stands for Cipher Feedback Mode. In this mode, the
data is encrypted in the form of units where each unit is of 8 bits.
Like cipher block chaining mode, IV is initialized. The IV is kept
in the shift register. It is encrypted using the key and form the
ciphertext.
Now the leftmost j bits of the encrypted IV is XOR with the plain
text’s first j bits. This process will form the first part of the
ciphertext, and this ciphertext will be transmitted to the receiver.
Now the bits of IV is shifted left by j bit. Therefore the rightmost j
position of the shift register now has unpredictable data. These
rightmost j positions are now filed with the ciphertext. The process
will be repeated for all plain text units.
4. OFB mode
OFB Mode stands for output feedback Mode. OFB mode is similar
to CFB mode; the only difference is in CFB, the ciphertext is used
for the next stage of the encryption process, whereas in OFB, the
output of the IV encryption is used for the next stage of the
encryption process.
The IV is encrypted using the key and form encrypted IV. Plain
text and leftmost 8 bits of encrypted IV are combined using XOR
and produce the ciphertext.
For the next stage, the ciphertext, which is the form in the previous
stage, is used as an IV for the next iteration. The same procedure is
followed for all blocks.
5. CTR Mode
CTR Mode stands for counter mode. As the name is counter, it
uses the sequence of numbers as an input for the algorithm. When
the block is encrypted, to fill the next register next counter value is
used.
Note: the counter value will be incremented by 1.
For encryption, the first counter is encrypted using a key, and then
the plain text is XOR with the encrypted result to form the
ciphertext.
The counter will be incremented by 1 for the next stage, and the
same procedure will be followed for all blocks. For decryption, the
same sequence will be used. Here to convert ciphertext into plain
text, each ciphertext is XOR with the encrypted counter. For the
next stage, the counter will be incremented by the same will be
repeated for all Ciphertext blocks.
CRYPTANALYSIS
Cryptology has two parts namely, Cryptography which focuses on
creating secret codes and Cryptanalysis which is the study of the
cryptographic algorithm and the breaking of those secret codes. The
person practicing Cryptanalysis is called a Cryptanalyst. It helps us to
better understand the cryptosystems and also helps us improve the
system by finding any weak point and thus work on the algorithm to
create a more secure secret code. For example, a Cryptanalyst might try
to decipher a ciphertext to derive the plaintext. It can help us to deduce
the plaintext or the encryption key.
Parts Of Cryptology