php - The result of $_GET is getting corrupted -


i working on password system, email sent , have click on link go page password reset.

there information in link encrypted, , supposedly de-encrypted on other side. here example http://www.somewebpage.com?p=8e428904890e31a93c563e1f18c11ff6&c=u2fsdgvkx1+ldnfkzczxragpyya9mgzahauh/wlj3t4=

now use $_get['c'] encrypted data. decrypt using decrypt code.

now here problem if works

decrypt($key,"u2fsdgvkx1+ldnfkzczxragpyya9mgzahauh/wlj3t4="); 

and gives me original text.

but if this. doesn't work

decrypt($key,$_get['c']); 

it gives me mangled characters.

the question why doesn't encrypt routine work when user $_get['c'] , works if put string in directly.

is web url adding hidden characters or something? if can strip added.

the encrypt data contain character not pass through browser correctly.

when generate key try use function urlencode()

echo '<a href="mycgi?foo=', urlencode($encryptdata), '">'; 

Comments

Popular posts from this blog

serialization - Convert Any type in scala to Array[Byte] and back -

matplotlib support failed in PyCharm on OSX -

python - Matplotlib: TypeError: 'AxesSubplot' object is not callable -