Newbie: Decrypting Password field
424486Mar 14 2005 — edited Mar 15 2005Hi,
I've a table to store Employee ID and Password as follows:
SQL> desc emp_passwords
Name Null? Type
----------------------------------------- -------- -----------------
EMP_ID NOT NULL VARCHAR2(10)
EMP_PASSWORD NOT NULL VARCHAR2(20)
I've kept Password in the database afer encrypting it using following combination of functions:
INSERT INTO emp_passwords (emp_id, emp_password)
VALUES (emp_id, translate (dbms_utility.get_hash_value (emp_password, 37, 1000000000), '1234567890', 'ZYXWVUTSRQ'));
Where emp_password is the actual password to be encrypted. So the emp_password 'zubair' for emp_id '1377' is stored as follows:
EMP_ID EMP_PASSWORD
---------- -------------
1377 TZSXUVRRV
It works fine. And I can authenticate an employee by encrypting the entered password and comparing it with encrypted pwd string in the table. Which works fine too.
Now I need to decrypt the password string so that I can retrieve pwd to build Forgot Password functionality. i.e. the procedure should return me 'zubair' when I enter emp_id '1377'. But some how I'm not able to decrypt it.
What is the mechanism to decrypt it? I need a solution to this problem as rest of the application with this functionality has already been deployed and changing the mechanism is not an option.
Thanks in advance.
Regards
Ali Kazim