Advertisement
drakon-firestone

Hashing Hashlib

Mar 4th, 2023 (edited)
563
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.47 KB | Cybersecurity | 0 0
  1. import hashlib
  2.  
  3. # Declaring our password
  4. password1 = 'GeekPassword'
  5. password2 = 'GeekPassword'
  6.  
  7. '''
  8. można dodać 'sól' ale nie jeest to konieczne - przykład w źródle
  9. '''
  10.  
  11. hashed1 = hashlib.md5(password1.encode())
  12. hashed2 = hashlib.md5(password2.encode())
  13.  
  14.  
  15. # sposób na wyświetlenie (i porównanie) hashy
  16. hash1 = hashed1.hexdigest()
  17. hash2 = hashed2.hexdigest()
  18. print("Hashed1", hash1 )
  19. print("Hashed2", hash2 )
  20. print('Czy takie same:', hash1 == hash2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement