Re: Embedding hash value in data



"Draco" <draco_merest@xxxxxxxxxxxxxxx> wrote in message
news:u8u1s2t3l049ucvl65nslfu35qijc5n742@xxxxxxxxxx
On Wed, 31 Jan 2007 15:06:23 -0500, "David T. Ashley" <dta@xxxxxxxx>
wrote:

I had considered various text editors and their differing approches to
formatting for a few moments until I realized no one is going to hand
enter any embedded hash code. Rather, a small untility would calcualte
and insert the value. But if I need to brute force it then I think I
will go with your suggestion of skipping over the value when computing
the overall hash.

There is one part I forgot to mention. The approach I gave you doesn't
really "tamper-proof" the file, because the algorithm is public and anyone
can put another file in place of the original or modify the original and use
the same algorithm to generate and embed a [different] hash that matches the
rest of the file contents.

To "tamper-proof" the file in the sense you intend, the typical approach is
to use a "key" (a text string with maybe 2048 bits of entropy is fine), and
the hash is formed as the SHA1 of the concatenation of the key + the text.

Without the key, a potential attacker can't forge a matching hash.

The trouble I believe would be in securing the key. If you distribute (for
example) a utility to check whether a given file has a matching hash, the
utility has to have embedded in it the key (because it re-calculates the
hash to verify). Someone clever may be able disassemble the executable or
use other tactics to get the embedded key.

This question might best be posed in a cryptography list. I'm out of my
depth. I understand your problem, but there may be a better family of
solutions.

--
David T. Ashley (dta@xxxxxxxx)
http://www.e3ft.com (Consulting Home Page)
http://www.dtashley.com (Personal Home Page)
http://gpl.e3ft.com (GPL Publications and Projects)


.



Relevant Pages

  • Re: SHA-1 vs. triple-DES for password encryption?
    ... be better to use a standard algorithm rather than a home-grown one. ... SHA-1 and 3DES have been reviewed for some time. ... This is where a hash comes in nicely. ... Longer passwords and hashes aid in making the hash much harder to work with. ...
    (SecProg)
  • Re: sort unique
    ... given that a hash table is not ... IMO if the vendor's algorithm does something "obvious", ... function to eliminate keys that hash to the same bucket per some ... strings of random lengths, and two strings are ...
    (comp.lang.lisp)
  • Re: out of memory
    ... read only the smaller file into a hash. ... the smaller file will fit into RAM. ... Depending upon the sorting algorithm this would be Ologor ... put your relevant data into a database and use ...
    (comp.lang.perl.misc)
  • Re: freebsd-updates install_verify routine excessive stating
    ... The algorithm with awk is still the fastest in theory. ... ASSUMING you have a good hash function that yields such result. ... to have enough free inodes on your file system. ...
    (freebsd-hackers)
  • Re: Probabalistic algorithms.
    ... >Hashing is typically just an optimisation. ... all the hash does is guarantee that given some ... >hard to factor the composite into its two prime factors. ... >algorithm that's dfaster than brute force factorisation, ...
    (comp.lang.pascal.delphi.misc)

Quantcast