Encrypting message transmission

Updated at:

This topic describes how to secure network connections to the Simple Message Queue (formerly MNS) service.

Background information

Simple Message Queue (formerly MNS) lets you transmit encrypted messages over the public network using HTTPS. For messages that contain sensitive information, use one of the following solutions to further secure your network connections:

  • Use an HTTPS endpoint. Simple Message Queue (formerly MNS) provides domain names for the HTTPS service.

  • Encrypt the message body on the client to prevent interception.

Notes

  • Encrypting and decrypting messages can affect performance.

  • Do not send unencrypted messages to an encrypted queue.

Solutions

Simple Message Queue (formerly MNS) provides the following solution to encrypt messages during transmission.

  1. The sender encrypts the message before sending it.

  2. The receiver decrypts the message before consuming it.

Sample code: SecurityQueue.zip. This package contains the following files:

  • SecurityQueue.java provides the putMessage, popMessage, and deleteMessage interfaces. These interfaces work as follows:

    • putMessage encrypts the message body using a specified key and encryption algorithm before sending the message to the server.

    • popMessage decrypts the message after receiving it from the server and returns the decrypted message body.

  • SecurityKeyGenerator.java generates the secretKey required for encryption and decryption.

  • SecurityQueueDemo.java is a demo program that shows how to use SecurityQueue.

For more information, see ReadMe.txt.