2

I have a random number sequence (say 6 bytes)

I now want to generate a shorter sequence from the original sequence (say 3 bytes)

What is the best way of acheiving this so that the randomness of the original sequence is preserved.

Lets say I run a SHA-1 hash code on the original sequence and then grab some bytes from the hashed output. Does the randomness decrease, increase, or stay the same.

The basic question is - Does a Hash Code of a random number produce less random, more random or same randomness.

OneGuyInDc
  • 1,557
  • 2
  • 19
  • 50
  • You are looking for "birthday paradox" as search term. Answer obviously "no way"... but it is not good enough to be SO answer - so comment. – Alexei Levenkov Jan 02 '14 at 23:25
  • Anything goes. /Feierabend. Just test. IMHO SHA-1 is too expensive for network stuff, also the first byte in a MAC addres has lower entropy. – wildplasser Jan 02 '14 at 23:25
  • Have you considered the structure of the MAC address itself? If you are using real MAC addresses, the first three bytes may be indicating the Organizationally Unique Identifier, leaving the bottom three bytes as perhaps more "interesting" from a hashing perspective. – J Trana Jan 03 '14 at 00:41
  • My MAC address has no useful encoding - it is just a pseudo random number. – OneGuyInDc Jan 03 '14 at 00:42

0 Answers0