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: General Discussions: Internet Security: Re: [PerlKid] Encrypt or not?: Edit Log



yapp
User

Feb 23, 2002, 2:16 AM


Views: 28666
Re: [PerlKid] Encrypt or not?

Yep. Here are even some more details (using a sample console program)

[perl]
print "Please enter your password: ";
chomp(my $password) = <STDIN>; # Enter a password

my $crypted = crypt($password, 'rx'); # rx is just a random key.
print "crypted password: $crypted\n";



## Now, append this code to see a password check in action:


print "\nNow, let's check passwords\nPlease enter your password: ";
chomp(my $entered = <STDIN>);

if( crypt($entered, $crypted) eq $crypted) {
print "Password is OK\n";
}
else {
print "Wrong password!\n";
}
[/perl]

Does this forum only accept one perl code tag?? I couldn't split these two?

Yet Another Perl Programmer

_________________________________
~~> [url=http://www.codingdomain.com]www.codingdomain.com <~~
More then 3500 X-Forum [url=http://www.codingdomain.com/cgi-perl/downloads/x-forum]Downloads! Cool

(This post was edited by yapp on Feb 23, 2002, 2:19 AM)


Edit Log:
Post edited by yapp (User) on Feb 23, 2002, 2:18 AM
Post edited by yapp (User) on Feb 23, 2002, 2:19 AM


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

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