Gossamer Forum
Home : General : Perl Programming :

crypt();

Quote Reply
crypt();
Hello again,
This may be a dumb question but i will ask anyways..
When a password is cryped is there any way to di-crypt it ?
Reason is.. Because i want to have a "forgot your password" option and if the passowrd is crypt then in their e-mail they recieve the crypt password and not the actual password that they submitted.
Or is this just not possible for secutiry reasons?

Thanx,
Drew
Quote Reply
Re: crypt(); In reply to
improbable if not impossible to do it. The encryption done by 'salting'

Code:
my @salt_chars = ('A' .. 'Z', 0 .. 9, 'a' .. 'z', '.', '/')

found on line 550 of db.pl if you would like to look at an example.


What I have done for a similiar reason was added this to my db.cgi ( the code was actual written by some one else).

first you need to define where you are going to store it at on your server. In the data base script (db.cgi)I used.

Code:
print PASS "$in{'userid'}:$encrypted:$permissions\n";
close PASS;

&html_signup_success;

open(LAST, ">>$latest") | | die $!;
print LAST "Userid: $in{'userid'}\n";
print LAST "Pass: $in{'pw'}\n";
print LAST "Email: $in{'Mail'}\n\n";
close(LAST);

}

Again this is not my code but it is what I use and it does work.. saves it to a file called saveme.txt (written automatically ) in the dbMan directory.

And from my grandmother a long time ago
Quote:
the only dumb question is the one that you did not ask.




------------------
Thanks in Advance

Daniel J.
http://www.blackrose.net
webmaster@blackrose.net