Hi everyone,
I have a situation where I want to get back my users'password where the user might forget the password and the application want to sent to the particular user for the lost password. And also this is transparent to the system admin user.
Originally posted by ckwan Hi everyone,
I have a situation where I want to get back my users'password where the user might forget the password and the application want to sent to the particular user for the lost password. And also this is transparent to the system admin user.
Any ideas on this ?
Thanks
Well if that was possible, then there goes the security...
no you cannot decrypt the password, what you can do is save the encrypted password some where and then reuse it to reset the password to initial password in case the user losses his or her password.
Code:
SQL> select username,password from dba_users where username ='HR';
USERNAME PASSWORD
------------------------------ ------------------------------
HR E3FDF7CE80ED18FE
SQL> conn hr/manager;
Connected.
--initial password was manager
SQL> conn sys as sysdba
Enter password:
Connected.
SQL> alter user hr identified by hr;
User altered.
--changed the password
SQL> conn hr/manager;
ERROR:
ORA-01017: invalid username/password; logon denied
Warning: You are no longer connected to ORACLE.
SQL> conn sys as sysdba
Enter password:
Connected.
SQL> alter user hr identified by values 'E3FDF7CE80ED18FE';
User altered.
--resets the password to manager
SQL> conn hr/manager;
Connected.
SQL>
This method is good in case you don't know a user password and you want to make changes in his/her schema without letting her know
Just change it, make changes, reset it
Little bit off the main topic. But you can find a way to use it.
HTH
Amar "There is a difference between knowing the path and walking the path."
You can not decrypt the password because it is not stored encrypted in the database dictionary!
The gibberish values that can be seen in DBA_USERS.PASSWORD column are not encripted passwords, they are hash values of passwords + corresponding usernames. So they are obteined by implementing some hashing alghorytm, not some encription alghorytm.
There is a huge difference between encryption and hashing. Encrypton is a reversible proces, while hashing is not. What that means? With encryption, you can allways get the original value from the encrypted value, provided that you have propper encryption key and an alghorytm. But with hashing process it is different. You can (generally speaking) never get the original value from the hashed value, even if you know the hashing algorythm. It is mathematicaly one-way process.
Oracle stores only hashed values of the passwords, so noone (including everyone in Oracle Corp.) can ever "guess" what the real password is, even if he got access to thos hashed passwords. The only way to get real password from its hash value is by use of brute force.
Jurij Modic ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
Originally posted by adewri hashed not encrypted thats news...
In oracle (and in unix too):
hash_pwd = TO_HASH(pwd, username)
and not exists (as a mathematic method in nature):
pwd = TO_PWD(hash_pwd, username)
but encription/description has reverse mathematic methods
if u can:
encr_pwd = TO_ENCR(pwd, username)
then must be exists (as a mathematic method):
pwd = TO_DESCR(encr_pwd, username)
NOTE: TO_HASH, TO_PWD, TO_ENCR, TO_DESCR are not real functions
only as example.
Originally posted by jmodic The only way to get real password from its hash value is by use of brute force.
You mean Mr.Hanky with a shot-gun?
"The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman
Bookmarks