Recently receive the wings to pay for the docking work of the payment interface, the wing payment uses the Public network HTTP protocol Exchange. In the docking function involves the verification of the bank card, recharge, withdrawal function. The use of HTTP protocol in public network is bound to involve encryption, decoding work. These encryption, decryption scenarios are now analyzed.
Scenario 1: Verification of the bank card. Through the wing Payment Fast authentication interface, the merchant can verify the user's bank card, the account name, the social security number, the bank card reserved mobile phone number This four elements information.
Prerequisites: We know the public key of the wing payment end, the wing pays to know our public key.
1-Encrypt the plaintext.
In the clear text transmission process The bank card, the user name, the social security number, the bank card to reserve the mobile phone number these are need to do the encryption. Then use the AES symmetric encryption method. Use AES to encrypt your bank card, account name, ID number, and bank card reservation number. So wing payment how to know the symmetric encryption key of AES ... Then we need to tell the wing to pay in the message.
2-Pass the key.
In the Aesencodedkey field, tell the wing to pay for the encrypted key in our AES. However, Aesencodedkey can not be transmitted in plaintext. Through asymmetric encryption, the public key of the wing payment is encrypted, the RSA algorithm is used to encrypt the transmission, and the wing payment is decrypted by its private key.
3-Digital signature.
In the transmission process, if the message is signed. Then use the RSA algorithm as the signature algorithm. Using our private key for signature, wing payment is decrypted using our public key.
In the public network, the symmetric encryption Algorithm (AES) Asymmetric Encryption Algorithm (RSA) and the signature algorithm (RSA private key encryption) are used to ensure that our message is kept secret.