in reply to C::B at LG

Thanks for the tip...I'll make sure to look into it. I tried to play around with crypt(), but didn't get too far seeing as I didn't know what a salt was.

redmist
redmist.dyndns.org
email::redmist

PS Thanks extremely.

Replies are listed 'Best First'.
RE: (redmist) RE: C::B at LG
by extremely (Priest) on Nov 06, 2000 at 03:11 UTC
    Since no one else has chimed in on this with anything useful, I'll take up the gauntlet.

    crypt() isn't a full system for encrypting and decrypting data. It is a one way 'hash' used for encrypting passwords. The old system for unixish password protection used crypt().

    The salt is a two character string that is "blended" into to given password when hashing to help confuse the reversing of hashes back to passwords. The stored password is of the form: SSHHHHHHHHHHH. When you are given a password and you want to check it against the stored hash, you simply do:

    sub passtest { $passtotest=shift; $crypted=shift; return ( crypt($passtotest,$crypted) eq $crypted ); }

    The crypt function will just take the first two characters off of it's second argument and thus use the same salt as the originally crypted password. See perldoc -f crypt for more on this.

    Just please don't think you can get data back out of crypt() =)

    --
    $you = new YOU;
    honk() if $you->love(perl)

RE: (redmist) RE: C::B at LG
by turnstep (Parson) on Nov 06, 2000 at 00:35 UTC
                      Pronunciation: &-'solt
                      Function: noun
                      Etymology: Middle English assaut, from Old French, from
                      (assumed) Vulgar Latin assaltus, from assalire
                      Date: 14th century
                      1 a : a violent physical or verbal attack b : a military attack
                      usually involving direct combat with enemy forces c : a
                      concerted effort (as to reach a goal or defeat an adversary)
                      2 a : a threat or attempt to inflict offensive physical contact
                      or bodily harm on a person (as by lifting a fist in a
                      threatening manner) that puts the person in immediate
                      danger of or in apprehension of such harm or contact --