# Cryptography Case

*This*

**essay Cryptography Case**is available for you on Essays24.com! Search Term Papers, College Essay Examples and Free Essays on Essays24.com - full papers database.Autor: Luisa • November 21, 2011 • 3,522 Words (15 Pages) • 214 Views

**Page 1 of 15**

Streaming cipher

It is a symmetric key cypher where text is encrypted by applying a key and algorithm to each binary digit in a data stream. This type of cipher encrypts data one bit at a time. A sequence of symbols (bits, bytes, or words) is created by a finite state automaton whose initial state is determined by a secret key. The symbols are mixed sequentially with the plaintext to produce the ciphertext. The output of this is called the keystream (McDonald, C., 2010).

HC-256 - Stream Cipher

HC-256 is a symmetric stream cipher invented by Hongjun Wu in 2004. It uses a 256-bit key and a 256-bit initialization vector to generate a keystream up to 2128 bits in length. It is made up of seven different operations, a key, an initialization vector, two tables and six functions.

The 256-bit key of HC-256 is represented by K. the 256-bit initialization vector of HC-256 is represented by IV. The keystream being generated from HC-256 is represented by s. The 32-bit output of the ith step is denoted as si. Then s = s0||s1||s2|| . . .

Symbol Operations related to the Symbol

+ x + y means x + y mod 232, where 0 < x < 232 and 0 < y < 232

x y means x - y mod 1024

bit-wise exclusive OR

|| Concatenation

>> right shift operator. x >> n means x being right shifted n bits.

<< left shift operator. x << n means x being left shifted n bits

>>> right rotation operator. x >>> n means ((x >> n) (x << (32-n))

where 0 < n < 32, 0 < x < 232

Table 1: Retrieved from: (Wu, H., n.d.).

P represents a table with 1024 32-bit elements. Each element is denoted as P[i] with 0 < i < 1023.

Q represents a table with 1024 32-bit elements. Each element is denoted as Q[i] with 0 < i < 1023.

There are six functions being used in HC-256 listed below:

f1(x) = (x >>> 7) (x >>> 18) (x >> 3)

f2(x) = (x >>> 17) (x >>> 19) (x >> 10)

g1(x, y) = ((x >>> 10) (y >>> 23)) + Q[(x y) mod 1024]

g2(x, y) = ((x >>> 10) (y >>> 23)) + P[(x y) mod 1024]

h1(x) = Q[x0] + Q[256 + x1] + Q[512 + x2] + Q[768 + x3]

h2(x) = P[x0] + P[256 + x1] + P[512 + x2] + P[768 + x3] (Wu, H., n.d.).

The initialization process is the first phase of the HC-256 stream cipher. This phase has the key (K) and the initialization vector (IV) expanded into the table P and table Q. During this phase, the cipher runs 4096 steps without generating any output.

As soon as this phase is completed, the cipher will generate a keystream using the "keystream generation algorithm". For the second phase, there are 1024 steps that involve updating one element of a table generating one 32-bit output for every step. An S-box is used to generate only 1024 outputs, and then it is updated in the next 1024 steps. Finally, the keystream is XORed with the message for encryption and the decryption is to XOR the keystream with the ciphertext (Wu, H., n.d.).

Block cipher

It is a symmetric key cipher which is encrypted by applying a cryptographic key and algorithm to a "block" of data at one time. Block ciphers divide the data into fixed-size pieces called blocks. Each block of data must be the exact same size; therefore, the last block of data may need to have some padding done. The data use in a block cipher is called plaintext. When it is processed, it turns into ciphertext. A block cipher has two corresponding algorithms, one for encryption and another one for decryption. The decryption is the inverse of the encryption algorithm; the process used to encrypt the data, is inversed to decrypt the data.

Serpent - Block Cipher

Serpent is a symmetric key block cipher invented by Ross Anderson, Eli Biham and Lars Knudsen in 1998. The Serpent block cipher was a finalist in the Advanced Encryption Standard (AES) competition. The Serpent cipher maintains a block size of 128 bits and it is able to work with various key sizes such as 128, 192 or 256 bits. The cipher consists of three phases: the initial permutation IP phase, which is an early enciphering process, a 32-round substitution-permutation network (SP-network) phase, and a final permutation FP phase.

In first phase, the initial permutation IP is applied to the plaintext. The 128-bit plaintext is put through a process that mixes these bits using a permutation table. This data is then entered into the first round of the second phase.

For the second phase, it uses a process called bitslicing. There are 32 rounds and each of them consists of the following:

* a key mixing operation,

* a pass through 32 identical 4-bit S-boxes in parallel,

* and a linear transformation (this doesn't apply to the last round).

In the last round of this phase, a linear transformation is substituted by an added key mixing operation. The cipher uses a 32-round substitution-permutation network (SP-network) working on a block of four 32-bit words. SP-networks are mathematical operations used to create a block cipher algorithm (Ã‡akiroglu, M., 2010). Each round uses a key mixing operation of a 128-bit subkey which is exclusive or'ed with the current transitional data. The 128-bit data is divided into four 32-bit words. These four words are applied to the S-box, and then implemented as a sequence of logical operations. The outcome of this process is four output words. The S-box will execute the 32 copies of this process at the same time. The 32 bits in each of the words is mixed using a linear transformation before being sent to the final phase. In the final phase, the result of the second phase is permuted by IP-1.

Similarities

The first similarity between the Serpent and HC-256 ciphers is that they are both symmetric key algorithms. Another similarity is

...