aspose file tools*
The moose likes Security and the fly likes how to save password in encrypted/Decrypted format Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Security
Bookmark "how to save password in encrypted/Decrypted format" Watch "how to save password in encrypted/Decrypted format" New topic
Author

how to save password in encrypted/Decrypted format

raj jaiswal
Ranch Hand

Joined: Nov 25, 2008
Posts: 56
Hi


I want to save password in encrypted/Decrypted format in database.How to do that..
Please some help me to do this.



Thanks
Rajjaiswal
MCA SCJP1.6
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41804
    
  62
Encrypting a password merely transform the problem of protecting passwords to the problem of protecting the encryption key - which is not substantially different.

What one usually does instead is to hash (or digest) passwords using an algorithm like SHA-2 (or SHA-256, as it's called in the Java world), thus ensuring that passwords can never be recovered.


Ping & DNS - my free Android networking tools app
James Sabre
Ranch Hand

Joined: Sep 07, 2004
Posts: 781

Ulf Dittmer wrote:an algorithm like SHA-2 (or SHA-256, as it's called in the Java world)


SHA2 denotes the family SHA-256, SHA-384 and SHA-512 and not just SHA-256. All are available in the JRE.


Retired horse trader.
 Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
raj jaiswal
Ranch Hand

Joined: Nov 25, 2008
Posts: 56
hi


Actually i dont know any things about SHA-256 .Please give some example so that i can understand better.

thanks
Mathieu Fortin
Greenhorn

Joined: Jan 29, 2011
Posts: 16
Usually you want one way encryption with passwords. Look into the java.security.MessageDigest class.

Some pseudo code:


Mathieu
http://simpleadn.blogspot.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to save password in encrypted/Decrypted format