Lecture 14 XTS-AES & RC4
Lecture 14 XTS-AES & RC4
SECURITY
(CSD-410)
(Lecture 14)
XTS: A MODE OF AES FOR ENCRYPTING HARD
DISKS
▪ In 2010, NIST approved an additional block cipher mode of operation,
XTS-AES.
▪ Tracks are in turn partitioned into fixed-sized logical sectors, which can
be individually read from or written to a disk.
bytes.
▪ A sector might be subdivided into logical blocks, which are the same size
▪ So, inputs to an encryption algorithm for data on hard disks should include
only:
▪ the data itself,
▪ and available metadata such as the sector number and the block number in that
sector.
2. The data layout is not changed on the storage medium and in transit.
3. Data are accessed in fixed sized blocks, independently from each other.
6. but always to the same ciphertext when written to the same location again.
OPERATION ON SINGLE BLOCK
▪ The operation involves two instances of the AES algorithm with two keys.
Key The 256 or 512 bit XTS-AES key; Key = Key1 || Key2
Pj The jth block of plaintext. All blocks except possibly the final block have a length of 128
bits. A plaintext data unit, typically a disk sector, consists of a sequence of plaintext
blocks P1, P2, … , Pm.
Cj The jth block of ciphertext. All blocks except possibly the final block have a length of 128
bits.
j The sequential number of the 128-bit block inside the data unit.
i The value of the 128-bit tweak. Each data unit (sector) is assigned a tweak value that is a
nonnegative integer.
α A primitive element of GF(2128)
αj A multiplied by itself j times, in GF(2128).
⊕ Bitwise XOR.
⊗ Modular multiplication of two polynomials with binary coefficients modulo.
XTS-AES OPERATION
ON SINGLE BLOCK
OPERATION ON A SECTOR
▪ The plaintext of a sector or data unit is organized into blocks of 128 bits.
▪ Exception occurs when the last block has less than 128 bits.
▪ It is a Stream Ciphers.
▪ RC4 stream cipher is one of the most widely used stream ciphers because of its
simplicity and speed of operation.
▪ Initially, RC4 was trade secret but once it’s code spread in the public domain it was no
more a trade secret.
TYPES OF RC4
1. SPRITZ: Spritz can be used to build a cryptographic hash function, a deterministic random
bit generator (DRBG), an encryption algorithm that supports authenticated encryption
with associated data (AEAD).
2. RC4A: Souraduyti Paul and Bart Preneel have proposed an RC4 variant, which they call
RC4A, which is stronger than RC4.
3. VMPC: VMPC is another variant of RC4 which stands for Variably Modified Permutation
Composition.
4. RC4A+: RC4A+ is a modified version of RC4 with a more complex three-phase key
schedule which takes about three times as long as RC4 and a more complex output
function which performs four additional lookups in the S array for each byte output, taking
approximately 1.7 times as long as basic RC4.
RC4
▪ RC4 relies on:
▪ Key inputs. This tool generates an eight-bit number (cipher) that's impossible
to guess.
2. PRGA: Data is fed in byte by byte, and a mathematical model modifies it. The
model looks up values, add them to 256, and uses the sum as the byte within the
keystream. It swaps each element with another at least once every 256 rounds.
RC4 ALGORITHM
▪ The algorithm operates on a user-selected variable-length key(K) of 1 to 256
bytes (8 to 2048 bits), typically between 5 and 16 bytes.
1. The first step is the array initialization. It is a character array of size 256 i.e.
S[256]. After that, for every element of the array, we initialize S[i] to i.
3. KSA has been scrambled, S[256] array i.e. used to generate the PRGA(Pseudo
Random Generation Algorithm).
WORKING OF RC4
▪ Encryption Procedure
1. The user inputs a plain text file and a secret key.
2. The encryption engine then generates the keystream by using KSA and PRGA
Algorithm.
3. This keystream is now XOR with the plain text, this XORing is done byte by byte to
produce the encrypted text.
4. The encrypted text is then sent to the intended receiver, the intended receiver will then
decrypted the text and after decryption, the receiver will get the original plain text.
▪ Decryption Procedure
▪ RC4 fails to discard the beginning of output keystream or fails to use non-random
or related keys for the algorithm.