Skip to content

Instantly share code, notes, and snippets.

@edouard-lopez
Created January 26, 2019 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edouard-lopez/55846fb55eff97ebc88a07b3901a90b5 to your computer and use it in GitHub Desktop.
Save edouard-lopez/55846fb55eff97ebc88a07b3901a90b5 to your computer and use it in GitHub Desktop.
Run with `python algo.py`
import hashlib
import binascii
def calc_entropy():
digest_algorithm = "sha256"
master_password = 'password'
salt = 'site'+'login'+hex(1)[2:]
iterations = 100000
derived_key_length = 32
entropy = hashlib.pbkdf2_hmac(digest_algorithm, master_password, salt, iterations, derived_key_length)
print entropy
if __name__ == '__main__':
calc_entropy()
@edouard-lopez
Copy link
Author

❯ python algo.py
L2B&6`&[:s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment