Page 1 of 1

ecrypting a string of text

Posted: Tue Mar 30, 2010 8:58 pm
by jefffan24
Ok so I'm trying to send a get variable (postid) which lets say postid=21.

What I want to be able to do is a way to make postid not distinguishable to a human so that users can not manipulate that number.

So what I would like it to be able to do is turn 21 into something x%sdoij (random gibberish), and then be able to decrypt that so that the next page knows that x%sdoij is equal to 21.


Sorry if this is confusing I can't think of a better way to explain this. I thought about using md5 but I'm not comparing it to anything I'm just trying to pass the variable in the url.

Any help would be greatly appreciated thanks :D

Re: ecrypting a string of text

Posted: Tue Mar 30, 2010 9:21 pm
by Christopher
Search for something like "php javascript encryption" and you will fine some solution. There is RSA encrypt/decrypt code for both PHP and javascript around.

Re: ecrypting a string of text

Posted: Wed Mar 31, 2010 1:35 pm
by tr0gd0rr
Check out php's mcrypt implementation for two-way encryption.