Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_jsp thread: How to encrypt and decrypt a password using JSP???


Message #1 by "Rafael Bustamante" <rbustamante@t...> on Mon, 12 Aug 2002 22:25:41
Hi!

i need some help. I don´t speak english, please excuse me.

I´m new in JSP and i have to encrypt and decrypt a password. The password 
is stored encrypted in Oracle8, and i need to encrypt the password 
submitted by the user to compare it whit the "DB password", and then 
decrypt the "DB password" to compare it with the password posted by user.

I´m a ColdFusion programmer, and in CFML this is really easy to do:
to encrypt:
<cfset key="some_key">
<cfset password="#password_submitted#">
<cfset encrypted_pass=encrypt(#password#, #key#)>

to decrypt:
<cfquery datasource=Database user=user password=password name=query>
select password
from users
where user=username
</cfquery>

<cfset decrypted_password=decrypt(#query.password#, #key#>

that is all we need to encrypt and decrypt using coldfusion, but, how i do 
the same using JSP???

I´m using JDBC calling stored procedures in Oracle8. 

Please, help me!!!

Thanx to all.

  Return to Index