Re: An hash-Encryption algorithm



Neo <neoscandal@xxxxxxxxx> wrote:
>What if from n=2 onwards K(n) = MD5( K(n-1) + C(n-1) + user entered key).
>theres no way the attacker can obtain the key.. even given both P1 and C1.

So this would be K(n) = MD5(K(n-1), C(n-1), K(0)). At first sight,
this looks ok. I think MD5(C(n-1),K(0)) (CFB mode) and MD5(K(n-1),K(0))
(OFB mode) would work just as well.

>Or have i missed something again.

You are getting somewhere. Now you are just missing a somewhat
subtle point: Encrypt two messages P1(1,...,n) and P2(1,..m) with
the same key K(0). Find the expression for the first ciphertext
blocks C1(1) and C2(1) and compute their exclusive ors. What do you
find?

The solution is to use a nonce or initialization vector (iv).

You would probably enjoy reading the chapter on block cipher modes of
operation in any cryptography book and translating CTR, OFB and CFB
into MD5-like constructions.

--
Kristian Gjøsteen
.