开发者

How should I transfer variables/ parameters securely between multiple domains in PHP?

I would like to securely transfer sensitive variables between multiple in PHP. Normally I would use url parameters or session cookies to transfer non-sensitive values. I'm not sure how secure I can make cookies and url params or if there is a better option o开发者_如何学Cut there?


If you need good security, you can serialize() your parameters into a string, and AES encrypt the string on the origin server with mcrypt(), wrapped in base 64 encoding with base64_encode(). Pass the encrypted, encoded data to the other server as a single URL parameter where it can be decrypted using the AES shared key and parsed back to individual variables with unserialize().

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜