I am trying to retrieve the password and authenticate from the Galaxy framework. I successfully retrieve the password it's in hashed(sha1) format. How do I authenticate this with the password input by the user? My first guess would be converting hashed(sha1) into normal string and authenticating. Is that possible? If it is, how can I convert it into the string?
-
4I think you should do the opposite, the point of the hash is that you can not get the plain plassword text from it. Calculate the hash from the password and compare the two hashes.Facundo Casco– Facundo Casco2013-01-07 15:55:23 +00:00Commented Jan 7, 2013 at 15:55
-
Alright. That can be done. Is there any inbuild function in Python to convert normal text into hashed(sha1) format? Thanksuser1881957– user18819572013-01-07 15:57:14 +00:00Commented Jan 7, 2013 at 15:57
Add a comment
|
2 Answers
... My first guess would be converting hashed(sha1) into normal string ...
That's what cryptographic hash functions try to prevent (among other things) - this property is called pre-image resistance.
The basic steps would be the other way around:
- take user input
- compute hash over user input
- compare hashed user input to stored credentials/hashes