**Origins**

In cryptography,

**3-Way**is a block cipher designed in 1994 by Joan Daemen. One of such block cipher algorithm is the 3-Way Algorithm and has a key and block size of 96 bits.

The 3-Way algorithm is an iterated block cipher that repeats some relatively simple operations a specified number of times.

Has the following characteristics:

**Merits of 3-Way Algorithm**

- 3-Way algorithm is efficient in wide range of platforms from 8-bit processors to specialized hardware.
- 3-Way algorithm resembles more mathematical features which enable all the decryption to be done in exactly same way as in encryption.
- 3-Way encryption ensures total security in on-line transactions.
- This algorithm provides additional security to protect customers order information such as credit card numbers.

## DeMerits of 3-Way Algorithm

- 3-Way algorithm requires a lot of space for its execution.
- Resynchronization is one of the main problems in 3-way algorithm.

## Applications of 3-Way Algorithm

- 3-Way algorithms are used in web browsing, electronic mail, internet faxing, instant messaging and voice-over-IP.
- 3-Way algorithm has prominent role in establishing network over wide ranges.
- They are used in many web applications.
- 3-Way algorithm provides more security when compared to any other algorithms.

### Steps Involved in 3-Way Encryption

- Information is coded between the customer and our server.
- An e-mail is sent to merchant (the information where it is to be transmitted) notifying the order, when the Information is coded on our own hard drive.
- At last when the merchant retrieves the order, the third coding takes place.

### Steps Involved in 3-Way Decryption

- The server must use a RSA key exchange mechanism.
- RSA key mechanism can be replaced by Diffie-Hellman key exchange mechanism also.
- We must have access to server’s private RSA key and be able to be coped to the required destination.
- Outputting a fake 3-way TCP handshake is possible for the decrypted traffic. Thus by keeping the TCP sequence numbers up to date, decrypted server satisfies all the client requests.

**Structure:**

A related key attack on 3-way requires one related key query and 2

^{22}chosen plaintexts. It is closely related to BaseKing; indeed, the two are variants of the same general cipher technique.

**Type of mathematics that is based on this algorithm**

- 3-Way is an 11-round substitution-permutation network.
- 3-Way is designed to be very efficient in a wide range of platforms from 8-bit processors to specialized hardware, and has some elegant mathematical features which enable nearly all the decryption to be done in exactly the same circuits as did the encryption.

**Implement**

One way to implement decipherment with 3-Way is to implement it as encipherment with a modified key schedule, preceded and followed by a step reversing the order of all the bits in the 96-bit block; this is the scheme shown in the C code given in Bruce Schneier's famed book Applied Cryptography.

As can be seen from the diagram, a round consists of a number of distinct steps.

1st step: Is the XOR of key material with a round constant.

The round constants for the eleven rounds, and the final additional key XOR operation,

of 3-Way are:

1) 0000 1011 0000 1011 0B0B

2) 0001 0110 0001 0110 1616

3) 0010 1100 0010 1100 2C2C

4) 0101 1000 0101 1000 5858

5) 1011 0000 1011 0000 B0B0

6) 0111 0001 0111 0001 7171

7) 1110 0010 1110 0010 E2E2

8) 1101 0101 1101 0101 D5D5

9) 1011 1011 1011 1011 BBBB

10) 0110 0111 0110 0111 6767

11) 1100 1110 1100 1110 CECE

12) 1000 1101 1000 1101 8D8D

So the symmetry does not break down, but the period is not maximal.

2nd step: Called theta, is a matrix multiplication using XORs; it is indeed
a matrix multiplication, modulo 2, carried out in parallel eight times, for
each of the eight bits each of the twelve bytes in the block contains.

The matrix multiplication involves the matrix:

The matrix multiplication has a structure that allows it to be implemented in
terms of shifts and XORs of 32-bit words.3rd step, pi-1, now provides diffusion between the bits of the bytes by performing two different rotations on two of the 32-bit subblocks of the 96-bit block. In this step, the first 32-bit subblock is rotated 10 bits to the right, and the third 32-bit subblock is rotated 1 bit to the left. The second subblock is not modified.

4th step: Gamma, applies a nonlinear S-box with three inputs and three outputs to corresponding bits of the three subblocks.

Each bit is XORed with the OR of the next bit and the inverse of the bit after
that, leading to an S-box with the table:

5th step: pi-2, provides diffusion between bits, as well as maintaining the symmetry that relates decipherment to encipherment. Here, it is the first 32-bit subblock that is rotated 1 bit to the left, and the third 32-bit subblock that is rotated 10 bits to the right.

The theta and gamma operations both become their own inverses when the 96 bits of the block are handled in reverse order, and pi-2 with bits reversed becomes the inverse of the original pi-1, and so on.

To invert a cipher, one has to perform the inverses of each of the steps in reverse order. The fact that the XOR of the key precedes the theta step is the only complication; in addition to being used in reverse order, and with bits reversed, the key for each round must go through the theta step.

3-Way is vulnerable to related-key attacks, and therefore it should only be used with keys that are generated by a strong RNG, or by a source of bits

that are sufficiently uncorrelated (such as the output of a hash function).

http://www.slideshare.net/rajeevrvis/3way**Decipherment**The theta and gamma operations both become their own inverses when the 96 bits of the block are handled in reverse order, and pi-2 with bits reversed becomes the inverse of the original pi-1, and so on.

To invert a cipher, one has to perform the inverses of each of the steps in reverse order. The fact that the XOR of the key precedes the theta step is the only complication; in addition to being used in reverse order, and with bits reversed, the key for each round must go through the theta step.

**Attacks and vulnerabilities**3-Way is vulnerable to related-key attacks, and therefore it should only be used with keys that are generated by a strong RNG, or by a source of bits

that are sufficiently uncorrelated (such as the output of a hash function).

http://www.cosic.esat.kuleuven.be/publications/article-141.pdf

Faltó el ejemplo. Intenta copiar menos texto. Van 6 pts.

ResponderEliminar