0

Hello i want to encrypt or hash some data and put them on the database. Which is more secure encryption or hash and how i can do this?
thank you very much for your help

2
Contributors
5
Replies
9
Views
5 Years
Discussion Span
Last Post by jalpesh_007
0

Thank you for the reply. How i can use AES but the key that is used to encrypt and decrypt will be always the same for a user?
Thank you very much

0

you can see the following link to get more idea about your question

http://my.safaribooksonline.com/book/databases/oracle-pl-sql/0596005873/data-encryption-and-hashing/oracleplsqldba-chp-4-sect-3

http://searchsqlserver.techtarget.com/tip/SQL-Server-encryption-vs-hashing-for-data-security

What you want is a one way hash rather than encryption, decryption. You store the hashed password in the database. When you get the password at login time, you hash it and compare it to the version stored in the database. There is absolutely no way to derive the real password from the persisted version.

This is very easy. Use the java.security.MessageDigest class, http://java.sun.com/j2se/1.3/docs/api/java/security/MessageDigest.html. It doesn't really matter which algorithm you choose, MD5 or SHA, but there's plenty of documents on Google comparing the two.

0

I did the hash for the password but now i want to encrypt some informations that i put in cookie. So i need two way encryption so i can encrypt and decrypt it
Thank you very much i will check the links

0

i think you have to follow the link through which you can get more ideas about which algorithm to use..AES or MD5....

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.