# Re: An hash-Encryption algorithm

*From*: Kristian Gjøsteen <kristiag+news@xxxxxxxxxxxx>*Date*: Fri, 27 Jan 2006 20:09:50 +0100

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

.

**Follow-Ups**:**Re: An hash-Encryption algorithm***From:*Neo

**References**:**An hash-Encryption algorithm***From:*Neo

**Re: An hash-Encryption algorithm***From:*Neo

**Re: An hash-Encryption algorithm***From:*Kristian Gjøsteen

**Re: An hash-Encryption algorithm***From:*Neo

- Prev by Date:
***** surviving my new CANCEL attack***** - Next by Date:
**Re: An hash-Encryption algorithm** - Previous by thread:
**Re: An hash-Encryption algorithm** - Next by thread:
**Re: An hash-Encryption algorithm** - Index(es):