Assuming that:
- SHA-256 and SHA-512 are random and irreversible
- the output appended to some random and long enough secret is just as random as any other data and will produce values that are just as hard to guess
Then one can conclude that a cipher can be constructed using those hash functions in the following manner:
- let
state
andkey
both be 32 or 64 byte values - initialize
state
with a random IV andkey
with a random key - make
v
equal the hash ofstate + key
, xor block of plaintext withv
- update state with the cipher produced
- repeat until all plaintext is processed
- to decrypt do the same, but update the state with the cipher text
Now the question is, does such a cipher exist? Is it possible to discover the plaintext given a ciphertext without brute-forcing the key? If so, what techniques could be used for that?