Guest User

Untitled

a guest
Jan 30th, 2019
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. import sys;
  4. import getpass;
  5. import crypt;
  6. import uuid;
  7.  
  8. password = getpass.getpass("New Password: ");
  9. salt = uuid.uuid4().hex [0:8];
  10.  
  11. #print("Pass:",password);
  12. #print("Salt:",salt);
  13.  
  14. hash=crypt.crypt(password, "$6$"+salt+"$");
  15.  
  16. if len(sys.argv) > 1:
  17. username = sys.argv[1]
  18. print(username+": {CRYPT}"+hash);
  19. else:
  20. print("{CRYPT}"+hash);
Add Comment
Please, Sign In to add comment