The invention provides a method for preventing an H5 page in an APP from being attacked by a man-in-the-middle, and the specific operation steps of the method are as follows: step 1, a
client prepares request data, step 2, the
client encrypts the data, and the
client encrypts the data, step 3, the client generates a signature, step 4, the client sends an
encryption request, step 5, a
server verifies the signature, and step 6, the
server verifies the signature. The method comprises the following steps: step 1, a client receives response data, step 2, a
server decrypts the data, step 7, the server processes the data, step 8, the server generates a response, step 9, the server sends an encrypted response, step 10, the client receives the response data, step 11, the client verifies a signature, step 12, the client decrypts the response data, and step 13, the client completes
data processing. According to the method, the risk of data leakage and tampering caused by the fact that the data is attacked by a man-in-the-middle can be effectively reduced, frequent
certificate replacement of the client is avoided, security vulnerabilities possibly caused by improper implementation are reduced, the risk of service interruption caused by configuration errors is reduced, and the complexity of operation and maintenance is reduced.