Skip to content

Instantly share code, notes, and snippets.

@ofelix03
Created September 15, 2021 00:12
Show Gist options
  • Save ofelix03/9b72be6bca93030c4253bcfbeecc8a84 to your computer and use it in GitHub Desktop.
Save ofelix03/9b72be6bca93030c4253bcfbeecc8a84 to your computer and use it in GitHub Desktop.
import os
import hashlib
salt = os.urandom(32)
plaintext = 'hellow0rld'.encode()
digest = hashlib.pbkdf2_hmac('sha256', plaintext, salt, 10000)
hex_hash = digest.hex()
print(hex_hash)
byte_hash = digest.fromhex(digest.hex())
print(byte_hash)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment