loren has asked for the wisdom of the Perl Monks concerning the following question:

I'm searching for a way to crypt all the data that I pass trough my CGIs, some like mycgi.pl?F$FK4lfkalwalwk4$4fla4kfal4aLk4flawñlawlkasdñfkaS$44F$4afS$Lkf I've experimented with whis way: Taking all the parameters string and a key string (That I only knows, and my perl decrypting routine, of course), I make a XOR logic operation between each character: The first char. of parameters string with the first char. of key string, and so on. It runs nice, and the crypted string is so undeciphrable, but there has some problems: Some XOR operations return numbers like 13 (Carraige Return), 7 (Escape code), etc. I can't pass this special chars. to the parameters commandline of a CGI! Any suggestions?

Replies are listed 'Best First'.
Re: Some way to crypt my CGI parameters
by vroom (His Eminence) on Feb 18, 2000 at 22:02 UTC
    crypt does a one way encryption and is used for passwords. The only way of checking whether you enter the correct password is to run the password you enter through crypt and seeing if it matches the entry in the /etc/passwd file

    Tim Vroom | vroom | vroom@cs.hope.edu
Re: Some way to crypt my CGI parameters
by Anonymous Monk on Feb 18, 2000 at 20:17 UTC
    I have to answer myself! :DDD I have found the function crypt() in perl standard function library. It crypts a string with a key string so nice, and the crypted resultant string does not contain any strange characters, so I can pass it trough a QUERY CGI But I have another big problem !... There's not a function to decrypt it!!! aaarghh! How do I decrypt a string crypted with crypt() ? Or ... what's the algorithm used internally by crypt() ?