Advertisement
mdelatorre

Hashes generation in Python

Oct 3rd, 2016
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.67 KB | None | 0 0
  1. md5crypt, sha256crypt, sha512crypt, and bcrypt are 34,55,98, and 60 chars long respectively
  2. (in base64 encoding with annotation and salt)
  3.  
  4. >>> import crypt
  5. >>> crypt.crypt('not my real password','$1$saltsalt')
  6. '$1$saltsalt$4iXfpnrgHRXkrDbPymCE4/'
  7.  
  8. >>> crypt.crypt('not my real password','$5$saltsalt')
  9. '$5$saltsalt$E0bMpsLR71z8LIvd6p2tD4LZ984JxyD7B9lPLhq4vY7'
  10.  
  11. >>> crypt.crypt('not my real password','$6$saltsalt')
  12. '$6$saltsalt$KnqiStSM0GULvZdkTBbiPUhoHemQ7Q06YnvuJ0PWWZbjzx3m0RCc/hCfq54Ro3fOwaJdEAliX9igT9DD2oN1u/'
  13.  
  14. >>> import bcrypt
  15. >>> bcrypt.hashpw('not my real password', "$2a$12$saltsaltsaltsaltsalt..")
  16. '$2a$12$saltsaltsaltsaltsalt..FW/kWpMA84AQoIE.Qg1Tk5.FKGpxBNC'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement