Advertisement
Guest User

SafePassword

a guest
Jun 22nd, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.92 KB | None | 0 0
  1. # https://github.com/NotStatilko/NonCipher
  2. # t.me/not_statilko
  3.  
  4. from hashlib import md5
  5.  
  6. def secure_password(password,salt,iterations):
  7.     '''
  8.    Function for generating strong password
  9.    
  10.    param password: your regular password
  11.        used to make it secure.
  12.            [type must be bytes].
  13.                
  14.    param salt: salt for hashing.
  15.        you can use any word you won't forget
  16.            [type must be bytes].
  17.    
  18.    param iterations: number of iterations
  19.        over hash.
  20.            [type must be int]
  21.    
  22.    '''
  23.     for i in range(iterations):
  24.         password = md5(password + salt).digest()
  25.     return md5(password).hexdigest()
  26.  
  27. if __name__ == '__main__':
  28.     standart_password = 'QWERTY'.encode()
  29.     secret_word = '@not_statilko'.encode()
  30.     iteration_count = 220302
  31.    
  32.     print(secure_password(
  33.         standart_password,
  34.         secret_word,
  35.         iteration_count))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement