Key:
Salt
Plaintext
Elapsed time: **** msec
Encrypted text
Ithildin is a symmetric key synchronous stream cipher built upon the CryptMT protocol.
CryptMT uses a Mersenne Twister (MT19937), a seedable linear feedback shift register as a basis for generating a cryptographically secure pseudorandom keystream.
In this implementation, the password is used to generate the seed.
Despite the fact that the Mersenne Twister is an extremely good pseudo-random number generator, it is not cryptographically secure by itself.
It is possible to determine all future states of the generator from the state the generator has at any given time, and either 624 32-bit outputs, or 19,937 one-bit outputs are sufficient to provide that state.
The algorithm is as follows:
- A 32-bit accumulator (A) is initialized with an odd number (1 is chosen here)
- MT19337 is seeded. Seed is obtained using a transform of the password to derive an array of 32-bit words
- A psuedorandom 32-bit value (P) is obtained from MT19337
- Bitwise OR with 1 is performed on the value to make it odd. (P' = P|1)
- A is multiplied by P' modulo 232.
- The most significant 8 bits of A are used as a byte of the key stream.
- This key byte is combined with the corresponding plaintext byte in an XOR operation
- Steps 3-7 are repeated until all plaintext bytes are encrypted
- A 64-bit accumulator (A), composed of 4 16-bit arrays is initialized with an odd number (1 is chosen here)
- MT19337 is seeded. Seed is obtained using a transform of the password to derive an array of 32-bit words
- 2 sequential psuedorandom 32-bit values (P, Q) are obtained from MT19337 and converted to hex(P', Q')
- P' and Q' are string-concatenated to form a 64-bit value (R).
Since the period of MT19337 is odd (219337 - 1), the period of the states taken 2 at a time is the same. - Bitwise OR with 1 is performed on the value to make it odd. (R' = R|1)
- A is multiplied by R' modulo 264.
- The most significant 16 bits of A are used as a value of the key stream.
- This key byte is combined with the corresponding plaintext UTF-16 code point in an XOR operation
- Steps 3-8 are repeated until all plaintext bytes are encrypted
Step | A(in) | PRN(MT) | A(out) = A(in) * (PRN|1) (mod 264) |
16-bit Keyword | Plaintext | Encrypted word |
---|---|---|---|---|---|---|