MANET Cryptographical Signature TLV DefinitionLIX, Ecole Polytechnique91128 Palaiseau CedexFrance+33-1-6933-4126ulrich@herberg.namehttp://www.herberg.name/LIX, Ecole Polytechnique91128 Palaiseau CedexFrance+33 6 6058 9349T.Clausen@computer.orghttp://www.thomasclausen.org/Mobile Ad hoc Networking (MANET)MANET
This document describes a general and flexible TLV (type-length-value structure) for representing cryptographic signatures as well as timestamps, using the generalized MANET packet/message format . It defines two Message TLVs and two Packet TLVs, for affixing a cryptographic signature and a timestamp to a packet and message, respectively.
This document:
specifies two TLVs for carrying cryptographic signatures and timestamps in packets and messages as defined by ,
requests IANA allocations for these Packet and Message TLVs from
the 0-127 Message TLV range and the 0-223 Packet TLV range from ,
describes how cryptographic signatures are calculated, taking into account the mutable message header fields (<msg-hop-limit> and <msg-hop-count>) for messages where these fields are present,
requests creation of two IANA registries for recording code points for hash function and signature calculation, respectively.
This document does not stipulate how to sign, validate, or encrypt messages. A specification of a routing protocol or routing protocol extension, using the security representation of this document, MUST specify appropriate interpretation of the TLVs. This document does specifically not suggest specific cryptographic algorithms or hash functions, but rather establishes IANA registries for such.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in
.
This document uses the terminology and notation defined in . Additionally, it defines the following terminology:
Hash-Function
A hash function is an algorithm that takes a message of any length as input and produces a fixed-length string as output. Hash functions are used in cryptography for authentication and message integrity.Signature:
An electronic signature authenticates the signer (who often is the originator) of a message. In addition, it can be verified whether the message has been changed after it has been signed. In many cases, a signature is calculated by encrypting a hash of a message, whis is the basic assumption of this document.Timestamp
The timestamp indicates the time when the timestamp has been created. If a timestamp is added to a message before signing the message, this information can be useful to determine the "freshness" of the signed message. "Old" messages can indicate replayed messages.
The packet and message format defined in accords MANET routing protocols using this format the ability to carry additional information in control messages, through inclusion of TLVs. Information so included in a control message MAY be used by the routing protocol, or an extension of the routing protocol, according to its specification.
This document specifies how to include a cryptographic signature for a packet or message by way of TLVs, as specified in [RFC5444]. This document also specifies how to treat "mutable" fields (<msg-hop- count> and <msg-hop-limit>) in the message header when calculating the signature, such that the resulting signature can be correctly verified by any recipient, and how to include this signature. A MANET routing protocol, or an extension of a MANET routing protocol, MAY use such included cryptographic signatures for, for example, rejecting messages where signature verification fails.
Basic MANET routing protocol specifications are often "oblivious to security", however have a clause allowing a control message to be rejected as "badly formed" prior to it being processed or forwarded. Protocols such as recognize external reasons (such as failure to verify a signature) as being reasons for rejecting a message as "badly formed" and therefore "invalid for processing". This architecture is a result of the observation that with respect to security in MANETs, "one size rarely fits all" and that MANET routing protocol deployment domains have varying security requirements ranging from "unbreakable" to "virtually none". The virtue of this approach is that MANET routing protocol specifications (and implementations) can remain "generic", with extensions providing proper deployment-domain specific security mechanisms.
The MANET routing protocol "security architecture", in which this specification situates itself, can therefore be summarized as follows:
Security-oblivious MANET routing protocol specification, with a clause allowing an extension to reject a message (prior to processing/forwarding) as "badly formed".
MANET routing protocol security extensions, rejecting messages as "badly formed", as appropriate for a given deployment-domain.
Code-points and an exchange format for information necessary for specification of such security extensions.
This document addresses the last of these issues, by specifying a common exchange format for cryptographic signatures. This document also makes reservations from within the Message TLV and Packet TLV registries of , to be used (and shared) among MANET routing protocol security extensions. Finally, this document establishes two IANA registries for code-points for hash functions and cryptographic functions for use by protocols adhering to .
With respect to , this document:
is intended to be used in the non-normative but intended mode of use of as described in its Appendix B.is a specific example of the Security Considerations section of (the authentication part).
This specification does not describe a protocol, nor does it mandate specific router or protocol behavior. It represents a purely syntactical representation of security related information for use with messages and packets, as well as sets up IANA registrations and registries.
The following data structure allows the representation of a cryptographic signature, including specification of the appropriate hash function and cryptographic algorithm used for calculating the signature. This <signature> data structure is specified, using the regular expression syntax of , as:
where:
is an 8-bit unsigned integer field specifying the hash function according to .
is an 8-bit unsigned integer field specifying the cryptographic function according to .
is an unsigned integer field, whose length is <tlv-length>-2, and which contains the cryptographic signature.
The basic version of this TLV assumes that calculating the signature can be decomposed into:
signature-value = cryptographic-function(hash-function(message))
with cryptographic-function and hash-function being selected from and respectively (where either of them can be the identity function -- indicated by "none" in the registry).
The type extension 0 is assumed to indicate this decomposition. Otherwise, if a signature is not decomposable in that way, the type extension field can be used for indication how signatures are to be calculated.
The algorithm that is used for calculating the hash function is selected from one of those listed in . Furthermore, <hash-function> corresponds to the number in that table assigned by IANA.The algorithm that is used for calculating the cryptographic algorithm is selected from one of those listed in . Furthermore, <cryptographic-algorithm> corresponds to the number in that table assigned by IANA. If the selected hash function is "none" (0), the cryptographic function SHOULD NOT be "none" (0).
The rationale for separating the hash function and the cryptographic function into two octets instead of having all combinations in a single octet -- possibly as TLV type extension -- is twofold:
First, if further hash or cryptographic functions are added in the future, the number space might not be continuous any more. More importantly, the number space of 256 possible combinations is rapidly exhausted. For example, having only 16 different hash functions and 16 different cryptographic functions would lead to exhaustion. As new or improved cryptographic mechanism are continuously being developed and introduced, this format should be able to accommodate such for the foreseeable future.
The rationale for not including a field that lists parameters of the cryptographic signature in the TLV is the following: Before being able to to validate a cryptographic signature, routers have to exchange keys (e.g. public keys). Any additional parameters can be exchanged together with the keys in this bootstrap process. It is therefore not necessary, and would even entail an extra overhead, to transmit the parameters within every message.
One inherently included parameter is the length of the signature, which is tlv-length - 2 and which depends on the choice of the cryptographic function.
The following data structure allows the representation of a timestamp. This <timestamp> data structure is specified as:
where:
is an unsigned integer field, whose length is <tlv-length>, and which contains the timestamp. The value of this variable is to be interpreted by the routing protocol as specified by the type extension of the Timestamp TLV (refer to ).
A timestamp is essentially "freshness information". As such, its setting and interpretation is to be determined by the routing protocol (or the extension to a routing protocol) that uses it, and may e.g. correspond to a UNIX-timestamp, GPS timestamp or a simple sequence number. This is out of the scope of this specification.
Two Message TLVs are defined, for including the cryptographic signature of a message, and for including the timestamp indicating the time at which the cryptographic signature was calculated.
A Message SIGNATURE TLV is an example of a SIGNATURE TLV as described in . When determining the <signature-value> for a message, the signature is calculated over the entire message with the following considerations:
the fields <msg-hop-limit> and <msg-hop-count> MUST be both assumed to have the value 0 (zero).
all Message SIGNATURE TLVs MUST be removed before calculating the signature, and the message size as well as the Message TLV block size MUST be recalculated accordingly. The TLVs can be restored after having calculated the signature value.
A Message TIMESTAMP TLV is an example of a TIMESTAMP TLV as described in . If a message contains a TIMESTAMP TLV and a SIGNATURE TLV, the TIMESTAMP TLV SHOULD be added first to the message, in order to include it in the calculation of the signature.
Two Packet TLVs are defined, for including the cryptographic signature of a packet, and for including the timestamp indicating the time at which the cryptographic signature was calculated.
A Packet SIGNATURE TLV is an example of a SIGNATURE TLV as described in . When calculating the <signature-value> for a Packet, the signature is calculated over the entire Packet, including the packet header, all Packet TLVs (other than Packet SIGNATURE TLVs) and all included Messages and their message headers.
A Packet TIMESTAMP TLV is an example of a TIMESTAMP TLV as described in .
This specification defines two Message TLV types which must be allocated from the 0-127 range of the "Assigned Message TLV Types" repository of as specified in and two Packet TLV types which must be allocated from the 0-223 range of the "Assigned Packet TLV Types" repository of as specified in .
IANA is requested to assign the same numerical value to the Message
TLV and Packet TLV types with the same name.
For the registries for TLV type extensions where an Expert Review is required, the designated expert SHOULD take the same general recommendations into consideration as are specified by
.
The Message TLVs as specified in must be allocated from the "Message TLV Types" namespace of .NameTypeType ExtensionDescriptionSIGNATURETBD10Signature of a message1-223Expert Review224-255Experimental UseTIMESTAMPTBD20Unsigned timestamp of arbitrary length, given by the tlv-length field. The timestamp is assumed to increase strictly monotonously by steps of 1. The MANET routing protocol has to define how to interpret this timestamp1Unsigned 32-bit timestamp as specified in 2NTP timestamp format as defined in 3Signed timestamp of arbitrary length with no constraints such as monotonicity. In particular, it may represent any random value4-223Expert Review224-255Experimental Use
The Packet TLVs as specified in must be allocated from the "Packet TLV Types" namespace of .NameTypeType ExtensionDescriptionSIGNATURETBD30Signature of a packet1-223Expert Review224-255Experimental UseTIMESTAMPTBD40Unsigned timestamp of arbitrary length, given by the tlv-length field. The timestamp is assumed to increase strictly monotonously by steps of 1. The MANET routing protocol has to define how to interpret this timestamp1Unsigned 32-bit timestamp as specified in 2NTP timestamp format as defined in 3Signed timestamp of arbitrary length with no constraints such as monotonicity. In particular, it may represent any random value4-223Expert Review224-255Experimental Use
This document specifies some values where IANA registries are required.
For the registries for the following tables where an Expert Review is required, the designated expert SHOULD take the same general recommendations into consideration as are specified by .
IANA is requested to create a new registry for the hash functions that can be used when creating a signature. The initial assignments and allocation policies are specified in .
Hash function valueAlgorithmDescription0noneThe "identity function": the hash value of a message is the message itself1MD5The hash function as specified in 2SHA1The hash function as specified in 3SHA256The hash function as specified in 4-223Expert Review224-255Experimental Use
IANA is requested to create a new registry for the cryptographic function. Initial assignments and allocation policies are specified in .
Cryptographic algorithm valueAlgorithmDescription0noneThe "identity function": the value of an encrypted hash is the hash itself1RSARSA as specified in 2DSADSA as specified in 3HMACHMAC as specified in 43DES3DES as specified in 5AESAES as specified in 6-223Expert Review224-255Experimental Use
This document does not specify a protocol itself. However, it provides a syntactical component for cryptographic signatures of messages and packets as defined in . It can be used to address security issues of a protocol or extension that uses the component specified in this document. As such, it has the same security considerations as .In addition, a protocol that includes this component MUST specify the usage as well as the security that is attained by the cryptographic signatures of a message or a packet.As an example, a routing protocol that uses this component to reject "badly formed" messages if a control message does not contain a valid signature, should indicate the security assumption that if the signature is valid, the message is considered valid. It also should indicate the security issues that are counteracted by this measure (e.g. link or identity spoofing) as well as the issues that are not counteracted (e.g. compromised keys).
The authors would like to thank Jerome Milan (Ecole Polytechnique) for his advice as cryptographer. In addition, many thanks to Alan Cullen (BAE), Justin Dean (NRL), Christopher Dearlove (BAE), and Henning Rogge (FGAN) for their constructive comments on the document.Key words for use in RFCs to Indicate Requirement LevelsHarvard UniversityGeneralized MANET Packet/Message FormatEcole Polytechnique, FranceBAE Systems Advanced Technology Centre, UKNaval Research Laboratory, USAINRIA RocquencourtThe MD5 Message-Digest AlgorithmMassachusetts Institute of Technology, (MIT) Laboratory for Computer ScienceUS Secure Hash Algorithm 1 (SHA1)Simple Network Time Protocol (SNTP) Version 4 for IPv4, IPv6 and OSIMANET Neighborhood Discovery Protocol (NHDP)Ecole Polytechnique, FranceNaval Research Laboratory, USABAE Systems Advanced Technology Centre, UKPKCS #1: RSA Cryptography Specifications Version 2.0RSA Laboratories EastRSA Laboratories WestHMAC: Keyed-Hashing for Message AuthenticationAdvanced Encryption Standard (AES)Digital Signature StandardTriple Data Encryption Algorithm Modes of OperationSecure Hash Algorithm1003.1-2008 Standard for Information Technology - Portable Operating System Interface (POSIX)
The sample message depicted in is taken from the appendix of . However, a SIGNATURE Message TLV has been added. It is assumed that the SIGNATURE TLV type is lesser than the TLV type of the second message TLV (i.e. it comes first in the order of Message TLVs). The TLV value represents a 16 octet long signature of the whole message.