Use the MessageDigest 5 class available under java.security.MessageDigest
package.
MessageDigest class provides applications the functionality of a message digest
algorithm, such as MD5 or SHA. Message digests are secure one-way hash functions
that take arbitrary-sized data and output a fixed-length hash value.

Harish

Arul wrote:

> Hi Guys...
>
> Could any body tell me how to encrypt the password and save it in a
> database..
>
> Say my scenario goes like this...I write a login component in EJB and that
> checks whther the username and password is correct and based on the login
> name it gives the login permission.
>
> but before that when i save the user information , i should encrypt his
> password and save it in the datbase...It should be a irreversible
> encryption.
>
> When ever my component validates the username and password ,it shuld encrypt
> the passwrd and check for it ...
>
> Any ideas...
>
> Arul
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to