Professional Documents
Culture Documents
It Is Possible To Use A Hash Function To Construct A Block Cipher With A Structure Similar To DES
It Is Possible To Use A Hash Function To Construct A Block Cipher With A Structure Similar To DES
similar to DES. Because a hash function is one way and a block cipher must be
reversible (to decrypt), how is it possible?
Answer
Yes, Definitely it is possible to use a hash function like (SHA family, for instance) in OFB or
CFB (and possibly CTR), by using the hash function (with the key as part of the input!) in the
place of the block cipher encryption. . If you want to use a hash function, the best way is to
follow a Feistel structure, which is, coincidentally, the same kind of structure than what DES
uses.
The illustrations on the Wikipedia page are quite clear; you would use the hash function for
the "F" part, which combines one (sub)key and one half of the current block, to produce a
value which is to be XORed with the other half of the current block. The good thing about the
scheme is that the "F" function is always invoked in the same direction, both for encryption
and for decryption. Therefore, it can be a one-way function, like a hash function.
And yes any solid good hash function cannot be really "perfect" and there are a lot of small
subtle details which can sabotage the security of the best thought cipher structure. It is
advisable not to build your own crypto (unless you are quite clear with yourself that you do
it for learning and not to actually protect any data of value).
Answer