0

i am making a code to embbed the water mark in an image block. That block is of 8X8 means 64 pixels. i use 5 MSB of all pixels(64*5=320), which generate the secrete data which is entered in remaining 3 LSB of pixel(64*3=60). Data is entered in randomly selected 160 bits of LSB, means 480 bits(320+160=480) are used for data out of 512 bit(64*8=512 bits). now here I have a statement that "feed 480 bits to generate 32 hash bit and place those bits in remaining 32 places (512-480=32)".So i need some help to generate hash bits..

ildjarn
  • 60,915
  • 9
  • 122
  • 205
  • 3
    Just use a SHA-1 or something similar and then use the first 32 bits? –  May 10 '12 at 21:46
  • 2
    If you’re asking how to generate a 32‑bit hash, you might want to start with [Wikipedia’s List of hash functions](http://en.wikipedia.org/wiki/List_of_hash_functions "Wikipedia") to help you choose an algorithm. – Brian Nixon May 10 '12 at 22:19
  • You may [use a SHA-1](http://stackoverflow.com/questions/4678447/md5-and-sha1-c-hashing-library) or similar on it and then use the first 32 bits. – J. Chomel Jul 01 '16 at 08:32
  • Possible duplicate of [unique hash of string](http://stackoverflow.com/questions/2444057/unique-hash-of-string) – J. Chomel Jul 01 '16 at 08:34

0 Answers0