Unit - II: Traditional Symmetric - Key Ciphers: Advanced Encryption Standard
Unit - II: Traditional Symmetric - Key Ciphers: Advanced Encryption Standard
Unit - II: Traditional Symmetric - Key Ciphers: Advanced Encryption Standard
2. Sender and the receiver must have obtained copies of the secret key in a
secure fashion and must keep the key secure. If someone can discover the
key and knows the algorithm, all communications using this key is readable.
Asymmetric cryptography
Asymmetric cryptography, also known as
public key cryptography, uses public and
private keys to encrypt and decrypt data.
The keys are simply large numbers that
have been paired together but are not
identical (asymmetric). One key in the
pair can be shared with everyone; it is
called the public key. The other key in
the pair is kept secret; it is called the
private key. Either of the keys can be
used to encrypt a message; the opposite
key from the one used to encrypt the
message is used for decryption.
Hashing
In hashing, a fixed-length message digest is
created out of a variable-length message. The
digest is normally much smaller than the
message. To be useful, both the message and the
digest must be sent to Bob. Hashing is used to
provide check values, which were discussed
earlier in relation to providing data integrity.
Hash and data Integrity
Steganography
Steganography is the hiding of a secret message within
an ordinary message and the extraction of it at its
destination. Steganography takes cryptography a step
farther by hiding an encrypted message so that no one
suspects it exists. Ideally, anyone scanning your data will
fail to know it contains encrypted data.
Substitution Ciphers
The name substitution cipher comes from
the fact that each letter that you want to
encipher is substituted by another letter or
symbol, but the order in which these appear
is kept the same.
In otherwords the message you want to keep A Caesar cipher is one of the simplest (and
secret (called the plaintext) is transformed easiest cracked) encryption methods. It is a
into the enciphered message (called the Substitution Cipher that involves replacing
ciphertext) by using a different alphabet. It is each letter of the secret message with a
useful to keep track of the different alphabets different letter of the alphabet which is a
by always writing your plaintext in lowercase fixed number of positions further in the
and your ciphertext in uppercase. alphabet.
Example
In this example, each letter in the plaintext message has been shifted 3 letters down in the alphabet.
Plaintext: This is a secret message
Ciphertext: wklv lv d vhfuhw phvvdjh
Atbash Cipher
The Atbash cipher is a very specific Polyalphabetic Ciphers
case of a substitution cipher where the In a polyalphabetic cipher,
letters of the alphabet are reversed. In the substitution may change
other words, all A’s are replaced with throughout the message. In
Zs, all Bs are replaced with Ys, and so other words, the letter A
on. may be encoded as the
Example: letter K for part of the
Plaintext: This is a secret message message, but later on it
Ciphertext: Gsrh rh z hvxivg nvhhztv might be encoded as the
letter W.
Transposition Ciphers
Transposition Ciphers are a bit different One example of a transposition
to Substitution Ciphers. Whereas cipher, is to reverse the order of the
Substitution ciphers replace each letter letters in a plaintext. So "a simple
with a different letter or symbol to example" becomes "ELPMAXE
produce the ciphertext, in a ELPMIS A". Another, similar, way to
Transposition cipher, the letters are just encrypt a message would be to
moved around. reverse the letters of each word, but
not the order in which the words are
The letters or words of the plaintext are written. In this case "a simple
reordered in some way, fixed by a given example" becomes "A ELPMIS
rule (the key). ELPMAXE". Both of these are
available in the activity at the
bottom of the page.
What is a block cipher?
A block cipher is an encryption algorithm that encrypts a fixed size of n-
bits of data - known as a block - at one time.
The usual sizes of each block are 64 bits, 128 bits, and 256 bits.
For example, a 64-bit block cipher will take in 64 bits of plaintext and
encrypt it into 64 bits of ciphertext.
In cases where bits of plaintext is shorter than the block size, padding
schemes are called into play.
Majority of the symmetric ciphers used today are actually block ciphers.
DES, Triple DES, AES, IDEA, and Blowfish are some of the commonly used
encryption algorithms that fall under this group.
What is a stream cipher?
A stream cipher is an encryption algorithm that encrypts 1 bit or byte of
plaintext at a time.
It uses an infinite stream of pseudorandom bits as the key.
For a stream cipher implementation to remain secure, its pseudorandom
generator should be unpredictable and the key should never be reused.
Stream ciphers are designed to approximate an idealized cipher, known as
the One-Time Pad.
The One-Time Pad, which is supposed to employ a purely random key, can
potentially achieve "perfect secrecy". That is, it's supposed to be fully
immune to brute force attacks. The problem with the one-time pad is that, in
order to create such a cipher, its key should be as long or even longer than
the plaintext.
In other words, if you have 500 MegaByte video file that you would like to
encrypt, you would need a key that's at least 4 Gigabits long.
FEISTEL BLOCK CIPHER
The input block to each round is divided into two halves that can be
denoted as L and R for the left half and the right half.
In each round, the right half of the block, R, goes through unchanged.
But the left half, L, goes through an operation that depends on R and
the encryption key.
First, we apply an encrypting function ‘f’ that takes two input the key K
and R. The function produces the output f (K,R).
Then, we XOR the output of the mathematical function with L.
In real implementation of the Feistel Cipher, such as DES, instead of
using the whole encryption key during each round, a round-dependent
key ‘a subkey’ is derived from the encryption key.
This means that each round uses a different key, although all these
subkeys are related to the original key.
Fiestal Encryption Process Steps contd…
The permutation step at the end of each round swaps the modified
L and unmodified R.
Once the last round is completed then the two sub blocks, ‘R’ and
‘L’ are concatenated in this order to form the ciphertext block.
Decryption Process
The process of decryption in Feistel cipher is almost
similar.
Instead of starting with a block of plaintext, the
ciphertext block is fed into the start of the Feistel
structure and then the process thereafter is exactly the
same as described in the given illustration.
The process is said to be almost similar and not exactly
same.
In the case of decryption, the only difference is that the
subkeys used in encryption are used in the reverse
order.
Data Encryption Standard (DES):
DES Originally designed by researchers at IBM in the early 1970s,
DES was adopted by the U.S. government as an official Federal
Information Processing Standard (FIPS) in 1977 for the encryption of
commercial and sensitive yet unclassified government computer data.
E
32 1 2 3 4 5
4 5 6 7 8 9
8 9 10 11 12 13
12 13 14 15 16 17
16 17 18 19 20 21
20 21 22 23 24 25
24 25 26 27 28 29
28 29 30 31 32 1
Key Generation
64 bit key is used as input and reduced to
56-bits by eliminating bit position
(8,16,24,32,40,48,56,64) i.e. every 8th position
bit is ignored.. 56-bit is again divided into
two parts, i.e. 28-bit and 28-bit labeled Co
and Do.
At each round Ci-1 and Di-1 are
separately subjected to a circular left shift or
rotation of 1 or 2 bits as indicated by the Example of left
table :
circular shift
Similarly, the permuted choice 1 and PC-1 and
permuted choice 2 PC-2 are processed.
DES Security Brute force attack on DES
For symmetric-key ciphers, a brute
DES is the old "data encryption force attack typically means a brute-
standard" from the seventies. Its force search of the key space; that is,
key size is too short for proper testing all possible keys in order to
security (56 effective bits; this can recover the plaintext used to
be brute-forced, as has been produce a particular ciphertext.
demonstrated more than ten years In a brute force attack, the expected
ago). Also, DES uses 64-bit blocks, number of trials before the correct
key is found is equal to half the size
which raises some potential issues of the key space. For example, if
when encrypting several gigabytes there are 264 possible keys, a brute
of data with the same key (a force attack would, on average, be
gigabyte is not that big nowadays). expected to find a key after 263 trials.
3DES (Multiple DES) is a trick to reuse
DES implementations, by cascading
three instances of DES (with distinct
keys). 3DES is believed to be secure up
to at least "2112" security (which is quite
a lot, and quite far in the realm of "not
breakable with today's technology"). But
it is slow, especially in software (DES was
designed for efficient hardware
implementation, but it sucks in software;
and 3DES sucks three times as much).
Unlike DES, the number of rounds in AES is the first four bytes of a
128-bit input block
variable and depends on the length of the key.
occupy the first column
AES uses 10 rounds for 128-bit keys, 12 rounds for in the 4×4 matrix of
192-bit keys and 14 rounds for 256-bit keys. bytes. The next four
bytes occupy the
Each of these rounds uses a different 128-bit
second column, and so
round key, which is calculated from the original on.
ENCRYPTION KEY AND ITS EXPANSION
Assuming a 128-bit key, the key is also arranged in the form of
a matrix of 4×4 bytes. As with the input block, the first word from
the key fills the first column of the matrix, and so on.
The four column words of the key matrix are expanded into a
schedule of 44 word.
OVERALL STRUCTURE OF AES
(Transformations)
Before any round-based
processing for encryption can
begin , the input state array is
XORed with the first four words of
the key Schedule.
For encryption, each round consists
of the following four steps:
1) Substitute bytes,
2) Shift rows,
3) Mix columns, and
4) Add round key.
For decryption, each round consists of the following four steps: 1)Inverse shift rows,
2) Inverse substitute bytes, 3) Add round key, and 4) Inverse mix columns.
AES each round Steps Byte Substitution
Each round comprise of four (SubBytes)
sub-processes. The first round The 16 input bytes are
process is depicted below : substituted by looking up a
fixed table (S-box) given in
design. The result is in a
matrix of four rows and
four columns.
Shiftrows
Each of the four rows of the
matrix is shifted to the left. First row is not shifted.
Any entries that ‘fall off’ Second row is shifted one (byte) position to
the left.
are re-inserted on the right Third row is shifted two positions to the
side of row. Shift is carried left.
out as follows − Fourth row is shifted three positions to the
left.
The result is a new matrix consisting of the
same 16 bytes but shifted with respect to
each other.
MixColumns
Each column of four bytes is now transformed
using a special mathematical function. This
function takes as input the four bytes of one
column and outputs four completely new
bytes, which replace the original column. The
result is another new matrix consisting of 16
new bytes. It should be noted that this step is
not performed in the last round.
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.
AES Analysis
In present day cryptography, AES is widely adopted and
supported in both hardware and software. Till date, no
practical cryptanalytic attacks against AES has been
discovered. Additionally, AES has built-in flexibility of
key length, which allows a degree of ‘future-proofing’
against progress in the ability to perform exhaustive
key searches.
However, just as for DES, the AES security is:
assured only if it is correctly implemented and
good key management is employed.
AES ciphers