idnits 2.17.1 draft-ietf-lwig-minimal-esp-11.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (24 May 2022) is 701 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- == Outdated reference: A later version (-12) exists of draft-mglt-ipsecme-diet-esp-08 == Outdated reference: A later version (-04) exists of draft-mglt-ipsecme-ikev2-diet-esp-extension-02 Summary: 0 errors (**), 0 flaws (~~), 3 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Light-Weight Implementation Guidance (lwig) D. Migault 3 Internet-Draft Ericsson 4 Intended status: Informational T. Guggemos 5 Expires: 25 November 2022 LMU Munich 6 24 May 2022 8 Minimal IP Encapsulating Security Payload (ESP) 9 draft-ietf-lwig-minimal-esp-11 11 Abstract 13 This document describes the minimal properties that an IP 14 Encapsulating Security Payload (ESP) implementation needs to meet to 15 remain interoperable with the standard RFC4303 ESP. Such a minimal 16 version of ESP is not intended to become a replacement of the RFC 17 4303 ESP. Instead, a minimal implementation is expected to be 18 optimized for constrained environments while remaining interoperable 19 with implementations of RFC 4303 ESP. In addition, this document 20 also provides some considerations for implementing minimal ESP in a 21 constrained environment which includes limiting the number of flash 22 writes, handling frequent wakeup / sleep states, limiting wakeup 23 time, and reducing the use of random generation. 25 This document does not update or modify RFC 4303. It provides a 26 compact description of how to implement the minimal version of that 27 protocol. RFC 4303 remains the authoritative description. 29 Status of This Memo 31 This Internet-Draft is submitted in full conformance with the 32 provisions of BCP 78 and BCP 79. 34 Internet-Drafts are working documents of the Internet Engineering 35 Task Force (IETF). Note that other groups may also distribute 36 working documents as Internet-Drafts. The list of current Internet- 37 Drafts is at https://datatracker.ietf.org/drafts/current/. 39 Internet-Drafts are draft documents valid for a maximum of six months 40 and may be updated, replaced, or obsoleted by other documents at any 41 time. It is inappropriate to use Internet-Drafts as reference 42 material or to cite them other than as "work in progress." 44 This Internet-Draft will expire on 25 November 2022. 46 Copyright Notice 48 Copyright (c) 2022 IETF Trust and the persons identified as the 49 document authors. All rights reserved. 51 This document is subject to BCP 78 and the IETF Trust's Legal 52 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 53 license-info) in effect on the date of publication of this document. 54 Please review these documents carefully, as they describe your rights 55 and restrictions with respect to this document. Code Components 56 extracted from this document must include Revised BSD License text as 57 described in Section 4.e of the Trust Legal Provisions and are 58 provided without warranty as described in the Revised BSD License. 60 Table of Contents 62 1. Requirements notation . . . . . . . . . . . . . . . . . . . . 2 63 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 64 3. Security Parameter Index (SPI) (32 bit) . . . . . . . . . . . 4 65 3.1. Considerations over SPI generation . . . . . . . . . . . 4 66 4. Sequence Number(SN) (32 bit) . . . . . . . . . . . . . . . . 6 67 5. Padding . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 68 6. Next Header (8 bit) and Dummy Packets . . . . . . . . . . . . 9 69 7. ICV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 70 8. Cryptographic Suites . . . . . . . . . . . . . . . . . . . . 10 71 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 11 72 10. Security Considerations . . . . . . . . . . . . . . . . . . . 11 73 11. Privacy Considerations . . . . . . . . . . . . . . . . . . . 12 74 12. Acknowledgment . . . . . . . . . . . . . . . . . . . . . . . 12 75 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 13 76 13.1. Normative References . . . . . . . . . . . . . . . . . . 13 77 13.2. Informative References . . . . . . . . . . . . . . . . . 14 78 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 15 80 1. Requirements notation 82 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 83 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 84 "OPTIONAL" in this document are to be interpreted as described in BCP 85 14 [RFC2119] [RFC8174] when, and only when, they appear in all 86 capitals, as shown here. 88 2. Introduction 90 ESP [RFC4303] is part of the IPsec protocol suite [RFC4301]. IPsec 91 is used to provide confidentiality, data origin authentication, 92 connectionless integrity, an anti-replay service and limited traffic 93 flow confidentiality (TFC) padding. 95 Figure 1 describes an ESP Packet. Currently, ESP is implemented in 96 the kernel of most major multipurpose Operating Systems (OS). ESP is 97 usually implemented with all of its features to fit the multiple 98 purpose usage of these OSes, at the expense of resources and with no 99 considerations for code size. Constrained devices are likely to have 100 their own implementation of ESP optimized and adapted to their 101 specific use, such as limiting the number of flash writes (for each 102 packet or across wake time), handling frequent wakeup and sleep 103 state, limiting wakeup time, and reducing the use of random 104 generation. With the adoption of IPsec by IoT devices with minimal 105 IKEv2 [RFC7815] and ESP Header Compression (EHC) with 106 [I-D.mglt-ipsecme-diet-esp] or 107 [I-D.mglt-ipsecme-ikev2-diet-esp-extension], these ESP 108 implementations MUST remain interoperable with standard ESP 109 implementations. This document describes the minimal properties an 110 ESP implementation needs to meet to remain interoperable with 111 [RFC4303] ESP. In addition, this document also provides advise to 112 implementers for implementing ESP within constrained environments. 113 This document does not update or modify RFC 4303. 115 For each field of the ESP packet represented in Figure 1 this 116 document provides recommendations and guidance for minimal 117 implementations. The primary purpose of Minimal ESP is to remain 118 interoperable with other nodes implementing RFC 4303 ESP, while 119 limiting the standard complexity of the implementation. 121 0 1 2 3 122 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 123 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ---- 124 | Security Parameters Index (SPI) | ^Int. 125 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Cov- 126 | Sequence Number | |ered 127 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ---- 128 | Payload Data* (variable) | | ^ 129 ~ ~ | | 130 | | |Conf. 131 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Cov- 132 | | Padding (0-255 bytes) | |ered* 133 +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | 134 | | Pad Length | Next Header | v v 135 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ------ 136 | Integrity Check Value-ICV (variable) | 137 ~ ~ 138 | | 139 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 141 Figure 1: ESP Packet Description 143 3. Security Parameter Index (SPI) (32 bit) 145 [RFC4303] defines the SPI as a mandatory 32 bits field. 147 The SPI has a local significance to index the Security Association 148 (SA). From [RFC4301] section 4.1, nodes supporting only unicast 149 communications can index their SA using only the SPI. Nodes 150 supporting multicast communications also require to use the IP 151 addresses and thus SA lookup need to be performed using the longest 152 match. 154 For nodes supporting only unicast communications, it is RECOMMENDED 155 indexing the SA using only the SPI. The index may be based on the 156 full 32 bits of SPI or a subset of these bits. The node may require 157 a combination of the SPI as well as other parameters (like the IP 158 address) to index the SA. 160 Values 0-255 MUST NOT be used. As per section 2.1 of [RFC4303], 161 values 1-255 are reserved and 0 is only allowed to be used internally 162 and it MUST NOT be sent over the wire. 164 [RFC4303] does not require the 32 bit SPI to be randomly generated, 165 although that is the RECOMMENDED way to generate SPIs as it provides 166 some privacy and security benefits and avoids correlation between ESP 167 communications. To obtain a usable random 32 bit SPI, the node 168 generates a random 32 bit value and checks it does not fall within 169 the 0-255 range. If the SPI has an acceptable value, it is used to 170 index the inbound session. Otherwise the generated value is 171 discarded and the process repeats until a valid value is found. 173 Some constrained devices are less concerned with the privacy 174 properties associated to randomly generated SPIs. Examples of such 175 devices might include sensors looking to reduce their code 176 complexity. The use of a predictive function to generate the SPI 177 might be preferred over the generation and handling of random values. 178 An implementation of such predictable function could use the 179 combination of a fixed value and the memory address of the SAD 180 structure. For every incoming packet, the node will be able to point 181 to the SAD structure directly from the SPI value. This avoids having 182 a separate and additional binding and lookup function for the SPI to 183 its SAD entry for every incoming packet. 185 3.1. Considerations over SPI generation 187 SPIs that are not randomly generated over 32 bits may have privacy 188 and security concerns. As a result, the use of alternative designs 189 requires careful security and privacy reviews. This section provides 190 some considerations upon the adoption of alternative designs. 192 The SPI value is only looked up for inbound traffic. The SPI 193 negotiated with IKEv2 [RFC7296] or Minimal IKEv2 [RFC7815] by a peer 194 is the value used by the remote peer when it sends traffic. The main 195 advantage of using a rekeying mechanism is to enable a rekey, that is 196 performed by replacing an old SA by a new SA, both indexed with 197 distinct SPIs. As the SPI is only used for inbound traffic by the 198 peer, this allows each peer to manage the set of SPIs used for its 199 inbound traffic. The necessary number of SPI reflects the number of 200 inbound SAs as well as the ability to rekey these SAs. Typically, 201 rekeying a SA is performed by creating a new SA (with a dedicated 202 SPI) before the old SA is deleted. This results in an additional SA 203 and the need to support an additional SPI. Similarly, the privacy 204 concerns associated with the generation of non-random SPIs is also 205 limited to the incoming traffic. 207 Alternatively, some constrained devices will not implement IKEv2 or 208 Minimal IKEv2 and as such will not be able to manage a roll-over 209 between two distinct SAs. In addition, some of these constrained 210 devices are also likely to have a limited number of SAs - likely to 211 be indexed over 3 bytes only for example. One possible way to enable 212 a rekey mechanism with these devices is to use the SPI where for 213 example the first 3 bytes designates the SA while the remaining byte 214 indicates a rekey index. SPI numbers can be used to implement 215 tracking the inbound SAs when rekeying is taking place. When 216 rekeying a SPI, the new SPI could use the SPI bytes to indicate the 217 rekeying index. 219 The use of a small limited set of SPI numbers across communications 220 comes with privacy and security concerns. Some specific values or 221 subset of SPI values could reveal the models or manufacturer of the 222 node implementing ESP. It could also reveal some state such as "not 223 yet rekeyed" or "rekeyed 10 times". If a constrained host uses a 224 very limited or even just one application, the SPI itself could 225 indicate what kind of traffic (eg the kind of application typically 226 running) is transmitted. This could be further correlated by 227 encrypted data size to further leak information to an observer on the 228 network. In addition, use of specific hardcoded SPI numbers could 229 reveal a manufacturer or device version. If updated devices use 230 different SPI numbers, an attacker could locate vulnerable devices by 231 their use of specific SPI numbers. 233 A privacy analysis should consider at least the type of information 234 as well the traffic pattern before deciding whether non-random SPIs 235 are safe to use. Typically temperature sensors, wind sensors, used 236 outdoors may not leak privacy sensitive information and most of its 237 traffic is expected to be outbound traffic. When used indoors, a 238 sensor that reports an encrypted status of a door (closed or opened) 239 every minute, might not leak sensitive information outside the local 240 network. In these examples, the privacy aspect of the information 241 itself might be limited. Being able to determine the version of the 242 sensor to potentially take control of it may also have some limited 243 security consequences. Of course this depends on the context these 244 sensors are being used. If the risks associated to privacy and 245 security are acceptable, a non-randomized SPI can be used. 247 4. Sequence Number(SN) (32 bit) 249 The Sequence Number (SN) in [RFC4303] is a mandatory 32 bits field in 250 the packet. 252 The SN is set by the sender so the receiver can implement anti-replay 253 protection. The SN is derived from any strictly increasing function 254 that guarantees: if packet B is sent after packet A, then SN of 255 packet B is higher than the SN of packet A. 257 Some constrained devices may establish communication with specific 258 devices where it is known whether or not the peer implements anti- 259 replay protection. As per [RFC4303], the sender MUST still implement 260 a strictly increasing function to generate the SN. 262 The RECOMMENDED way for multipurpose ESP implementation is to 263 increment a counter for each packet sent. However, a constrained 264 device may avoid maintaining this context and use another source that 265 is known to always increase. Typically, constrained devices use 266 802.15.4 Time Slotted Channel Hopping (TSCH). This communication is 267 heavily dependent on time. A contrained device can take advantage of 268 this clock mechanism to generate the SN. A lot of IoT devices are in 269 a sleep state most of the time and wake up only to perform a specific 270 operation before going back to sleep. These devices do have separate 271 hardware that allows them to wake up after a certain timeout and 272 typically also timers that start running when the device was booted 273 up, so they might have a concept of time with certain granularity. 274 This requires to store any information in a stable storage - such as 275 flash memory - that can be restored across sleeps. Storing 276 information associated with the SA such as SN requires some read and 277 write operation on a stable storage after each packet is sent as 278 opposed to a SPI number or cryptographic keys that are only written 279 to stable storage at the creation of the SA. Write operations wear 280 out the flash storage. Write operations also slow down the system 281 significantly, as writing to flash is much slower than reading from 282 flash. While these devices have internal clocks or timers that might 283 not be very accurate, these are good enough to guarantee that each 284 time the device wakes up from sleep that their time is greater than 285 what it was before the device went to sleep. Using time for the SN 286 would guarantee a strictly increasing function and avoid storing any 287 additional values or context related to the SN on flash. In addition 288 to the time value, a RAM based counter can be used to ensure that if 289 the device sends multiple packets over an SA within one wake up 290 period, that the serial numbers are still increasing and unique. 291 Note that standard receivers are generally configured with 292 incrementing counters and, if not appropriately configured, the use 293 of a significantly larger SN than the previous packet can result in 294 that packet falling outside of the peer's receiver window which could 295 cause that packet to be discarded. 297 For inbound traffic, it is RECOMMENDED that receivers implement anti- 298 replay protection. The size of the window should depend on the 299 property of the network to deliver packets out of order. In an 300 environment where out of order packets are not possible, the window 301 size can be set to one. An ESP implementation may choose to not 302 implement an anti-replay protection. An implementation of anti- 303 replay protection may require the device to write the received SN for 304 every packet to stable storage. This will have the same issues as 305 discussed earlier with the SN. Some constrained device 306 implementations may choose to not implement the optional anti-replay 307 protection. A typical example might consider an IoT device such as a 308 temperature sensor that is sending a temperature measurement every 60 309 seconds, and that receives an acknowledgment from the receiver. In 310 such cases, the ability to spoof and replay an acknowledgement is of 311 limited interest and might not justify the implementation of an anti- 312 replay mechanism. Receiving peers may also use ESP anti-replay 313 mechanism adapted to a specific application. Typically, when the 314 sending peer is using SN based on time, anti-replay may be 315 implemented by discarding any packets that present a SN whose value 316 is too much in the past. Such mechanisms may consider clock drifting 317 in various ways in addition to acceptable delay induced by the 318 network to avoid the anti replay windows rejecting legitimate 319 packets. It could accept any SN as long as it is higher than the 320 previously received SN. Another mechanism could be used where only 321 the received time on the device is used to consider a packet as 322 valid, without looking at the SN at all. 324 The SN can be represented as a 32 bit number, or as a 64 bit number, 325 known as Extended Sequence Number (ESN). As per [RFC4303], support 326 of ESN is not mandatory and its use is negotiated via IKEv2 327 [RFC7296]. A ESN is used for high speed links to ensure there can be 328 more than 2^32 packets before the SA needs to be rekeyed to prevent 329 the SN from rolling over. This assumes the SN is incremented by 1 330 for each packet. When the SN is incremented differently - such as 331 when time is used - rekeying needs to happen based on how the SN is 332 incremented to prevent the SN from rolling over. The security of all 333 data protected under a given key decreases slightly with each message 334 and a node must ensure the limit is not reached - even though the SN 335 would permit it. Estimation of the maximum number of packets to be 336 sent by a node is not always predicatable and large margins should be 337 used espcially as nodes could be online for much more time than 338 expected. Even for constrained devices, it is RECOMMENDED to 339 implement some rekey mechanisms (see Section 10). 341 5. Padding 343 Padding is required to keep the 32 bit alignment of ESP. It is also 344 required for some encryption transforms that need a specific block 345 size of input, such as ENCR_AES_CBC. ESP specifies padding in the 346 Pad Length byte, followed by up to 255 bytes of padding. 348 Checking the padding structure is not mandatory, so constrained 349 devices may omit these checks on received ESP packets. For outgoing 350 ESP packets, padding must be applied as required by ESP. 352 In some situation the padding bytes may take a fixed value. This 353 would typically be the case when the Data Payload is of fixed size. 355 ESP [RFC4303] additionally provides Traffic Flow Confidentiality 356 (TFC) as a way to perform padding to hide traffic characteristics. 357 TFC is not mandatory and is negotiated with the SA management 358 protocol, such as IKEv2. TFC has been widely implemented but it is 359 not widely deployed for ESP traffic. It is NOT RECOMMENDED to 360 implement TFC for a minimal ESP. 362 As a consequence, communication protection that relies on TFC would 363 be more sensitive to traffic patterns without TFC. This can leak 364 application information as well as the manifacturor or model of the 365 device used to a passive monitoring attacker. Such information can 366 be used, for example, by an attacker in case a vulnerability is known 367 for the specific device or application. In addition, some 368 application use - such as health applications - could leak important 369 privacy oriented information. 371 Constrained devices that have limited battery lifetime may prefer to 372 avoid sending extra padding bytes. In most cases, the payload 373 carried by these devices is quite small, and the standard padding 374 mechanism can be used as an alternative to TFC. Alternatively, any 375 information leak based on the size - or presence - of the packet can 376 also be addressed at the application level, before the packet is 377 encrypted with ESP. If application packets vary between 1 to 30 378 bytes, the application could always send 32 byte responses to ensure 379 all traffic sent is of identical length. To prevent leaking 380 information that a sensor changed state, such as "temperature 381 changed" or "door opened", an application could send this information 382 at regular time interval, rather than when a specific event is 383 happening, even if the sensor state did not change. 385 6. Next Header (8 bit) and Dummy Packets 387 ESP [RFC4303] defines the Next Header as a mandatory 8 bits field in 388 the packet. The Next header, only visible after decryption, 389 specifies the data contained in the payload. In addition, the Next 390 Header may also carry an indication on how to process the packet 391 [I-D.nikander-esp-beet-mode]. The Next Header can point to a dummy 392 packet, i.e. packets with the Next Header value set to 59 meaning "no 393 next header". The data following to "no next header" is unstructured 394 dummy data. 396 The ability to generate and to receive and ignore dummy packets is 397 required by [RFC4303]. An implementation can omit ever generating 398 and sending dummy packets. For interoperability, a minimal ESP 399 implementation MUST be able to process and discard dummy packets 400 without indicating an error. 402 In constrained environments, sending dummy packets may have too much 403 impact on the device lifetime, in which case dummy packets should not 404 be generated and sent. On the other hand, Constrained devices 405 running specific applications that would leak too much information by 406 not generating and sending dummy packets may implement this 407 functionality or even implement something similar at the application 408 layer. Note also that similarly to padding and TFC that can be used 409 to hide some traffic characteristics (see Section 5), dummy packet 410 may also reveal some patterns that can be used to identify the 411 application. For example, an application may send dummy data to hide 412 some traffic pattern. Suppose such such application sends a 1 byte 413 data when a change occurs. This results in sending a packet 414 notifying a change has occurred. Dummy packet may be used to prevent 415 such information to be leaked by sending a 1 byte packet every second 416 when the information is not changed. After an upgrade the data 417 becomes two bytes. At that point, the dummy packets do not hide 418 anything and having 1 byte regularly versus 2 bytes make even the 419 identification of the application, version easier to identify. This 420 generaly makes the use of dummy packets more appropriated on high 421 speed links. 423 In some cases, devices are dedicated to a single application or a 424 single transport protocol, in which case, the Next Header has a fixed 425 value. 427 Specific processing indications have not been standardized yet 428 [I-D.nikander-esp-beet-mode] and is expected to result from an 429 agreement between the peers. As a result, it SHOULD NOT be part of a 430 minimal implementation of ESP. 432 7. ICV 434 The ICV depends on the cryptographic suite used. As detailed in 435 [RFC8221] authentication or authenticated encryption are RECOMMENDED 436 and as such the ICV field must be present with a size different from 437 zero. Its length is defined by the security recommendations only. 439 8. Cryptographic Suites 441 The recommended algorithms to use are expected to evolve over time 442 and implementers SHOULD follow the recommendations provided by 443 [RFC8221] and updates. 445 This section lists some of the criteria that may be considered to 446 select an appropriate cryptographic suite. The list is not expected 447 to be exhaustive and may also evolve over time: 449 1. Security: Security is the criteria that should be considered 450 first for the selection of encryption algorithm transform. The 451 security of encryption algorithm transforms is expected to evolve 452 over time, and it is of primary importance to follow up-to-date 453 security guidance and recommendations. The chosen encryption 454 algorithm MUST NOT be vulnerable or weak (see [RFC8221] for 455 outdated ciphers). ESP can be used to authenticate only 456 (ENCR_NULL) or to encrypt the communication. In the latter case, 457 authenticated encryption (AEAD) is RECOMMENDED [RFC8221]. 459 2. Resilience to nonce re-use: Some transforms -including AES-GCM - 460 are vulnerable to nonce collision with a given key. While the 461 generation of the nonce may prevent such collision during a 462 session, the mechanisms are unlikely to provide such protection 463 across sleep states or reboot. This causes an issue for devices 464 that are configured using static keys (called manual keying) and 465 manual keying should not be used with these encryption 466 algorithms. When the key is likely to be re-used across reboots, 467 algorithms that are nonce misuse resistant such as, for example, 468 AES-SIV [RFC5297], AES-GCM-SIV [RFC8452] or Deoxys-II [DeoxysII] 469 are RECOMMENDED. Note however that currently none of these are 470 yet defined for use with ESP. 472 3. Interoperability: constrained devices usually only implement one 473 or very few different encryption algorithm transforms. [RFC8221] 474 takes the life cycle of encryption algorithm transforms and 475 device manufactoring into consideration in its recommendations 476 for mandatory-to-implement ("MTI") algorithms. 478 4. Power Consumption and Cipher Suite Complexity: Complexity of the 479 encryption algorithm transform and the energy cost associated 480 with it are especially important considerations for devices that 481 have limited resources or are battery powered. The battery life 482 might determine the lifetime of the entire device. The choice of 483 a cryptographic function should consider re-using specific 484 libraries or to take advantage of hardware acceleration provided 485 by the device. For example, if the device benefits from AES 486 hardware modules and uses ENCR_AES_CTR, it may prefer AUTH_AES- 487 XCBC for its authentication. In addition, some devices may also 488 embed radio modules with hardware acceleration for AES-CCM, in 489 which case, this transform may be preferred. 491 5. Power Consumption and Bandwidth Consumption: Reducing the payload 492 sent may significantly reduce the energy consumption of the 493 device. Encryption algorithm transforms with low overhead are 494 strongly preferred. To reduce the overall payload size one may, 495 for example: 497 1. Use of counter-based ciphers without fixed block length (e.g. 498 AES-CTR, or ChaCha20-Poly1305). 500 2. Use of ciphers with capability of using implicit IVs 501 [RFC8750]. 503 3. Use of ciphers recommended for IoT [RFC8221]. 505 4. Avoid Padding by sending payload data which are aligned to 506 the cipher block length - 2 for the ESP trailer. 508 9. IANA Considerations 510 There are no IANA consideration for this document. 512 10. Security Considerations 514 Security Considerations are those of [RFC4303]. In addition, this 515 document provided security recommendations and guidance over the 516 implementation choices for each ESP field. 518 The security of a communication provided by ESP is closely related to 519 the security associated with the management of that key. This 520 usually includes mechanisms to prevent a nonce from repeating, for 521 example. When a node is provisioned with a session key that is used 522 across reboot, the implementer MUST ensure that the mechanisms put in 523 place remain valid across reboot as well. 525 It is RECOMMENDED to use ESP in conjunction with key management 526 protocols such as for example IKEv2 [RFC7296] or minimal IKEv2 527 [RFC7815]. Such mechanisms are responsible for negotiating fresh 528 session keys as well as prevent a session key being use beyond its 529 lifetime. When such mechanisms cannot be implemented, such as when 530 the the session key is provisioned, the device MUST ensure that keys 531 are not used beyond their lifetime and that the the key remains used 532 in compliance will all security requirements across reboots - e.g. 533 conditions on counters and nonces remains valid. 535 When a device generates its own key or when random value such as 536 nonces are generated, the random generation MUST follow [RFC4086]. 537 In addition, [SP-800-90A-Rev-1] provides guidance on how to build 538 random generators based on deterministic random functions. 540 11. Privacy Considerations 542 Preventing the leakage of privacy sensitive information is a hard 543 problem to solve and usually result in balancing the information 544 potentially being leaked to the cost associated with the counter 545 measures. This problem is not inherent to the minimal ESP described 546 in this document and also concerns the use of ESP in general. 548 This document targets minimal implementations of ESP and as such 549 describes some minimalistic way to implement ESP. In some cases, 550 this may result in potentially revealing privacy sensitive pieces of 551 information. This document describes these privacy implications so 552 the implementer can take the appropriate decisions given the 553 specificities of a given environment and deployment. 555 The main risks associated with privacy is the ability to identify an 556 application or a device by analyzing the traffic which is designated 557 as traffic shaping. As discussed in Section 3, the use in some very 558 specific context of non randomly generated SPI might in some cases 559 ease the determination of the device or the application. Similarly, 560 padding provides limited capabilities to obfuscate the traffic 561 compared to those provided by TFC. Such consequence on privacy as 562 detailed in Section 5. 564 12. Acknowledgment 566 The authors would like to thank Daniel Palomares, Scott Fluhrer, Tero 567 Kivinen, Valery Smyslov, Yoav Nir, Michael Richardson, Thomas Peyrin, 568 Eric Thormarker, Nancy Cam-Winget and Bob Briscoe for their valuable 569 comments. In particular Scott Fluhrer suggested including the rekey 570 index in the SPI. Tero Kivinen also provided multiple clarifications 571 and examples of deployment ESP within constrained devices with their 572 associated optimizations. Thomas Peyrin Eric Thormarker and Scott 573 Fluhrer suggested and clarified the use of transform resilient to 574 nonce misuse. 576 13. References 578 13.1. Normative References 580 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 581 Requirement Levels", BCP 14, RFC 2119, 582 DOI 10.17487/RFC2119, March 1997, 583 . 585 [RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker, 586 "Randomness Requirements for Security", BCP 106, RFC 4086, 587 DOI 10.17487/RFC4086, June 2005, 588 . 590 [RFC4301] Kent, S. and K. Seo, "Security Architecture for the 591 Internet Protocol", RFC 4301, DOI 10.17487/RFC4301, 592 December 2005, . 594 [RFC4303] Kent, S., "IP Encapsulating Security Payload (ESP)", 595 RFC 4303, DOI 10.17487/RFC4303, December 2005, 596 . 598 [RFC7296] Kaufman, C., Hoffman, P., Nir, Y., Eronen, P., and T. 599 Kivinen, "Internet Key Exchange Protocol Version 2 600 (IKEv2)", STD 79, RFC 7296, DOI 10.17487/RFC7296, October 601 2014, . 603 [RFC7815] Kivinen, T., "Minimal Internet Key Exchange Version 2 604 (IKEv2) Initiator Implementation", RFC 7815, 605 DOI 10.17487/RFC7815, March 2016, 606 . 608 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 609 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 610 May 2017, . 612 [RFC8221] Wouters, P., Migault, D., Mattsson, J., Nir, Y., and T. 613 Kivinen, "Cryptographic Algorithm Implementation 614 Requirements and Usage Guidance for Encapsulating Security 615 Payload (ESP) and Authentication Header (AH)", RFC 8221, 616 DOI 10.17487/RFC8221, October 2017, 617 . 619 [RFC8750] Migault, D., Guggemos, T., and Y. Nir, "Implicit 620 Initialization Vector (IV) for Counter-Based Ciphers in 621 Encapsulating Security Payload (ESP)", RFC 8750, 622 DOI 10.17487/RFC8750, March 2020, 623 . 625 13.2. Informative References 627 [DeoxysII] Jeremy, J. J., Ivica, I. N., Thomas, T. P., and Y. S. 628 Yannick, "Deoxys v1.41", October 2016, 629 . 631 [I-D.mglt-ipsecme-diet-esp] 632 Migault, D., Guggemos, T., Bormann, C., and D. Schinazi, 633 "ESP Header Compression and Diet-ESP", Work in Progress, 634 Internet-Draft, draft-mglt-ipsecme-diet-esp-08, 13 May 635 2022, . 638 [I-D.mglt-ipsecme-ikev2-diet-esp-extension] 639 Migault, D., Guggemos, T., and D. Schinazi, "Internet Key 640 Exchange version 2 (IKEv2) extension for the ESP Header 641 Compression (EHC) Strategy", Work in Progress, Internet- 642 Draft, draft-mglt-ipsecme-ikev2-diet-esp-extension-02, 13 643 May 2022, . 646 [I-D.nikander-esp-beet-mode] 647 Nikander, P. and J. Melen, "A Bound End-to-End Tunnel 648 (BEET) mode for ESP", Work in Progress, Internet-Draft, 649 draft-nikander-esp-beet-mode-09, 5 August 2008, 650 . 653 [RFC5297] Harkins, D., "Synthetic Initialization Vector (SIV) 654 Authenticated Encryption Using the Advanced Encryption 655 Standard (AES)", RFC 5297, DOI 10.17487/RFC5297, October 656 2008, . 658 [RFC8452] Gueron, S., Langley, A., and Y. Lindell, "AES-GCM-SIV: 659 Nonce Misuse-Resistant Authenticated Encryption", 660 RFC 8452, DOI 10.17487/RFC8452, April 2019, 661 . 663 [SP-800-90A-Rev-1] 664 Elain, E. B. and J. K. Kelsey, "Recommendation for Random 665 Number Generation Using Deterministic Random Bit 666 Generators", . 669 Authors' Addresses 671 Daniel Migault 672 Ericsson 673 8400 boulevard Decarie 674 Montreal, QC H4P 2N2 675 Canada 676 Email: daniel.migault@ericsson.com 678 Tobias Guggemos 679 LMU Munich 680 MNM-Team 681 Oettingenstr. 67 682 80538 Munich 683 Germany 684 Email: guggemos@mnm-team.org