Reputation: 17
I have switched an application from ASP.Net to JSP servlets. In the old project all user passwords were encrypted and stored in a sql database. Now I want to authenticate the users with the existing encrypted passwords, created by the old application, using the new application.
Is there is any way to decrypt that password in JSP and authenticate the user?
The programmer has not used a separate method to do the encryption. He encrypted the password by using a built-in method.
Thank you in advance.
Upvotes: 0
Views: 438
Reputation: 5256
I agree with the first answer. You should keep in mind though that in this way you are vulnerable to collision attacks, because hash functions usually are not injective.
In any case, you shouldn't do the verification in JSP, better in the controller, because JSP pages are supposed to only provide the view.
Good luck and keep us updated with your progress!
Upvotes: 0
Reputation: 1222
You can take the User's password and encrypt it using the "inbuilt" method and match the output from the existing password in the database.
Upvotes: 1