Home >Backend Development >PHP Tutorial >API interface symmetric encryption and decryption function issues
I wrote an encryption function and the corresponding decryption function in PHP. When PHP calls the PHP interface, there is no problem. But when the front-end ajax calls my PHP interface, the ajax parameters cannot be encrypted because the front-end cannot use PHP at all. function, should I use js to rewrite my PHP encryption function? Even if you write it out, it is not safe for the js source code to be exposed to the outside. Do you have any good methods? Is there a solution that allows both ajax and PHP to make authorization calls?
I wrote an encryption function and the corresponding decryption function in PHP. When PHP calls the PHP interface, there is no problem. But when the front-end ajax calls my PHP interface, the ajax parameters cannot be encrypted because the front-end cannot use PHP at all. function, should I use js to rewrite my PHP encryption function? Even if you write it out, it is not safe for the js source code to be exposed to the outside. Do you have any good methods? Is there a solution that allows both ajax and PHP to call authorization calls?
Search for Diffie-Hellman key exchange algorithm