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: Perl Programming Help: Beginner:
$password = crypt($password, "MM"); What MM mean? Please explain for me.

 



kiho
Deleted

May 1, 2000, 6:12 PM

Post #1 of 5 (1233 views)
$password = crypt($password, "MM"); What MM mean? Please explain for me. Can't Post

Hi All!
I saw this code :
$password = crypt($password, "MM");
and
$password = crypt($password, "aa");

I dont know what is "MM" and "aa"?
Anyone can tell me about that. Thank you for your help


Cretep
User

May 1, 2000, 6:34 PM

Post #2 of 5 (1233 views)
Re: $password = crypt($password, "MM"); What MM mean? Please explain for me. [In reply to] Can't Post

Hi
The MM and aa is the crypt key. Go to http://www.perl.com/pub/doc/manual/html/pod/perlfunc.html and you will find all the documentation for all the PERL functions you will ever need.

Best regards

Peter Crouch


japhy
Enthusiast

May 1, 2000, 7:23 PM

Post #3 of 5 (1233 views)
Re: $password = crypt($password, "MM"); What MM mean? Please explain for me. [In reply to] Can't Post

I wrote an email discussing crypt(). You can read it at my web site.


kiho
Deleted

May 1, 2000, 9:02 PM

Post #4 of 5 (1233 views)
Re: $password = crypt($password, "MM"); What MM mean? Please explain for me. [In reply to] Can't Post

Hi my friends !
Thanks for your help. I have one more question.

I got the crypt look like:
"1$Fa$swe/REDS.ds.dW"

1) Now I want to replace all special character
"$ / ." to 1 normal character like "a". How can I do it.

2) I have a long string such as:
"esarFAGONdsfsdsgw" I want to print just: "FAGON" only. Please show me HOW.
Anyway thank you very much. Kiho.


perlkid
stranger

May 2, 2000, 10:03 PM

Post #5 of 5 (1233 views)
Re: $password = crypt($password, "MM"); What MM mean? Please explain for me. [In reply to] Can't Post

 
Try using a substitute or translate function before print the pass word to a data base.

$password = crypt($password, "MM");
$password = tr/$/a/;
$password = tr/./b/;

easier if you do this

$password = crypt($password, "MM");
s/.\$\many more\/a/g;

then when comparing the data that they later enter to login you must do the same translation in order to have a match.

the substitute fuctions alone look like this, just in case the previous ones are wrong.

s/pattern/new one/g;
tr/pattern/new one/;

g means to subtitute the patterns for each time that they occur.

good Luck,

perlkid

 
 


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

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