Path: utzoo!utgpu!watmath!att!pacbell!ames!apple!oliveb!mipos3!omepd!merlyn From: merlyn@iwarp.intel.com (Randal Schwartz) Newsgroups: comp.unix.questions Subject: Re: Password checking program Message-ID: <4743@omepd.UUCP> Date: 2 Aug 89 15:08:49 GMT References: <60964@linus.UUCP> Sender: news@omepd.UUCP Reply-To: merlyn@iwarp.intel.com (Randal Schwartz) Organization: Stonehenge; netaccess via Intel, Hillsboro, Oregon, USA Lines: 43 In-reply-to: ccel@community-chest.uucp (CCEL) In article <60964@linus.UUCP>, ccel@community-chest (CCEL) writes: | I'm still getting requests for that silly password checking program | I talked about last week, and I thought i'd posted the source here | to the net but people are still asking me for it. My mailer is, well, | terrible, so rather than sending out 20 copies of it and having half | of them come back to me, i'll post the source (again?). Sorry to all | of you who have seen this before ... | | Remember to take my .sig off the end of this guy. | | -------------------------------CUT HERE----------------------------- | [long c program deleted] Or, the same thing in Perl (v2.0)... ==================================================snip snip #/usr/bin/perl print "Enter username to search for: "; chop($username = ); print "Searching for '$username' ...\n"; open(PASSWD, ") { ($thisuser,$passwd) = split(/:/); last if $thisuser eq $username; } die "User not found in passwd file." unless $_; close(PASSWD); open(DICT,") { chop; printf "Now on the %s's\n", $ch = substr($_,0,1) unless /^$ch/i; print "The password is '$_'\n", last if crypt($_,$passwd) eq $passwd; } die "Sorry ... password not found in dict.\n" unless $_; close(DICT); ==================================================snip snip Just a satisfied Perl hacker... -- /== Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ====\ | on contract to Intel, Hillsboro, Oregon, USA | | merlyn@iwarp.intel.com ...!uunet!iwarp.intel.com!merlyn | \== Cute Quote: "Welcome to Oregon... Home of the California Raisins!" ==/