lundi 19 novembre 2018

Can I hash a UUID for higher entropy - Python

If I generate a UUID with something like

ID = uuid.uuid4()

I get a 128 bit string with 122 bits of entropy.

However I desire a string with more than 128 bits of entropy.

How will the entropy of the string change if I put this uuid through a hashing function.

for instance:

ID = uuid.uuid4()
ID = HASHFUNC(ID)

or even:

ID = uuid.uuid4()
Salt = someString
ID = HASHFUNC(ID+Salt)

Is it better to simply use os.urandom(32) and be done with it?

Thanks for the help




Aucun commentaire:

Enregistrer un commentaire