473,803 Members | 3,306 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

validate password within PL/SQL?

Hi! I'm looking for a way to validate a password within PL/SQL. I want to
write

CREATE PROCEDURE change_password (old_password IN VARCHAR2)
IS
BEGIN
-- check if old_password is correct... but how?

I can get the hashed value of the password from DBA_USERS, of course, but is
there a way to hash old_password to see if it matches? (I wouldn't be
surprised if Oracle doesn't supply access to its one-way password hashing
algorithm... too useful for a password cracker...)

I can't actually try a CONNECT statement from within PL/SQL, right? And even
if I could, that would kill my current connection, right? That's no good...

Of course, because the user logged in successfully, they obviously had the
correct password at one point. But what if they logged in, left their desk,
and now somebody else is trying to change their password? Limiting idle_time
in the user's profile reduces the risk of this, but it's also really
annoying, especially if the time is short enough to protect every stroll to
the coffeepot.

The PASSWORD command in SQL*Plus prompts for old password, but I'm trying to
put this in a procedure that can be called from a GUI.

OK, here's an idea! I can create a dummy user identified by the supplied
old_password, then SELECT PASSWORD FROM DBA_USERS to see if the hashed
password of the dummy user matches the hashed password of the application
user... nope, didn't work! Apparently the algorithm doesn't have a simple 1
clear-text-password: 1 hashed-password mapping; each username/password
combination gets a different result.

As you can see, I'm running out of ideas. Can anyone help?

Thanks very much!
- Catherine
http://profiles.yahoo.com/arcticturtle
----- Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web -----
http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
NewsOne.Net prohibits users from posting spam. If this or other posts
made through NewsOne.Net violate posting guidelines, email ab***@newsone.n et
Jul 19 '05 #1
3 14522
I may not be able to help you excatly what are u trying to do , but
here is one tip .may it help you.
For example
if you get the hashed values of a passward say "ABC" and hashed
values is say "qwer" now you change the psswrd ABC to "def".
Now do this

alter user test identified by 'qwer' .

now the passward is again ABC
;)
Faheem

arktikturtle@co rrectthe_spelli ng.yahoo.com wrote in message news:<br******* ***@news.netmar .com>...
Hi! I'm looking for a way to validate a password within PL/SQL. I want to
write

CREATE PROCEDURE change_password (old_password IN VARCHAR2)
IS
BEGIN
-- check if old_password is correct... but how?

I can get the hashed value of the password from DBA_USERS, of course, but is
there a way to hash old_password to see if it matches? (I wouldn't be
surprised if Oracle doesn't supply access to its one-way password hashing
algorithm... too useful for a password cracker...)

I can't actually try a CONNECT statement from within PL/SQL, right? And even
if I could, that would kill my current connection, right? That's no good...

Of course, because the user logged in successfully, they obviously had the
correct password at one point. But what if they logged in, left their desk,
and now somebody else is trying to change their password? Limiting idle_time
in the user's profile reduces the risk of this, but it's also really
annoying, especially if the time is short enough to protect every stroll to
the coffeepot.

The PASSWORD command in SQL*Plus prompts for old password, but I'm trying to
put this in a procedure that can be called from a GUI.

OK, here's an idea! I can create a dummy user identified by the supplied
old_password, then SELECT PASSWORD FROM DBA_USERS to see if the hashed
password of the dummy user matches the hashed password of the application
user... nope, didn't work! Apparently the algorithm doesn't have a simple 1
clear-text-password: 1 hashed-password mapping; each username/password
combination gets a different result.

As you can see, I'm running out of ideas. Can anyone help?

Thanks very much!
- Catherine
http://profiles.yahoo.com/arcticturtle
----- Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web -----
http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
NewsOne.Net prohibits users from posting spam. If this or other posts
made through NewsOne.Net violate posting guidelines, email ab***@newsone.n et

Jul 19 '05 #2
arktikturtle@co rrect_the_spell ing.yahoo.com wrote in message news:<br******* ***@news.netmar .com>...
Hi! I'm looking for a way to validate a password within PL/SQL. I want to
write

CREATE PROCEDURE change_password (old_password IN VARCHAR2)
IS
BEGIN
-- check if old_password is correct... but how?
The easiest way I could envision doing something like this would be to
create a Java stored procedure that attempted to connect with the
supplied username & password.
OK, here's an idea! I can create a dummy user identified by the supplied
old_password, then SELECT PASSWORD FROM DBA_USERS to see if the hashed
password of the dummy user matches the hashed password of the application
user... nope, didn't work! Apparently the algorithm doesn't have a simple 1
clear-text-password: 1 hashed-password mapping; each username/password
combination gets a different result.


I'd strongly suspect that the hash takes into account at least the
username & the machine the database is on. It would be really
unfortunate if I could take information from DBA_USERS on the
production machine, copy it over to my laptop, and start cracking
passwords. Not incorporating username & machine information into the
hash's salt would allow this sort of thing, so I'm pretty darn certain
Oracle doesn't allow it.

Justin Cave
Distributed Database Consulting, Inc.
www.ddbcinc.com/askDDBC
Jul 19 '05 #3
arktikturtle@co rrect_the_spell ing.yahoo.com wrote:
Hi! I'm looking for a way to validate a password within PL/SQL. I want to
write

CREATE PROCEDURE change_password (old_password IN VARCHAR2)
IS
BEGIN
-- check if old_password is correct... but how?

I can get the hashed value of the password from DBA_USERS, of course, but is
there a way to hash old_password to see if it matches? (I wouldn't be
surprised if Oracle doesn't supply access to its one-way password hashing
algorithm... too useful for a password cracker...)

I can't actually try a CONNECT statement from within PL/SQL, right? And even
if I could, that would kill my current connection, right? That's no good...

Of course, because the user logged in successfully, they obviously had the
correct password at one point. But what if they logged in, left their desk,
and now somebody else is trying to change their password? Limiting idle_time
in the user's profile reduces the risk of this, but it's also really
annoying, especially if the time is short enough to protect every stroll to
the coffeepot.

The PASSWORD command in SQL*Plus prompts for old password, but I'm trying to
put this in a procedure that can be called from a GUI.

OK, here's an idea! I can create a dummy user identified by the supplied
old_password, then SELECT PASSWORD FROM DBA_USERS to see if the hashed
password of the dummy user matches the hashed password of the application
user... nope, didn't work! Apparently the algorithm doesn't have a simple 1
clear-text-password: 1 hashed-password mapping; each username/password
combination gets a different result.

As you can see, I'm running out of ideas. Can anyone help?

Thanks very much!
- Catherine
http://profiles.yahoo.com/arcticturtle
----- Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web -----
http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
NewsOne.Net prohibits users from posting spam. If this or other posts
made through NewsOne.Net violate posting guidelines, email ab***@newsone.n et


There may be no need for it; any user is allowed to change his
own password with "alter user <current_user > identified by <new_password >"

SQL> create user demo identified by demo default tablespace users;
User created.

SQL> grant create session to demo;
Grant succeeded.

SQL> connect demo/demo@o920
Connected.

SQL> alter user demo identified by nemo;
User altered.

SQL> connect demo/nemo@o920
Connected.

So, create your procedure with invoker's rights and
change the password - as you mention, the user is
logged on, so has to know his/her password.

The obvious risk is someone else is actually changing
the password, while the user strolled off, leaving the
application open.
I'll leave it to you to shoot those endusers ;-)
--
Regards, Frank van Bortel

Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3866
by: Joeri KUMBRUCK | last post by:
Hello, I'm trying to create an ASP page where users can type in a username and password, and these credential should be checked with active directory. If username and password are correct, the script will continue to run otherwise it will stop. Below you will find my code I've programmed until now, at this moment I've got one big problem: the vbs part of the script works fine if you run it as a vbs file. If I copy/paste it into an ASP...
4
7741
by: Paul Steele | last post by:
I'm writing a C# program that needs to validate an Active Directory username/password? The program will be running on a workstation that is not part of the domain. It doesn't have to do anything else other than determine if the credentials are valid. Any pointers would be appreciated.
2
7599
by: Steffen Balslev | last post by:
I tried to find a way to validate user credentials using C#, searching google and lots of other news and kb sites left me without a solution. You can use a SSPI but it's that easy to implement so I found a simple way and here it is: using System.DirectoryServices; public bool Win2kCredentialsIsValid(string domain, string username, string password) { bool validLogin = false; string adPath = "LDAP://" + domain + "/rootDSE";
0
1365
by: Joeri KUMBRUCK | last post by:
Hello, I'm trying to create an ASP page where users can type in a username and password, and these credential should be checked with active directory. If username and password are correct, the script will continue to run otherwise it will stop. Below you will find my code I've programmed until now, at this moment I've got one big problem: the vbs part of the script works fine if you run it as a vbs file. If I copy/paste it into an ASP...
3
1404
by: Greg | last post by:
I am trying to figure out how to validate a userid against AD. At the time the user will be logged on as the local admin, right after puuling down a fresh image. the form asks for the userid and password to attach to a network share to install extra software on the machine. If the user types it wrong, it will just hang there. i am using shell("net use \\srvname\share /user:domain\Userid password", appwinstyle.hide, true). Is there a...
1
2479
by: Peterwkc | last post by:
hello all expert database administrator, i truly new to access. I want to develop a website where the password and re-enter password must be same. How to i validate this in access or i need ti validate this in asp ? Thanks for your help. Your help is greatly appreciated by me and others.
3
648
by: arktikturtle | last post by:
Hi! I'm looking for a way to validate a password within PL/SQL. I want to write CREATE PROCEDURE change_password(old_password IN VARCHAR2) IS BEGIN -- check if old_password is correct... but how? I can get the hashed value of the password from DBA_USERS, of course, but is there a way to hash old_password to see if it matches? (I wouldn't be
3
1484
by: ojnoka | last post by:
Hi, I am a newbie. I don't know javascript. I use the free javascripts and try to understand them. I have a javascript now, to validate username and password. I paste it below. My question now. Is it possible to let it validate more than one username and password? For example text3 and text4? <form> <p>ENTER USER NAME : <input type="text" name="text2"> </p> <p> ENTER PASSWORD :
5
2642
by: ghjk | last post by:
I have a web site with several web pages. They are having different number of variables. eg: first page having 4 variables in the form(Name, Phone, ID, Gender) second page having 10 variables in the form(eg: Name, Age, Time, etc.) I want to validate each and every variable. So how can I do that? I found this JavaScript.But in this case for each and every variable I have to write a function.Eg:for each and every variable i have to rewrite the...
0
9564
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10546
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10292
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10068
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5498
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5627
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4275
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2970
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.