Recently encountered the need to use JS to pass three values to another page, do not let the parameters directly displayed in the URL need to encrypt, how to handle?
Reply content:
Recently encountered the need to use JS to pass three values to another page, do not let the parameters directly displayed in the URL need to encrypt, how to handle?
Common PHP functions urlencode
and urldecode
the. There is also a base64_encode
and base64_decode
, this much used for image encryption. Here is a link, you refer to the following: PHP a few common cryptographic functions
With post?
If you do not want to appear behind the URL, then use the form form of the Post method;
If just want to ' encrypt ' a bit, can encodeuricomponent;
If you just encrypt it, you can decrypt it with base64.encode64 base64.decode64
If you just don't let the passers-by see it,
@ Hit the water's finger licking base64_encode is a better way.
Base64 is just coding, because no one can mental arithmetic decode ...
Consider packing the three values into JSON and then encoding the JSON string with base64.
If it is a jump from a Web service A to another Web service B, a and B want to communicate through this encrypted communication.
Consider the encryption scheme for the enterprise number.
Actually A and B both know a set of keys, and a uses the secret key to encrypt the message, to base64 the process of passing it to B in query.
P.S. Can I spit a notch style=原味
?
Landlord should not let the parameters let others know it? Then the encodeuricomponent and the like must not be, just coding.
Base64 is not strictly a cryptographic bar.
Rsa?