I'm going through some python exercise, and according to the book using
Quote:
hashlib.sha512(password + salt).hexdigest()
|
you can create a password in the same format stored in shadow file; however, I enter my password, and use the same salt that shows my shadow file password, and the resulting hashing doesn't match. What I'm doing wrong? am I using the wrong salt? how does the system get the ascii for the salt? and does the salt goest in front or after when using hashlib.sha512(password + salt).hexdigest()
this is an example of the shadow file user password
Quote:
nagios:$6$P9zn0KwR$tgfvvFWJJ5FKmoXiP5rXWOjwoEBOEoAuBi3EphRbJqqjWYvhEM2wa67L9XgQ7W591FxUNklkDIQsk4kij uhE50:16632:0:99999:7:::
|
the salt is the field from the second $ to the next $. and the actual password is what follows. I used that hash when using hashlib.sha512(password + hash), but I get a different hash... thanks