I have a string, this string needs to be Encoded using PHP. Then its sent to a site via GET and needs to be decoded on this site via Javascript.
Its totally ok that somebody can decode the string, but I need that nobody is able to generate a new encoded string.
Basically, everybody should be able to decode the string without any problems, but nobody should be able to encode a new string.
Lets make a example for explanation:
My string is "hello world" and encrypt it SOMEHOW and get "asdflpausoiwjuh" as result. Then I send this result to you guys and you know how to decrypt it to read the message. but nobody of you is able to make a new message that can be encrypted in the same way.
MUST:
- Encrypted with PHP
- Decrypted with Javascript
- Lenght of the string before and after encryption must remain the same OR still guarantee a pretty short string that can be passed via GET to a page.
- I must be the only one able to generate messages that are encrypted in this way.
EDIT: The encrypted text has a validity of about an hour and tehre will actually not be real interest to "crack" the system. so security is not my priority. what i really need is that 99% of the people wont be able to generate the string, and the 1% should have a hard time figuring out how to do it. for me that is safe enough. my problem is that whatever i think of putting into the javascript code, brings me to something that can be reverse engeneered.