ecrypting a string of text

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jefffan24
Forum Commoner
Posts: 72
Joined: Mon Nov 02, 2009 8:18 am

ecrypting a string of text

Post 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
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: ecrypting a string of text

Post 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.
(#10850)
User avatar
tr0gd0rr
Forum Contributor
Posts: 305
Joined: Thu May 11, 2006 8:58 pm
Location: Utah, USA

Re: ecrypting a string of text

Post by tr0gd0rr »

Check out php's mcrypt implementation for two-way encryption.
Post Reply