Skip to content

Instantly share code, notes, and snippets.

@NMelis
Created May 21, 2018 23:42
Show Gist options
  • Save NMelis/f757a9b20e68712d87cb9d5f03ffa48d to your computer and use it in GitHub Desktop.
Save NMelis/f757a9b20e68712d87cb9d5f03ffa48d to your computer and use it in GitHub Desktop.
from pbkdf2 import PBKDF2
import base64
password_hash = b"ACNLVsim8ADv4Su/8w4loeSwTw2yH2R3++Pvrfx5xlDGlx0cDRdQ9t0TLJd1a5pvZw=="
password = b"123456"
origin_salt = base64.b64decode(password_hash)[1:16]
buffer1 = base64.b64decode(password_hash)[17:]
print(base64.b64encode(buffer1))
# sE8Nsh9kd/vj7638ecZQxpcdHA0XUPbdEyyXdWuab2c=
current_password_hash = PBKDF2(password, origin_salt, 1000)
print(base64.b64encode(current_password_hash.read(49)[17:]))
# 0lC99e4tV+JmXBbJal19YyS1h9+djY+dsBHo/j8KNb8=
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment