Forum Moderators: coopster

Message Too Old, No Replies

encryption key using a numeric timestamp?

         

neophyte

10:42 am on Feb 22, 2008 (gmt 0)

10+ Year Member



Hello All -

I'm interested in the possibility of encrypting a string using a typical php function (such as, perhaps, base64_encode) which could then be decoded if someone had a particular key... like maybe the randomly generated numeric string returned from time().

So, say, you've got:

1. A form that requires someone's full name.
2. When the form is submitted, this person's name is scrambled with the combination of a php function and a randomly generated string - like perhaps the result from time().
3. Then an email is sent containing the scrambled name and same return value of time() which was used during the encryption process.
4. The person on the receiving end of the email would then plug the encrypted name and the "key" into another module which would then decrypt and output the scrambled name.

This is just a bit of a curiosity for me (I always use MD5 for sensitive stuff like passwords and such) and I find myself interested in seeing what the possibilities are.

If anyone else has done something like this, could you please guide me as to how I may approach this challenge?

Thanks, as always, to all in advance.

Neophyte

le_gber

3:46 pm on Feb 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I always use MD5 for sensitive stuff like passwords and such

Do you use straight MD5 Hash or do you Salted MD5 Hash? Straight MD5 has been found not too be as secure as people thought and can be reverse engineered.

whoisgregg

4:24 pm on Feb 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Take a look at the mcrypt functions [php.net]. You can definitely accomplish what you've described. :)