top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

password should be decrypt during login and encrypt during log out in java?

+1 vote
393 views

In my web application I have a requirement database password should be stored in properties fie and that should be encrypted and during login that it needs to check the username password and database password database password should be decrypt during login and and encrypt during log out.

posted Mar 18, 2014 by Shiva Kumar H

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

I would suggest to have a look at the following functions from the MYSQL directly
https://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html

These functions can be directly called in the insert statement like

INSERT INTO mytbl (md5_passwd, ...) VALUES(MD5('abcdef'), ...);

This should solve your most of the passwd related issues and you can directly call the functions implemented in mysql and can avoid the big code to be written in Java.

answer Mar 18, 2014 by Salil Agrawal
Similar Questions
+2 votes

In my web application I need to encrypt the database password and and that should be stored in the properties file?

0 votes

I am having trouble to transfer email user account which is saved in MySQL to another server. Here is the detail:

I have an old email server which using MySQL to store user account information. The password field uses MySQL ENCRYPT function to save the users password. So if I want change the user's password I can do:
UPDATE mail.users SET password = ENCRYPT( '12345' ) WHERE CONVERT( users.email USING utf8 ) = 'g@veecall.com' LIMIT 1 ;

Then the new password "12345" saved in the table as string of "2I6JOeg.JukJ."

Now I build a new server using iRedMail. When I try to transfer user account I have trouble to transfer the password field. Because the iRadMail/dovecot is using MD5-CRAM to encrypt the password then save it
in the MySQL. All the password string is started with "$1$".

So, is there a way to make the MySQL encrypted password string "2I6JOeg.JukJ." convert to MD5 hash "$1$................."?

...