Home » SQL & PL/SQL » SQL & PL/SQL » Password Encryption
Password Encryption [message #263746] Thu, 30 August 2007 23:22 Go to next message
thani_oracle
Messages: 44
Registered: August 2007
Location: Bangalore
Member

Hi Friends,
I Want to know how to Encrypt a letter i want to store password in database. For that i want to do encrypt..

When user forget the password i want to send he's password for that i want decrypt

oracle 10g R2
and
Mssql2005

Thanks and Regards,
Thanigachalam.T
Re: Password Encryption [message #263768 is a reply to message #263746] Fri, 31 August 2007 00:15 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Check out DBMS_CRYPTO
Re: Password Encryption [message #272143 is a reply to message #263746] Thu, 04 October 2007 02:12 Go to previous messageGo to next message
fanni
Messages: 96
Registered: March 2004
Member
Oracle 10g dbms_crypto package
SQL> set serveroutput on
SQL>
SQL> DECLARE
2 LC$Source VARCHAR2(19) := 'Music is the best!';
3 LR$Source RAW(128) := utl_raw.cast_to_raw(LC$Source);
4 LR$Key RAW(128) := utl_raw.cast_to_raw('FrankZappa');
5 LR$Crypted RAW(2048);
6 LR$Decrypted RAW(2048);
7
8 BEGIN
9
10 dbms_output.put_line('Source string : ' || LC$Source);
11
12 LR$Crypted := dbms_crypto.encrypt(LR$Source,
13 dbms_crypto.des_cbc_pkcs5, LR$Key);
14
15 dbms_output.put_line('Encrypted raw : ' ||
16 RAWTOHEX(utl_raw.cast_to_raw(LR$Crypted)));
17
18 LR$Decrypted := dbms_crypto.decrypt(src => LR$Crypted,
19 typ => dbms_crypto.des_cbc_pkcs5, key => LR$Key);
20
21 dbms_output.put_line('Decrypted string : ' ||
22 utl_raw.cast_to_varchar2(LR$Decrypted));
23 END;
24 /
Source string : Music is the best!
Encrypted raw :
33454635363638343931453734313342373337454141313133453637323639373934373433463442
4533464246333831
Decrypted string : Music is the best!

PL/SQL procedure successfully completed.

SQL>

Re: Password Encryption [message #272149 is a reply to message #272143] Thu, 04 October 2007 02:18 Go to previous messageGo to next message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Thanks for the feedack but next time try to format it (OraFAQ Forum Guide).

Regards
Michel
Re: Password Encryption [message #272200 is a reply to message #272143] Thu, 04 October 2007 03:56 Go to previous messageGo to next message
thani_oracle
Messages: 44
Registered: August 2007
Location: Bangalore
Member

Hi,
Thanks Mr fanni
Regards,
Thani...
Re: Password Encryption [message #272232 is a reply to message #263746] Thu, 04 October 2007 05:00 Go to previous messageGo to next message
muzahid
Messages: 281
Registered: September 2004
Location: Dhaka, Bangladesh
Senior Member
Thani you get that at following link
http://www.oracle-base.com/articles/10g/DatabaseSecurityEnhancements10g.php

And you get enhance feature of 10 g from the following site
http://www.oracle-base.com/articles/10g/Articles10g.php

And this may help you.
Re: Password Encryption [message #272273 is a reply to message #272232] Thu, 04 October 2007 06:54 Go to previous message
Frank
Messages: 7880
Registered: March 2000
Senior Member
What does that link add to the link I provided in combination with the example fanni posted?
Previous Topic: problem in SUM
Next Topic: Formatting the sql query results using shell scripts
Goto Forum:
  


Current Time: Fri Dec 09 00:23:08 CST 2016

Total time taken to generate the page: 0.08018 seconds