file

Message encryption transmission

This article describes how to further improve your relationship with Message Service MNS Security on the network link between services.

background information

Message Service MNS Provide the service of message encryption transmission on the public network HTTPS. For messages containing sensitive information, to further improve the security of the network link between you and Alibaba Cloud services, there are currently two solutions:

  • Message Service MNS The domain name of the HTTPS service is provided. You can select the HTTPS service address.

  • Encrypt the transmitted message body at the client to prevent theft.

matters needing attention

  • Encrypting and decrypting messages will have some impact on performance.

  • Please do not send non encrypted messages to the encrypted queue.

Solution

The following are Message Service MNS A solution for encrypted transmission of messages.

  1. Encrypt the message at the sending end before sending it.

  2. The message is decrypted at the message receiving end, and then consumed.

Sample code: SecurityQueue.zip , where:

  • SeurityQueue.java provide putMessage popMessage and deleteMessage Interface. The interface description is as follows:

    • putMessage Before sending a message to the server, encrypt the message body according to the specified key and encryption algorithm.

    • popMessage After receiving the server side message, first decrypt it in the specified way, and then return the decrypted message body.

  • SecurityKeyGenerator.java Used to generate encryption and decryption required secretKey

  • SecurityQueueDemo.java The Demo program that provides how to use the SecurityQueue.

For more information, see ReadMe.txt

  • Introduction to this page (1)