I am working on a module which takes some input from user and encrypts the String before saving to the database,
Now i have a requirement is to decrypt the same string to use it for various processes.
To generate a unique encrypted String id from the user input.
I tried generating a random int and concatenating the string from user to this int and then encrypting
but then again how can i decrypt the same to the get the value inserted by user at another place for another process.
I know of the Java MD5/SHA Digesters which to do a similar function.
But since this seems to be like no dehashing/decrypting, only half of the requirement is accomplished.
Please suggest a good method to tackle this situation.
Thanks in advance,
(P.S I haven't tried JCA and didn't get any reading material to start with.)
MD5 and SHA are not encryption algorithms but hash algorithms. You can see it as one way encryption. You should look into JCE. I know that some of one will say "duh!" to the following statement but to be sure: please don't invent our own encryption algorithm.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Wouter Oet wrote:MD5 and SHA are not encryption algorithms but hash algorithms. You can see it as one way encryption. You should look into JCE. I know that some of one will say "duh!" to the following statement but to be sure: please don't invent our own encryption algorithm.
Thanks for replying,
I had written JCA for JCE by mistake earlier.
I understand reinventing the wheel is not always the right thing,
But i thought there might be some simple algorithm to come up with,
but couldn't think of a correct but simple way...
Can you suggest any e-books or links for starting with JCE
(will be much obliged if those are with some examples.)