php crypt function

sinck@ugive.com sinck@ugive.com
Mon, 1 Jan 2001 18:34:49 -0700


\_ I need something I can use in a URL link.
\_ 
\_ http://www.myserver.com/phpscript.php?arg1=lkjlkjlkjlkjlkjlkjsdfsdfsdfsdfsdfsdf&arg2=LKJLKJLKJLKJLKJLKJSDFSDFSDFSDFSDFSDF
\_ 
\_ How does it look?  
A bit longish....

\_ Some browsers 
Did you mean "mail user agents" here?  Like outlook?  The rest of my
discussion assumes so.

\_ truncate long URLs, some stretch them out so they're
\_ still valid if you click on them.  Most users are too stupid 
You're on your way to becoming a BOFH.

\_ notice if they're wrapped and they need to copy and paste into a
\_ browser window.  Given the random nature of characters in the hash,
\_ it's impractical to ask them to type them in by hand.
\_ 
\_ Any suggestions?
Can you fold arg1 and arg2 into a single arg and go md5 on that?
You could build your own hashing algorithm....

Also, be aware of evil hashes that start with '3D'.  Why is that a
problem, I hear you ask?  Well, consider what happens when you have:

http://foo.com/foo.php?arg=3D234....

Looks normal to me and you, but if you get it filtered through a
quoted printable MUA through whatever means, you'll get it confused as
http://foo.com/foo.php?arg=234.... or
http://foo.com/foo.php?arg=3D3D2343... which is uncool.  (Because
quoted printable uses = as an escape, and =3D is the escape for '='.)
Trust me.  

\_ > aaaaaa two of us!  I knew I should have stayed away from the cloning
\_ > lab photocopier.
\_ 
\_ Is that YOUR face I see when the bathroom mirror is all steamed up? :-)
Yup, just me and Alice on this side of the looking glass.

David