On 10/27/2012 06:30 PM, Michael Zintakis wrote:
Maybe a bit daft of me to ask this, but is it possible to calculate a hash on a stream of bytes where the resulting hash is considered to be part of that stream?

In other words, lets assume that I have a stream which is, say, 64 bytes long in total, consisting of 48 bytes of "payload", plus 16-byte for the hash and that hash has been calculated based on the *entire* stream (payload+hash) of 64 bytes. Would that be possible to produce with openssl or is this a bit of a chicken-and-egg scenario? Thanks!
______________________________________________________________________

By its nature, a hash completely changes if just a bit of the original content is modified, that also includes appending anything to it.
Any change will make the difference unpredictable.
My guess is that if you could write a hash working the way you say, it would be vulnerable to all sorts of cryptographic attacks: give up!

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to