Skip to main content

Standard Message Format

Every HEMP message is put in the general form shown in Figure 1.

                    +-------------------------------+
: leader :
+-------------------------------+
: encryption section :
+-------------------------------+
: reply encryption section :
+-------------------------------+
: authentication section :
+-------------------------------+
: common header :
+-------------------------------+
: data :
+-------------------------------+

Figure 1: General Form of HEMP Messages

Each message has five components: (1) the leader, which is simply the ASN.1 tag and message length; (2) the encryption section, which provides whatever information the receiver may require to decrypt the message; (3) the reply encryption section, in which the requesting application may specify the type of encryption to use in the reply; (4) the authentication section, which allows the receiver to authenticate the message; (5) the common header, which identifies the message type, the HEMP version, and the message id; and (6) the data section. All four sections following the leader are also ASN.1 encoded. The ASN.1 format of the message is shown in Figure 2.

         HempMessage ::= [0] IMPLICIT SEQUENCE {
[0] IMPLICIT EncryptSection OPTIONAL,
[1] IMPLICIT ReplyEncryptSection OPTIONAL,
[2] IMPLICIT AuthenticateSection OPTIONAL,
[3] IMPLICIT CommonHeader,
[4] IMPLICIT Data }

Figure 2: ASN.1 Format of HEMP Messages

The ordering of the sections is significant. The encryption section comes first so that all succeeding sections (which may contain sensitive information) may be encrypted. The authentication section precedes the header so that messages which fail authentication can be discarded without header processing.