Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
168 views
in Technique[技术] by (71.8m points)

java - how do i retrieve the original plaintext password of a hashed password

I have gone through many articles and they all dicuss/advice how to convert a plain text password in to a hashed password and store in the database.

My question is, if the plain text password is hashed and stored in the database then how do i retrieve the original plaintext password if the user forgets the password ?

Ours is not a financial application like banking which requires very high security. Also my application demands us, to some extent to, to login and check the user account. Is there any way to do this, if we start storing the passwords by hashing them?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You don't. The only way you SHOULD do this process is to reset the user's password with something else that they can remember.

When you hash the password you run plaintext through an algorithm, the result of the algorithm is then stored to the database. To check to see if the user's password is correct (at their next log on) is to run the same algorithm again and compare the output to what's stored in the database - i.e. if the hashes match then the user's password must be right.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...