CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Problem when comparing encrypted passwords

 



adolfo
Novice

Aug 29, 2001, 6:18 AM

Post #1 of 2 (704 views)
Problem when comparing encrypted passwords Can't Post

Hello everybody !!!
I made an administration script where I can change the users passwords and I made another script to control the users sesions.

To create passwords I did this (in the admin script):
$newpass = crypt($pass, aa);
open (PASS, ">$user/password.txt");
print PASS "$newpass";
close (PASS);

then in the access control script I made this to compare the password that the user wrote in the login form with the stored (and encrypted) password:

open (CONTROL, "<$user/password.txt");
$passtxt = <CONTROL>;
close (CONTROL);
If ( crypt($formpass, $passtxt) eq $passtxt){
&ok;
}else{
print "PASSWORD DOESN'T MATCH";
}

The problem was that I always got the error PASSWORD DOESN'T MATCH so I made this to compare and to see the vars values:

open (CONTROL, "<$user/password.txt");
$passtxt = <CONTROL>;
close (CONTROL);
$control = crypt($formpass, $passtxt) ;
If ($control eq $passtxt){
&ok;
}else{
print "PASSWORD DOESN'T MATCH";
print "control: $control - passtxt: $passtxt";
#If the error occurs again I would see the values
}

I got the same error and I saw that passwords were diferents.
I don't know what's going wrong.
I used a one letter password to ensure I was writing the correct password.
Please help me!!
thanks =)


~Adolfo~


Jasmine
Administrator / Moderator

Aug 29, 2001, 1:57 PM

Post #2 of 2 (696 views)
Re: Problem when comparing encrypted passwords [In reply to] Can't Post

The duplicate post was deleted. Please post your question in only one forum.


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives