Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

encryption

 
Raj Joe
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how do i encrypt my password and store in my database and then decrypt and show it to user.

What are the types of algorithms used?
 
Fisher Daniel
Ranch Hand
Posts: 582
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Raj Joe,
You can use Java Cryptography Extension

correct me if I am wrong
thanks
daniel
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the Security forum...
 
Kishore Dandu
Ranch Hand
Posts: 1934
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At the basic, you can Base64 encode the password into the database & then base64 decode from the database; and then do the comparision.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And you may also need to UUencode the hash in order to prevent it from getting corrupted in the database (depending on the characterset the database uses to store string data).

We once found that out to our shagrin, luckily we caught it before going life (was luck, someone tried a password which happened to result in a non-printable character in the hash, had that not happened we'd not have caught it in testing).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic