New Stream Cipher: Restream

From: Dominik Reichl (dominik.reichl_at_gmx.de)
Date: 08/29/03


Date: 29 Aug 2003 04:34:41 -0700

Hello,

I have created a new stream cipher: "Restream". It is relatively fast,
but I don't know how secure it is... But the output looks fairly random
and the Diehard suite didn't find anything.

It is something like a nonlinear feedback shift register, but with 2048
32-bit values.

The KSA of Restream is relatively easy to describe. The initial state
array (2048 32-bit values) is filled by hashing the user password plus
an incrementing counter using SHA-1 (but it could be any other one-way
hash function) until the array is completely filled.

Before calculating the final 32-bit output word, apply this to the state
array:

uNew = p[MRC(pos)] + p[MRC(pos+1)] + p[MRC(pos-1)] + p[MRC(pos-2)] +
    ((p[MRC(pos+17)] * p[MRC(pos+37)]) ^
    (p[MRC(pos+101)] ^ p[MRC(pos+213)])) +
    ((p[MRC(pos+157)] ^ p[MRC(pos+513)] ^
    p[MRC(pos+127)]) + p[MRC(pos+713)]);
ctx->state[pos] = uNew;
ctx->pos++;

where MRC(x) is x & 2047, and 'p' a pointer to ctx->state.

The 32-bit value which can be used then for encryption/decryption is:

x = (p[MRC(pos+27)] + p[MRC(pos+317)]) ^ p[MRC(pos+657)];

You can download a full C++ implementation of the cipher here:
http://home.tiscali.de/reichl/archive/restream/restream.zip
This also includes the project files and a Win32 binary.

If you want to try to break something, try this:
http://home.tiscali.de/reichl/archive/restream/news.txt
http://home.tiscali.de/reichl/archive/restream/news.enc
The first file is the 'news' file from the standard calgary corpus, the
second one is the 'news' file encrypted with Restream.

Can you find the key?

If the challenge above should be too easy (my cipher is breakable?!?):
http://home.tiscali.de/reichl/archive/restream/test2.enc
Try to decrypt this file. No key given.
A tip: this file is a wordlist.

How would you attack my cipher? Any weaknesses?

Happy breaking :-)
Dominik



Relevant Pages

  • QC Unbreakable PKI system - ideas?
    ... >> quantum computers like RSA and elliptic curves are? ... cipher, which would require the decrypting computer to maintain a huge ... into a _huge_ random array using CS - hash algorithms. ... determining which bytes of X-gigabyte array will be used as OTP; ...
    (sci.crypt)
  • Effecient use of Arrays for encryption?
    ... shows the array used to transpose the plaintext. ... Private Sub CommandButton1_Click ... Dim array_count, String_array As String ... a note on security...this is not a secure cipher by itself. ...
    (microsoft.public.excel.programming)
  • AES java implementation
    ... @param a operand for multiply. ... Substituites for bytes from input array from S-box ... private void invSubBytes{ ... corresponding cipher text ...
    (sci.crypt)
  • CrosstalkNP3 256-bit blockcipher
    ... This is a pure breed permutations cipher. ... //Simple nonereversible keypermutation ... binarr = new Array; ...
    (sci.crypt)