#!/usr/bin/perl print STDOUT "Enter a username: "; # ask for a user my $username = ; # input the username chomp $username; print STDOUT "Enter a password: "; # ask for a pass my $password = ; # input the pass chomp $password; my $crypted = crypt($password.$username,aa); # we store this value for later.... print STDOUT "The username is $username\n"; print STDOUT "The password is $password\n"; print STDOUT "The encrypted passwd is: $crypted\n"; print "\n\n\n"; print STDOUT "Testing out the password system....\n"; while (1) { print STDOUT "Enter the username: "; my $ipusername = ; chomp $ipusername; print STDOUT "Enter the password: "; my $ippassword = ; chomp $ippassword; my $recrypted = crypt($ippassword.$ipusername,aa); print STDOUT "The retrived passwd is: $recrypted\n"; if ($recrypted eq $crypted) { dologin(); exit 0; } print STDOUT "Login Incorrect, please try again.\n\n\n"; } sub dologin { #do stuff print STDOUT "Login OK, welcome to the system.\n\n\n"; exit 0; }