idnits 2.17.1 draft-ietf-dtn-bpsec-default-sc-07.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 (May 17, 2021) is 1074 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Looks like a reference, but probably isn't: '0' on line 1996 -- Looks like a reference, but probably isn't: '40' on line 1452 -- Looks like a reference, but probably isn't: '1' on line 2240 -- Looks like a reference, but probably isn't: '7' on line 2247 -- Looks like a reference, but probably isn't: '3' on line 2246 -- Looks like a reference, but probably isn't: '2' on line 2246 -- Looks like a reference, but probably isn't: '4' on line 2247 -- Looks like a reference, but probably isn't: '5' on line 1915 -- Looks like a reference, but probably isn't: '6' on line 2160 -- Possible downref: Non-RFC (?) normative reference: ref. 'AES-GCM' -- Possible downref: Non-RFC (?) normative reference: ref. 'AES-KW' -- Possible downref: Non-RFC (?) normative reference: ref. 'HMAC' ** Obsolete normative reference: RFC 8152 (Obsoleted by RFC 9052, RFC 9053) -- Possible downref: Non-RFC (?) normative reference: ref. 'SHS' Summary: 1 error (**), 0 flaws (~~), 1 warning (==), 14 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Delay-Tolerant Networking E. Birrane 3 Internet-Draft A. White 4 Intended status: Standards Track S. Heiner 5 Expires: November 18, 2021 JHU/APL 6 May 17, 2021 8 BPSec Default Security Contexts 9 draft-ietf-dtn-bpsec-default-sc-07 11 Abstract 13 This document defines default integrity and confidentiality security 14 contexts that can be used with the Bundle Protocol Security Protocol 15 (BPSec) implementations. These security contexts are intended to be 16 used for both testing the interoperability of BPSec implementations 17 and for providing basic security operations when no other security 18 contexts are defined or otherwise required for a network. 20 Status of This Memo 22 This Internet-Draft is submitted in full conformance with the 23 provisions of BCP 78 and BCP 79. 25 Internet-Drafts are working documents of the Internet Engineering 26 Task Force (IETF). Note that other groups may also distribute 27 working documents as Internet-Drafts. The list of current Internet- 28 Drafts is at https://datatracker.ietf.org/drafts/current/. 30 Internet-Drafts are draft documents valid for a maximum of six months 31 and may be updated, replaced, or obsoleted by other documents at any 32 time. It is inappropriate to use Internet-Drafts as reference 33 material or to cite them other than as "work in progress." 35 This Internet-Draft will expire on November 18, 2021. 37 Copyright Notice 39 Copyright (c) 2021 IETF Trust and the persons identified as the 40 document authors. All rights reserved. 42 This document is subject to BCP 78 and the IETF Trust's Legal 43 Provisions Relating to IETF Documents 44 (https://trustee.ietf.org/license-info) in effect on the date of 45 publication of this document. Please review these documents 46 carefully, as they describe your rights and restrictions with respect 47 to this document. Code Components extracted from this document must 48 include Simplified BSD License text as described in Section 4.e of 49 the Trust Legal Provisions and are provided without warranty as 50 described in the Simplified BSD License. 52 Table of Contents 54 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 55 2. Requirements Language . . . . . . . . . . . . . . . . . . . . 4 56 3. Integrity Security Context BIB-HMAC-SHA2 . . . . . . . . . . 4 57 3.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 4 58 3.2. Scope . . . . . . . . . . . . . . . . . . . . . . . . . . 4 59 3.3. Parameters . . . . . . . . . . . . . . . . . . . . . . . 6 60 3.3.1. SHA Variant . . . . . . . . . . . . . . . . . . . . . 6 61 3.3.2. Wrapped Key . . . . . . . . . . . . . . . . . . . . . 7 62 3.3.3. Integrity Scope Flags . . . . . . . . . . . . . . . . 7 63 3.3.4. Enumerations . . . . . . . . . . . . . . . . . . . . 8 64 3.4. Results . . . . . . . . . . . . . . . . . . . . . . . . . 8 65 3.5. Key Considerations . . . . . . . . . . . . . . . . . . . 9 66 3.6. Canonicalization Algorithms . . . . . . . . . . . . . . . 9 67 3.7. Processing . . . . . . . . . . . . . . . . . . . . . . . 10 68 3.7.1. Keyed Hash Generation . . . . . . . . . . . . . . . . 10 69 3.7.2. Keyed Hash Verification . . . . . . . . . . . . . . . 11 70 4. Security Context BCB-AES-GCM . . . . . . . . . . . . . . . . 12 71 4.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 12 72 4.2. Scope . . . . . . . . . . . . . . . . . . . . . . . . . . 13 73 4.3. Parameters . . . . . . . . . . . . . . . . . . . . . . . 15 74 4.3.1. Initialization Vector (IV) . . . . . . . . . . . . . 15 75 4.3.2. AES Variant . . . . . . . . . . . . . . . . . . . . . 15 76 4.3.3. Wrapped Key . . . . . . . . . . . . . . . . . . . . . 16 77 4.3.4. AAD Scope Flags . . . . . . . . . . . . . . . . . . . 16 78 4.3.5. Enumerations . . . . . . . . . . . . . . . . . . . . 17 79 4.4. Results . . . . . . . . . . . . . . . . . . . . . . . . . 17 80 4.4.1. Authentication Tag . . . . . . . . . . . . . . . . . 18 81 4.4.2. Enumerations . . . . . . . . . . . . . . . . . . . . 18 82 4.5. Key Considerations . . . . . . . . . . . . . . . . . . . 18 83 4.6. GCM Considerations . . . . . . . . . . . . . . . . . . . 19 84 4.7. Canonicalization Algorithms . . . . . . . . . . . . . . . 20 85 4.7.1. Cipher text related calculations . . . . . . . . . . 20 86 4.7.2. Additional Authenticated Data . . . . . . . . . . . . 21 87 4.8. Processing . . . . . . . . . . . . . . . . . . . . . . . 21 88 4.8.1. Encryption . . . . . . . . . . . . . . . . . . . . . 21 89 4.8.2. Decryption . . . . . . . . . . . . . . . . . . . . . 23 90 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 24 91 5.1. Security Context Identifiers . . . . . . . . . . . . . . 24 92 5.2. Integrity Scope Flags . . . . . . . . . . . . . . . . . . 25 93 5.3. AAD Scope Flags . . . . . . . . . . . . . . . . . . . . . 25 94 6. Security Considerations . . . . . . . . . . . . . . . . . . . 26 95 6.1. Key Management . . . . . . . . . . . . . . . . . . . . . 26 96 6.2. Key Handling . . . . . . . . . . . . . . . . . . . . . . 27 97 6.3. AES GCM . . . . . . . . . . . . . . . . . . . . . . . . . 28 98 6.4. AES Key Wrap . . . . . . . . . . . . . . . . . . . . . . 28 99 6.5. Bundle Fragmentation . . . . . . . . . . . . . . . . . . 28 100 7. Normative References . . . . . . . . . . . . . . . . . . . . 29 101 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 30 102 A.1. Example 1: Simple Integrity . . . . . . . . . . . . . . . 31 103 A.1.1. Original Bundle . . . . . . . . . . . . . . . . . . . 31 104 A.1.2. Security Operation Overview . . . . . . . . . . . . . 33 105 A.1.3. Bundle Integrity Block . . . . . . . . . . . . . . . 33 106 A.1.4. Final Bundle . . . . . . . . . . . . . . . . . . . . 35 107 A.2. Example 2: Simple Confidentiality with Key Wrap . . . . . 35 108 A.2.1. Original Bundle . . . . . . . . . . . . . . . . . . . 35 109 A.2.2. Security Operation Overview . . . . . . . . . . . . . 36 110 A.2.3. Bundle Confidentiality Block . . . . . . . . . . . . 37 111 A.2.4. Final Bundle . . . . . . . . . . . . . . . . . . . . 39 112 A.3. Example 3: Security Blocks from Multiple Sources . . . . 39 113 A.3.1. Original Bundle . . . . . . . . . . . . . . . . . . . 39 114 A.3.2. Security Operation Overview . . . . . . . . . . . . . 41 115 A.3.3. Bundle Integrity Block . . . . . . . . . . . . . . . 41 116 A.3.4. Bundle Confidentiality Block . . . . . . . . . . . . 43 117 A.3.5. Final Bundle . . . . . . . . . . . . . . . . . . . . 45 118 A.4. Example 4: Security Blocks with Full Scope . . . . . . . 45 119 A.4.1. Original Bundle . . . . . . . . . . . . . . . . . . . 45 120 A.4.2. Security Operation Overview . . . . . . . . . . . . . 46 121 A.4.3. Bundle Integrity Block . . . . . . . . . . . . . . . 47 122 A.4.4. Bundle Confidentiality Block . . . . . . . . . . . . 49 123 A.4.5. Final Bundle . . . . . . . . . . . . . . . . . . . . 50 124 Appendix B. Acknowledgements . . . . . . . . . . . . . . . . . . 51 125 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 51 127 1. Introduction 129 The Bundle Protocol Security Protocol (BPSec) [I-D.ietf-dtn-bpsec] 130 specification provides inter-bundle integrity and confidentiality 131 operations for networks deploying the Bundle Protocol (BP) 132 [I-D.ietf-dtn-bpbis]. BPSec defines BP extension blocks to carry 133 security information produced under the auspices of some security 134 context. 136 This document defines two security contexts (one for an integrity 137 service and one for a confidentiality service) for populating BPSec 138 Block Integrity Blocks (BIBs) and Block Confidentiality Blocks 139 (BCBs). 141 These contexts generate information that MUST be encoded using the 142 CBOR specification documented in [RFC8949]. 144 2. Requirements Language 146 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 147 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 148 "OPTIONAL" in this document are to be interpreted as described in BCP 149 14 [RFC2119] [RFC8174] when, and only when, they appear in all 150 capitals, as shown here. 152 3. Integrity Security Context BIB-HMAC-SHA2 154 3.1. Overview 156 The BIB-HMAC-SHA2 security context provides a keyed hash over a set 157 of plain text information. This context uses the Secure Hash 158 Algorithm 2 (SHA-2) discussed in [SHS] combined with the HMAC keyed 159 hash discussed in [HMAC]. The combination of HMAC and SHA-2 as the 160 integrity mechanism for this security context was selected for two 161 reasons: 163 1. The use of symmetric keys allows this security context to be used 164 in places where an asymmetric-key infrastructure (such as a 165 public key infrastructure) might be impractical. 167 2. The combination HMAC-SHA2 represents a well-supported and well- 168 understood integrity mechanism with multiple implementations 169 available. 171 BIB-HMAC-SHA2 supports three variants of HMAC-SHA, based on the 172 supported length of the SHA-2 hash value. These variants correspond 173 to "HMAC 256/256", "HMAC 384/384", and "HMAC 512/512" as defined in 174 [RFC8152] Table 7: HMAC Algorithm Values. The selection of which 175 variant is used by this context is provided as a security context 176 parameter. 178 The output of the HMAC MUST be equal to the size of the SHA2 hashing 179 function: 256 bits for SHA-256, 384 bits for SHA-384, and 512 bits 180 for SHA-512. 182 The BIB-HMAC-SHA2 security context MUST have the security context 183 identifier specified in Section 5.1. 185 3.2. Scope 187 The scope of BIB-HMAC-SHA2 is the set of information used to produce 188 the plain text over which a keyed hash is calculated. This plain 189 text is termed the "Integrity Protected Plain Text" (IPPT). The 190 content of the IPPT is constructed as the concatenation of 191 information whose integrity is being preserved from the BIB-HMAC-SHA2 192 security source to its security acceptor. There are four types of 193 information that can be used in the generation of the IPPT, based on 194 how broadly the concept of integrity is being applied. These four 195 types of information, whether they are required, and why they are 196 important for integrity, are discussed as follows. 198 Security target contents 199 The contents of the block-type-specific data field of the 200 security target MUST be included in the IPPT. Including this 201 information protects the security target data and is considered 202 the minimal, required set of information for an integrity service 203 on the security target. 205 Primary block 206 The primary block identifies a bundle and, once created, the 207 contents of this block are immutable. Changes to the primary 208 block associated with the security target indicate that the 209 security target (and BIB) might no longer be in the correct 210 bundle. 212 For example, if a security target and associated BIB are copied 213 from one bundle to another bundle, the BIB might still contain a 214 verifiable signature for the security target unless information 215 associated with the bundle primary block is included in the keyed 216 hash carried by the BIB. 218 Including this information in the IPPT protects the integrity of 219 the association of the security target with a specific bundle. 221 Security target other fields 222 The other fields of the security target include block 223 identification and processing information. Changing this 224 information changes how the security target is treated by nodes 225 in the network even when the "user data" of the security target 226 are otherwise unchanged. 228 For example, if the block processing control flags of a security 229 target are different at a security verifier than they were 230 originally set at the security source then the policy for 231 handling the security target has been modified. 233 Including this information in the IPPT protects the integrity of 234 the policy and identification of the security target data. 236 BIB other fields 237 The other fields of the BIB include block identification and 238 processing information. Changing this information changes how 239 the BIB is treated by nodes in the network, even when other 240 aspects of the BIB are unchanged. 242 For example, if the block processing control flags of the BIB are 243 different at a security verifier than they were originally set at 244 the security source, then the policy for handling the BIB has 245 been modified. 247 Including this information in the IPPT protects the integrity of 248 the policy and identification of the security service in the 249 bundle. 251 NOTE: The security context identifier and security context 252 parameters of the security block are not included in the IPPT 253 because these parameters, by definition, are required to verify 254 or accept the security service. Successful verification at 255 security verifiers and security acceptors implies that these 256 parameters were unchanged since being specified at the security 257 source. 259 The scope of the BIB-HMAC-SHA2 security context is configured using 260 an optional security context parameter. 262 3.3. Parameters 264 BIB-HMAC-SHA2 can be parameterized to select SHA-2 variants, 265 communicate key information, and define the scope of the IPPT. 267 3.3.1. SHA Variant 269 This optional parameter identifies which variant of the SHA-2 270 algorithm is to be used in the generation of the authentication code. 272 This value MUST be encoded as a CBOR unsigned integer. 274 Valid values for this parameter are as follows. 276 SHA Variant Parameter Values 278 +-------+-----------------------------------------------------------+ 279 | Value | Description | 280 +-------+-----------------------------------------------------------+ 281 | 5 | HMAC 256/256 as defined in [RFC8152] Table 7: HMAC | 282 | | Algorithm Values | 283 | 6 | HMAC 384/384 as defined in [RFC8152] Table 7: HMAC | 284 | | Algorithm Values | 285 | 7 | HMAC 512/512 as defined in [RFC8152] Table 7: HMAC | 286 | | Algorithm Values | 287 +-------+-----------------------------------------------------------+ 289 Table 1 291 When not provided, implementations SHOULD assume a value of 6 292 (indicating use of HMAC 384/384), unless an alternate default is 293 established by local security policy at the security source, 294 verifiers, or acceptor of this integrity service. 296 3.3.2. Wrapped Key 298 This optional parameter contains the output of the AES key wrap 299 authenticated encryption function (KW-AE) as defined in [AES-KW]. 300 Specifically, this parameter holds the cipher text produced when 301 running the KW-AE algorithm with the input string being the symmetric 302 HMAC key used to generate the security results present in the 303 security block. The value of this parameter is used as input to the 304 AES key wrap authenticated decryption function (KW-AD) at security 305 verifiers and security acceptors to determine the symmetric HMAC key 306 needed for the proper validation of the security results in the 307 security block. 309 This value MUST be encoded as a CBOR byte string. 311 If this parameter is not present then security verifiers and 312 acceptors MUST determine the proper key as a function of their local 313 BPSec policy and configuration. 315 3.3.3. Integrity Scope Flags 317 This optional parameter contains a series of flags that describe what 318 information is to be included with the block-type-specific data when 319 constructing the IPPT value. 321 This value MUST be represented as a CBOR unsigned integer, the value 322 of which MUST be processed as a bit field. 324 Integrity scope flags that are unrecognized MUST be ignored, as 325 future definitions of additional flags might not be integrated 326 simultaneously into security context implementations operating at all 327 nodes. 329 Bits in this field represent additional information to be included 330 when generating an integrity signature over the security target. 331 These bits are defined as follows. 333 - Bit 0 (the low-order bit, 0x0001): Primary Block Flag. 335 - Bit 1 (0x0002): Target Header Flag. 337 - Bit 2 (0x0003): Security Header Flag. 339 - Bits 3-7 are reserved. 341 - Bits 8-15 are unassigned. 343 3.3.4. Enumerations 345 BIB-HMAC-SHA2 defines the following security context parameters. 347 BIB-HMAC-SHA2 Security Parameters 349 +----+-----------------------+--------------------+---------------+ 350 | Id | Name | CBOR Encoding Type | Default Value | 351 +----+-----------------------+--------------------+---------------+ 352 | 1 | SHA Variant | UINT | 6 | 353 | 2 | Wrapped Key | Byte String | NONE | 354 | 4 | Integrity Scope Flags | UINT | 0x7 | 355 +----+-----------------------+--------------------+---------------+ 357 Table 2 359 3.4. Results 361 BIB-HMAC-SHA2 defines the following security results. 363 BIB-HMAC-SHA2 Security Results 365 +--------+----------+-------------+---------------------------------+ 366 | Result | Result | CBOR | Description | 367 | Id | Name | Encoding | | 368 | | | Type | | 369 +--------+----------+-------------+---------------------------------+ 370 | 1 | Expected | byte string | The output of the HMAC | 371 | | HMAC | | calculation at the security | 372 | | | | source. | 373 +--------+----------+-------------+---------------------------------+ 375 Table 3 377 3.5. Key Considerations 379 HMAC keys used with this context MUST be symmetric and MUST have a 380 key length equal to the output of the HMAC. For this reason, HMAC 381 keys will be integer divisible by 8 bytes and special padding-aware 382 AES key wrap algorithms are not needed. 384 It is assumed that any security verifier or security acceptor 385 performing an integrity verification can determine the proper HMAC 386 key to be used. Potential sources of the HMAC key include (but are 387 not limited to) the following: 389 Pre-placed keys selected based on local policy. 391 Keys extracted from material carried in the BIB. 393 Session keys negotiated via a mechanism external to the BIB. 395 When an AES-KW wrapped key is present in a security block, it is 396 assumed that security verifiers and security acceptors can 397 independently determine the key encryption key (KEK) used in the 398 wrapping of the symmetric HMAC key. 400 As discussed in Section 6 and emphasized here, it is strongly 401 recommended that keys be protected once generated, both when they are 402 stored and when they are transmitted. 404 3.6. Canonicalization Algorithms 406 This section defines the canonicalization algorithm used to prepare 407 the IPPT input to the BIB-HMAC-SHA2 integrity mechanism. The 408 construction of the IPPT depends on the settings of the integrity 409 scope flags that can be provided as part of customizing the behavior 410 of this security context. 412 In all cases, the canonical form of any portion of an extension block 413 MUST be performed as described in [I-D.ietf-dtn-bpsec]. The 414 canonicalization algorithms defined in [I-D.ietf-dtn-bpsec] adhere to 415 the canonical forms for extension blocks defined in 416 [I-D.ietf-dtn-bpbis] but resolve ambiguities related to how values 417 are represented in CBOR. 419 The IPPT is constructed using the following process. 421 1. The canonical form of the IPPT starts as the empty set with 422 length 0. 424 2. If the integrity scope parameter is present and the primary block 425 flag is set to 1, then a canonical form of the bundle's primary 426 block MUST be calculated and the result appended to the IPPT. 428 3. If the integrity scope parameter is present and the target header 429 flag is set to 1, then the canonical form of the block type code, 430 block number, and block processing control flags associated with 431 the security target MUST be calculated and, in that order, 432 appended to the IPPT. 434 4. If the integrity scope parameter is present and the security 435 header flag is set to 1, then the canonical form of the block 436 type code, block number, and block processing control flags 437 associated with the BIB MUST be calculated and, in that order, 438 appended to the IPPT. 440 5. The canonical form of the security target block-type-specific 441 data MUST be calculated and appended to the IPPT. 443 3.7. Processing 445 3.7.1. Keyed Hash Generation 447 During keyed hash generation, two inputs are prepared for the the 448 appropriate HMAC/SHA2 algorithm: the HMAC key and the IPPT. These 449 data items MUST be generated as follows. 451 The HMAC key MUST have the appropriate length as required by local 452 security policy. The key can be generated specifically for this 453 integrity service, given as part of local security policy, or 454 through some other key management mechanism as discussed in 455 Section 3.5. 457 Prior to the generation of the IPPT, if a CRC value is present for 458 the target block of the BIB, then that CRC value MUST be removed 459 from the target block. This involves both removing the CRC value 460 from the target block and setting the CRC Type field of the target 461 block to "no CRC is present." 463 Once CRC information is removed, the IPPT MUST be generated as 464 discussed in Section 3.6. 466 Upon successful hash generation the following actions MUST occur. 468 The keyed hash produced by the HMAC/SHA2 variant MUST be added as 469 a security result for the BIB representing the security operation 470 on this security target, as discussed in Section 3.4). 472 Finally, the BIB containing information about this security operation 473 MUST be updated as follows. These operations can occur in any order. 475 The security context identifier for the BIB MUST be set to the 476 context identifier for BIB-HMAC-SHA2. 478 Any local flags used to generate the IPPT SHOULD be placed in the 479 integrity scope flags security parameter for the BIB unless these 480 flags are expected to be correctly configured at security 481 verifiers and acceptors in the network. 483 The HMAC key MAY be wrapped using the NIST AES-KW algorithm and 484 the results of the wrapping added as the wrapped key security 485 parameter for the BIB. 487 The SHA variant used by this security context SHOULD be added as 488 the SHA variant security parameter for the BIB if it differs from 489 the default key length. Otherwise, this parameter MAY be omitted 490 if doing so provides a useful reduction in message sizes. 492 Problems encountered in the keyed hash generation MUST be processed 493 in accordance with local BPSec security policy. 495 3.7.2. Keyed Hash Verification 497 During keyed hash verification, the input of the security target and 498 a HMAC key are provided to the appropriate HMAC/SHA2 algorithm. 500 During keyed hash verification, two inputs are prepared for the 501 appropriate HMAC/SHA2 algorithm: the HMAC key and the IPPT. These 502 data items MUST be generated as follows. 504 The HMAC key MUST be derived using the wrapped key security 505 parameter if such a parameter is included in the security context 506 parameters of the BIB. Otherwise, this key MUST be derived in 507 accordance with security policy at the verifying node as discussed 508 in Section 3.5. 510 The IPPT MUST be generated as discussed in Section 3.6 with the 511 value of integrity scope flags being taken from the integrity 512 scope flags security context parameter. If the integrity scope 513 flags parameter is not included in the security context parameters 514 then these flags MAY be derived from local security policy. 516 The calculated HMAC output MUST be compared to the expected HMAC 517 output encoded in the security results of the BIB for the security 518 target. If the calculated HMAC and expected HMAC are identical, the 519 verification MUST be considered a success. Otherwise, the 520 verification MUST be considered a failure. 522 If the verification fails or otherwise experiences an error, or if 523 any needed parameters are missing, then the verification MUST be 524 treated as failed and processed in accordance with local security 525 policy. 527 This security service is removed from the bundle at the security 528 acceptor as required by the BPSec specification. If the security 529 acceptor is not the bundle destination and if no other integrity 530 service is being applied to the target block, then a CRC MUST be 531 included for the target block. The CRC type, as determined by 532 policy, is set in the target block's CRC type field and the 533 corresponding CRC value is added as the CRC field for that block. 535 4. Security Context BCB-AES-GCM 537 4.1. Overview 539 The BCB-AES-GCM security context replaces the block-type-specific 540 data field of its security target with cipher text generated using 541 the Advanced Encryption Standard (AES) cipher operating in Galois/ 542 Counter Mode (GCM) [AES-GCM]. The use of AES-GCM was selected as the 543 cipher suite for this confidentiality mechanism for several reasons: 545 1. The selection of a symmetric-key cipher suite allows for 546 relatively smaller keys than asymmetric-key cipher suites. 548 2. The selection of a symmetric-key cipher suite allows this 549 security context to be used in places where an asymmetric-key 550 infrastructure (such as a public key infrastructure) might be 551 impractical. 553 3. The use of the Galois/Counter Mode produces cipher-text with the 554 same size as the plain text making the replacement of target 555 block information easier as length fields do not need to be 556 changed. 558 4. The AES-GCM cipher suite provides authenticated encryption, as 559 required by the BPSec protocol. 561 Additionally, the BCB-AES-GCM security context generates an 562 authentication tag based on the plain text value of the block-type- 563 specific data and other additional authenticated data that might be 564 specified via parameters to this security context. 566 This security context supports two variants of AES-GCM, based on the 567 supported length of the symmetric key. These variants correspond to 568 A128GCM and A256GCM as defined in [RFC8152] Table 9: Algorithm Value 569 for AES-GCM. 571 The BCB-AES-GCM security context MUST have the security context 572 identifier specified in Section 5.1. 574 4.2. Scope 576 There are two scopes associated with BCB-AES-GCM: the scope of the 577 confidentiality service and the scope of the authentication service. 578 The first defines the set of information provided to the AES-GCM 579 cipher for the purpose of producing cipher text. The second defines 580 the set of information used to generate an authentication tag. 582 The scope of the confidentiality service defines the set of 583 information provided to the AES-GCM cipher for the purpose of 584 producing cipher text. This MUST be the full set of plain text 585 contained in the block-type-specific data field of the security 586 target. 588 The scope of the authentication service defines the set of 589 information used to generate an authentication tag carried with the 590 security block. This information includes the data included in the 591 confidentiality service and MAY include other information (additional 592 authenticated data), as follows. 594 Primary block 595 The primary block identifies a bundle and, once created, the 596 contents of this block are immutable. Changes to the primary 597 block associated with the security target indicate that the 598 security target (and BCB) might no longer be in the correct 599 bundle. 601 For example, if a security target and associated BCB are copied 602 from one bundle to another bundle, the BCB might still be able to 603 decrypt the security target even though these blocks were never 604 intended to exist in the copied-to bundle. 606 Including this information as part of additional authenticated 607 data ensures that security target (and security block) appear in 608 the same bundle at the time of decryption as at the time of 609 encryption. 611 Security target other fields 612 The other fields of the security target include block 613 identification and processing information. Changing this 614 information changes how the security target is treated by nodes 615 in the network even when the "user data" of the security target 616 are otherwise unchanged. 618 For example, if the block processing control flags of a security 619 target are different at a security verifier than they were 620 originally set at the security source then the policy for 621 handling the security target has been modified. 623 Including this information as part of additional authenticated 624 data ensures that the cipher text in the security target will not 625 be used with a different set of block policy than originally set 626 at the time of encryption. 628 BCB other fields 629 The other fields of the BCB include block identification and 630 processing information. Changing this information changes how 631 the BCB is treated by nodes in the network, even when other 632 aspects of the BCB are unchanged. 634 For example, if the block processing control flags of the BCB are 635 different at a security acceptor than they were originally set at 636 the security source then the policy for handling the BCB has been 637 modified. 639 Including this information as part of additional authenticated 640 data ensures that the policy and identification of the security 641 service in the bundle has not changed. 643 NOTE: The security context identifier and security context 644 parameters of the security block are not included as additional 645 authenticated data because these parameters, by definition, are 646 those needed to verify or accept the security service. 647 Therefore, it is expected that changes to these values would 648 result in failures at security verifiers and security acceptors. 650 The scope of the BCB-AES-GCM security context is configured using an 651 optional security context parameter. 653 4.3. Parameters 655 BCB-AES-GCM can be parameterized to specify the AES variant, 656 initialization vector, key information, and identify additional 657 authenticated data. 659 4.3.1. Initialization Vector (IV) 661 This optional parameter identifies the initialization vector (IV) 662 used to initialize the AES-GCM cipher. 664 The length of the initialization vector, prior to any CBOR encoding, 665 MUST be between 8-16 bytes. A value of 12 bytes SHOULD be used 666 unless local security policy requires a different length. 668 This value MUST be encoded as a CBOR byte string. 670 The initialization vector can have any value with the caveat that a 671 value MUST NOT be re-used for multiple encryptions using the same 672 encryption key. This value MAY be re-used when encrypting with 673 different keys. For example, if each encryption operation using BCB- 674 AES-GCM uses a newly generated key, then the same IV can be reused. 676 4.3.2. AES Variant 678 This optional parameter identifies the AES variant being used for the 679 AES-GCM encryption, where the variant is identified by the length of 680 key used. 682 This value MUST be encoded as a CBOR unsigned integer. 684 Valid values for this parameter are as follows. 686 AES Variant Parameter Values 688 +-------+-----------------------------------------------------------+ 689 | Value | Description | 690 +-------+-----------------------------------------------------------+ 691 | 1 | A128GCM as defined in [RFC8152] Table 9: Algorithm Values | 692 | | for AES-GCM | 693 | 3 | A256GCM as defined in [RFC8152] Table 9: Algorithm Values | 694 | | for AES-GCM | 695 +-------+-----------------------------------------------------------+ 696 When not provided, implementations SHOULD assume a value of 3 697 (indicating use of A256GCM), unless an alternate default is 698 established by local security policy at the security source, 699 verifier, or acceptor of this integrity service. 701 Regardless of the variant, the generated authentication tag MUST 702 always be 128 bits. 704 4.3.3. Wrapped Key 706 This optional parameter contains the output of the AES key wrap 707 authenticated encryption function (KW-AE) as defined in [AES-KW]. 708 Specifically, this parameter holds the cipher text produced when 709 running the KW-AE algorithm with the input string being the symmetric 710 AES key used to generate the security results present in the security 711 block. The value of this parameter is used as input to the AES key 712 wrap authenticated decryption function (KW-AD) at security verifiers 713 and security acceptors to determine the symmetric AES key needed for 714 the proper decryption of the security results in the security block. 716 This value MUST be encoded as a CBOR byte string. 718 If this parameter is not present then security verifiers and 719 acceptors MUST determine the proper key as a function of their local 720 BPSec policy and configuration. 722 4.3.4. AAD Scope Flags 724 This optional parameter contains a series of flags that describe what 725 information is to be included with the block-type-specific data of 726 the security target as part of additional authenticated data (AAD). 728 This value MUST be represented as a CBOR unsigned integer, the value 729 of which MUST be processed as a bit field. 731 AAD scope flags that are unrecognized MUST be ignored, as future 732 definitions of additional flags might not be integrated 733 simultaneously into security context implementations operating at all 734 nodes. 736 Bits in this field represent additional information to be included 737 when generating an integrity signature over the security target. 738 These bits are defined as follows. 740 - Bit 0 (the low-order bit, 0x0001): Primary Block Flag. 742 - Bit 1 (0x0002): Target Header Flag. 744 - Bit 2 (0x0003): Security Header Flag. 746 - Bits 3-7 are reserved. 748 - Bits 8-15 are unassigned. 750 4.3.5. Enumerations 752 BCB-AES-GCM defines the following security context parameters. 754 BCB-AES-GCM Security Parameters 756 +----+-----------------------+--------------------+---------------+ 757 | Id | Name | CBOR Encoding Type | Default Value | 758 +----+-----------------------+--------------------+---------------+ 759 | 1 | Initialization Vector | Byte String | NONE | 760 | 2 | AES Variant | UINT | 3 | 761 | 3 | Wrapped Key | Byte String | NONE | 762 | 4 | AAD Scope Flags | UINT | 0x7 | 763 +----+-----------------------+--------------------+---------------+ 765 Table 4 767 4.4. Results 769 The BCB-AES-GCM security context produces a single security result 770 carried in the security block: the authentication tag. 772 NOTES: 774 The cipher text generated by the cipher suite is not considered a 775 security result as it is stored in the block-type-specific data 776 field of the security target block. When operating in GCM mode, 777 AES produces cipher text of the same size as its plain text and, 778 therefore, no additional logic is required to handle padding or 779 overflow caused by the encryption in most cases (see below). 781 If the generated cipher text contains the authentication tag and 782 the tag can be separated from the cipher text then the tag MUST be 783 separated and stored in the authentication tag security result 784 field. 786 If the generated cipher text contains the authentication tag and 787 the tag cannot be separated from the cipher text then the tag MUST 788 NOT be included in the authentication tag security result field. 789 Instead the security target block MUST be resized to accommodate 790 the additional 128 bits of authentication tag included in the 791 generated cipher text. 793 4.4.1. Authentication Tag 795 The authentication tag is generated by the cipher suite over the 796 security target plain text input to the cipher suite as combined with 797 any optional additional authenticated data. This tag is used to 798 ensure that the plain text (and important information associated with 799 the plain text) is authenticated prior to decryption. 801 If the authentication tag is included in the cipher text placed in 802 the security target block-type-specific data field, then this 803 security result MUST NOT be included in the BCB for that security 804 target. 806 The length of the authentication tag, prior to any CBOR encoding, 807 MUST be 128 bits. 809 This value MUST be encoded as a CBOR byte string. 811 4.4.2. Enumerations 813 BCB-AES-GCM defines the following security context parameters. 815 BCB-AES-GCM Security Results 817 +-----------+--------------------+--------------------+ 818 | Result Id | Result Name | CBOR Encoding Type | 819 +-----------+--------------------+--------------------+ 820 | 1 | Authentication Tag | Byte String | 821 +-----------+--------------------+--------------------+ 823 Table 5 825 4.5. Key Considerations 827 Keys used with this context MUST be symmetric and MUST have a key 828 length equal to the key length defined in the security context 829 parameters or as defined by local security policy at security 830 verifiers and acceptors. For this reason, content-encrypting keys 831 will be integer divisible by 8 bytes and special padding-aware AES 832 key wrap algorithms are not needed. 834 It is assumed that any security verifier or security acceptor can 835 determine the proper key to be used. Potential sources of the key 836 include (but are not limited to) the following. 838 Pre-placed keys selected based on local policy. 840 Keys extracted from material carried in the BCB. 842 Session keys negotiated via a mechanism external to the BCB. 844 When an AES-KW wrapped key is present in a security block, it is 845 assumed that security verifiers and security acceptors can 846 independently determine the key encryption key (KEK) used in the 847 wrapping of the symmetric AES content-encrypting key. 849 The security provided by block ciphers is reduced as more data is 850 processed with the same key. The total number of bytes processed 851 with a single key for AES-GCM is recommended to be less than 2^64, as 852 described in Appendix B of [AES-GCM]. 854 As discussed in Section 6 and emphasized here, it is strongly 855 recommended that keys be protected once generated, both when they are 856 stored and when they are transmitted. 858 4.6. GCM Considerations 860 The GCM cryptographic mode of AES has specific requirements that MUST 861 be followed by implementers for the secure function of the BCB-AES- 862 GCM security context. While these requirements are well documented 863 in [AES-GCM], some of them are repeated here for emphasis. 865 The pairing of an IV and a security key MUST be unique. An IV 866 MUST NOT be used with a security key more than one time. If an IV 867 and key pair are repeated then the GCM implementation is 868 vulnerable to forgery attacks. More information regarding the 869 importance of the uniqueness of the IV value can be found in 870 Appendix A of [AES-GCM]. 872 While any tag-based authentication mechanism has some likelihood 873 of being forged, this probability is increased when using AES-GCM. 874 In particular, short tag lengths combined with very long messages 875 SHOULD be avoided when using this mode. The BCB-AES-GCM security 876 context requires the use of 128-bit authentication tags at all 877 times. Concerns relating to the size of authentication tags is 878 discussed in Appendices B and C of [AES-GCM]. 880 As discussed in Appendix B of [AES-GCM], implementations SHOULD 881 limit the number of unsuccessful verification attempts for each 882 key to reduce the likelihood of guessing tag values. 884 As discussed in the Security Considerations section of 885 [I-D.ietf-dtn-bpsec], delay-tolerant networks have a higher 886 occurrence of replay attacks due to the store-and-forward nature 887 of the network. Because GCM has no inherent replay attack 888 protection, implementors SHOULD attempt to detect replay attacks 889 by using mechanisms such as those described in Appendix D of 890 [AES-GCM]. 892 4.7. Canonicalization Algorithms 894 This section defines the canonicalization algorithms used to prepare 895 the inputs used to generate both the cipher text and the 896 authentication tag. 898 In all cases, the canonical form of any portion of an extension block 899 MUST be performed as described in [I-D.ietf-dtn-bpsec]. The 900 canonicalization algorithms defined in [I-D.ietf-dtn-bpsec] adhere to 901 the canonical forms for extension blocks defined in 902 [I-D.ietf-dtn-bpbis] but resolve ambiguities related to how values 903 are represented in CBOR. 905 4.7.1. Cipher text related calculations 907 The plain text used during encryption MUST be calculated as the 908 single, definite-length CBOR byte string representing the block-type- 909 specific data field of the security target excluding the CBOR byte 910 string identifying byte and optional CBOR byte string length field. 912 For example, consider the following two CBOR byte strings and the 913 plain text that would be extracted from them. 915 CBOR Byte String Examples 917 +------------------------------+---------+--------------------------+ 918 | CBOR Byte String (Hex) | CBOR | Plain Text Part (Hex) | 919 | | Part | | 920 | | (Hex) | | 921 +------------------------------+---------+--------------------------+ 922 | 18ED | 18 | ED | 923 +------------------------------+---------+--------------------------+ 924 | C24CDEADBEEFDEADBEEFDEADBEEF | C24C | DEADBEEFDEADBEEFDEADBEEF | 925 +------------------------------+---------+--------------------------+ 927 Table 6 929 Similarly, the cipher text used during decryption MUST be calculated 930 as the single, definite-length CBOR byte string representing the 931 block-type-specific data field excluding the CBOR byte string 932 identifying byte and optional CBOR byte string length field. 934 All other fields of the security target (such as the block type code, 935 block number, block processing control flags, or any CRC information) 936 MUST NOT be considered as part of encryption or decryption. 938 4.7.2. Additional Authenticated Data 940 The construction of additional authenticated data depends on the AAD 941 scope flags that can be provided as part of customizing the behavior 942 of this security context. 944 The canonical form of the AAD input to the BCB-AES-GCM mechanism is 945 constructed using the following process. This process MUST be 946 followed when generating AAD for either encryption or decryption. 948 1. The canonical form of the AAD starts as the empty set with length 949 0. 951 2. If the AAD scope parameter is present and the primary block flag 952 is set to 1, then a canonical form of the bundle's primary block 953 MUST be calculated and the result appended to the AAD. 955 3. If the AAD scope parameter is present and the target header flag 956 is set to 1, then the canonical form of the block type code, 957 block number, and block processing control flags associated with 958 the security target MUST be calculated and, in that order, 959 appended to the AAD. 961 4. If the AAD scope parameter is present and the security header 962 flag is set to 1, then the canonical form of the block type code, 963 block number, and block processing control flags associated with 964 the BIB MUST be calculated and, in that order, appended to the 965 AAD. 967 If, after this process, the AAD remains at length 0, then no AAD 968 exists to be input to the cipher suite. 970 4.8. Processing 972 4.8.1. Encryption 974 During encryption, four inputs are prepared for input to the AES/GCM 975 cipher: the encryption key, the IV, the security target plain text to 976 be encrypted, and any additional authenticated data. These data 977 items MUST be generated as follows. 979 Prior to encryption, if a CRC value is present for the target block, 980 then that CRC value MUST be removed. This requires removing the CRC 981 field from the target block and setting the CRC type field of the 982 target block to "no CRC is present." 984 The encryption key MUST have the appropriate length as required by 985 local security policy. The key might be generated specifically 986 for this encryption, given as part of local security policy, or 987 through some other key management mechanism as discussed in 988 Section 4.5. 990 The IV selected MUST be of the appropriate length. Because 991 replaying an IV in counter mode voids the confidentiality of all 992 messages encrypted with said IV, this context also requires a 993 unique IV for every encryption performed with the same key. This 994 means the same key and IV combination MUST NOT be used more than 995 once. 997 The security target plain text for encryption MUST be generated as 998 discussed in Section 4.7.1. 1000 Additional authenticated data, if present, MUST be generated as 1001 discussed in Section 4.7.2 with the value of AAD scope flags being 1002 taken from local security policy. 1004 Upon successful encryption the following actions MUST occur. 1006 The cipher text produced by AES/GCM MUST replace the bytes used to 1007 define the plain text in the security target block's block-type- 1008 specific data field. The block length of the security target MUST 1009 be updated if the generated cipher text is larger than the plain 1010 text (which can occur when the authentication tag is included in 1011 the cipher text calculation, as discussed in Section 4.4). 1013 The authentication tag calculated by the AES/GCM cipher MUST be 1014 added as a security result for the security target in the BCB 1015 holding results for this security operation. 1017 Cases where the authentication tag is generated as part of the 1018 cipher text MUST be processed as described in Section 4.4. 1020 Finally, the BCB containing information about this security operation 1021 MUST be updated as follows. These operations can occur in any order. 1023 The security context identifier for the BCB MUST be set to the 1024 context identifier for BCB-AES-GCM. 1026 The IV input to the cipher MUST be added as the IV security 1027 parameter for the BCB. 1029 Any local flags used to generated AAD for this cipher MUST be 1030 added as the AAD scope flags security parameter for the BCB. 1032 The encryption key MAY be wrapped using the NIST AES-KW algorithm 1033 and the results of the wrapping added as the wrapped key security 1034 parameter for the BCB. 1036 The key length used by this security context MUST be considered 1037 when setting the AES variant security parameter for the BCB if it 1038 differs from the default AES variant. Otherwise, the AES variant 1039 MAY be omitted if doing so provides a useful reduction in message 1040 sizes. 1042 Problems encountered in the encryption MUST be processed in 1043 accordance with local security policy. This MAY include restoring a 1044 CRC value removed from the target block prior to encryption, if the 1045 target block is allowed to be transmitted after an encryption error. 1047 4.8.2. Decryption 1049 During encryption, five inputs are prepared for input to the AES/GCM 1050 cipher: the decryption key, the IV, the security target cipher text 1051 to be decrypted, any additional authenticated data, and the 1052 authentication tag generated from the original encryption. These 1053 data items MUST be generated as follows. 1055 The decryption key MUST be derived using the wrapped key security 1056 parameter if such a parameter is included in the security context 1057 parameters of the BCB. Otherwise this key MUST be derived in 1058 accordance with local security policy at the decrypting node as 1059 discussed in Section 4.5. 1061 The IV MUST be set to the value of the IV security parameter 1062 included in the BCB. If the IV parameter is not included as a 1063 security parameter, an IV MAY be derived as a function of local 1064 security policy and other BCB contents or a lack of an IV security 1065 parameter in the BCB MAY be treated as an error by the decrypting 1066 node. 1068 The security target cipher text for decryption MUST be generated 1069 as discussed in Section 4.7.1. 1071 Additional authenticated data, if present, MUST be generated as 1072 discussed in Section 4.7.2 with the value of AAD scope flags being 1073 taken from the AAD scope flags security context parameter. If the 1074 AAD scope flags parameter is not included in the security context 1075 parameters then these flags MAY be derived from local security 1076 policy in cases where the set of such flags is determinable in the 1077 network. 1079 The authentication tag MUST be present in the BCB security context 1080 parameters field if additional authenticated data are defined for 1081 the BCB (either in the AAD scope flags parameter or as specified 1082 by local policy). This tag MUST be 128 bits in length. 1084 Upon successful decryption the following actions MUST occur. 1086 The plain text produced by AES/GCM MUST replace the bytes used to 1087 define the cipher text in the security target block's block-type- 1088 specific data field. Any changes to the security target block 1089 length field MUST be corrected in cases where the plain text has a 1090 different length than the replaced cipher text. 1092 If the security acceptor is not the bundle destination and if no 1093 other integrity or confidentiality service is being applied to the 1094 target block, then a CRC MUST be included for the target block. The 1095 CRC type, as determined by policy, is set in the target block's CRC 1096 type field and the corresponding CRC value is added as the CRC field 1097 for that block. 1099 If the cipher text fails to authenticate, if any needed parameters 1100 are missing, or if there are other problems in the decryption then 1101 the decryption MUST be treated as failed and processed in accordance 1102 with local security policy. 1104 5. IANA Considerations 1106 5.1. Security Context Identifiers 1108 This specification allocates two security context identifiers from 1109 the "BPSec Security Context Identifier" registry defined in 1110 [I-D.ietf-dtn-bpsec]. 1112 Additional Entries for the BPSec Security Context Identifiers 1113 Registry: 1115 +-------+---------------+---------------+ 1116 | Value | Description | Reference | 1117 +-------+---------------+---------------+ 1118 | TBA | BIB-HMAC-SHA2 | This document | 1119 | TBA | BCB-AES-GCM | This document | 1120 +-------+---------------+---------------+ 1122 Table 7 1124 5.2. Integrity Scope Flags 1126 The BIB-HMAC-SHA2 security context has an Integrity Scope Flags field 1127 for which IANA is requested to create and maintain a new registry 1128 named "BPSec BIB-HMAC-SHA2 Integrity Scope Flags." Initial values 1129 for this registry are given below. 1131 The registration policy for this registry is: Specification Required. 1133 The value range is unsigned 16-bit integer. 1135 BPSec BIB-HMAC-SHA2 Integrity Scope Flags Registry 1137 +-------------------------+--------------------------+--------------+ 1138 | Bit Position (right to | Description | Reference | 1139 | left) | | | 1140 +-------------------------+--------------------------+--------------+ 1141 | 0 | Include primary block | This | 1142 | | | document | 1143 | 1 | Include target header | This | 1144 | | flag | document | 1145 | 2 | Include security header | This | 1146 | | flag | document | 1147 | 3-7 | reserved | This | 1148 | | | document | 1149 | 8-15 | unassigned | This | 1150 | | | document | 1151 +-------------------------+--------------------------+--------------+ 1153 Table 8 1155 5.3. AAD Scope Flags 1157 The BCB-AES-GCM security context has an AAD Scope Flags field for 1158 which IANA is requested to create and maintain a new registry named 1159 "BPSec BCB-AES-GCM AAD Scope Flags." Initial values for this 1160 registry are given below. 1162 The registration policy for this registry is: Specification Required. 1164 The value range is unsigned 16-bit integer. 1166 BPSec BCB-AES-GCM AAD Scope Flags Registry 1168 +-------------------------+--------------------------+--------------+ 1169 | Bit Position (right to | Description | Reference | 1170 | left) | | | 1171 +-------------------------+--------------------------+--------------+ 1172 | 0 | Include primary block | This | 1173 | | | document | 1174 | 1 | Include target header | This | 1175 | | flag | document | 1176 | 2 | Include security header | This | 1177 | | flag | document | 1178 | 3-7 | reserved | This | 1179 | | | document | 1180 | 8-15 | unassigned | This | 1181 | | | document | 1182 +-------------------------+--------------------------+--------------+ 1184 Table 9 1186 6. Security Considerations 1188 Security considerations specific to a single security context are 1189 provided in the description of that context. This section discusses 1190 security considerations that should be evaluated by implementers of 1191 any security context described in this document. Considerations can 1192 also be found in documents listed as normative references and they 1193 should also be reviewed by security context implementors. 1195 6.1. Key Management 1197 The delayed and disrupted nature of DTNs complicates the process of 1198 key management because there might not be reliable, timely round-trip 1199 exchange between security sources, security verifiers, and security 1200 acceptors in the network. This is true when there is a substantial 1201 signal propagation delay between nodes, when nodes are in a highly 1202 challenged communications environment, and when nodes do not support 1203 bi-directional communication. 1205 In these environments, key establishment protocols that rely on 1206 round-trip information exchange might not converge on a shared secret 1207 in a timely manner (or at all). Also, key revocation or key 1208 verification mechanisms that rely on access to a centralized 1209 authority (such as a certificate authority) might similarly fail in 1210 the stressing conditions of a DTN. 1212 For these reasons, the default security contexts described in this 1213 document rely on symmetric key cryptographic mechanisms because 1214 asymmetric key infrastructure (such as a public key infrastructure) 1215 is impractical in this environment. This extends to any asymmetric- 1216 key mechanism for key derivation, key exchange, or key revocation. 1218 BPSec assumes that "key management is handled as a separate part of 1219 network management" [I-D.ietf-dtn-bpsec]. This assumption is also 1220 made by the security contexts defined in this document which do not 1221 define new protocols for key derivation, exchange of key-encrypting 1222 keys, revocation of existing keys, or the security configuration or 1223 policy used to select certain keys for certain security operations. 1225 Nodes using these security contexts need to perform the following 1226 kinds of activities, independent of the construction, transmission, 1227 and processing of BPSec security blocks. 1229 Establish shared key-encrypting-keys with other nodes in the 1230 network using an out-of-band mechanism. This might include pre- 1231 sharing of key encryption keys or the use of traditional key 1232 establishment mechanisms prior to the exchange of BPsec security 1233 blocks. 1235 Determine when a key is considered exhausted and no longer to be 1236 used in the generation, verification, or acceptance of a security 1237 block. 1239 Determine when a key is considered invalid and no longer to be 1240 used in the generation, verification, or acceptance of a security 1241 block. Such revocations can be based on a variety of mechanisms 1242 to include local security policy, time relative to the generation 1243 or use of the key, or as specified through network management. 1245 Determine, through an out-of-band mechanism such as local security 1246 policy, what keys are to be used for what security blocks. This 1247 includes the selection of which key should be used in the 1248 evaluation of a security block received by a security verifier or 1249 a security acceptor. 1251 The failure to provide effective key management techniques 1252 appropriate for the operational networking environment can result in 1253 the compromise of those unmanaged keys and the loss of security 1254 services in the network. 1256 6.2. Key Handling 1258 Once generated, keys should be handled as follows. 1260 It is strongly RECOMMENDED that implementations protect keys both 1261 when they are stored and when they are transmitted. 1263 In the event that a key is compromised, any security operations 1264 using a security context associated with that key SHOULD also be 1265 considered compromised. This means that the BIB-HMAC-SHA2 1266 security context SHOULD NOT provide integrity when used with a 1267 compromised key and BCB-AES-GCM SHOULD NOT provide confidentiality 1268 when used with a compromised key. 1270 The same key SHOULD NOT be used for different algorithms as doing 1271 so might leak information about the key. 1273 6.3. AES GCM 1275 There are a significant number of considerations related to the use 1276 of the GCM mode of AES to provide a confidentiality service. These 1277 considerations are provided in Section 4.6 as part of the 1278 documentation of the BCB-AES-GCM security context. 1280 It should be noted that the authentication tag produced by the GCM 1281 mode of AES is not considered part of the cipher text itself. While 1282 certain implementations might catenate the authentication tag and the 1283 produced cipher text, they are distinct values. For this reason, the 1284 authentication tag is expected to be carried in the BCB-AES-GCM 1285 security block as a security result whenever the authentication tag 1286 can be differentiated from the produced cipher text. 1288 6.4. AES Key Wrap 1290 The AES key wrap (AES-KW) algorithm used by the security contexts in 1291 this document does not use an initialization vector and does not 1292 require any key padding. Key padding is not needed because wrapped 1293 keys used by these security contexts will always be multiples of 8 1294 bytes. The length of the wrapped key can be determined by inspecting 1295 the security context parameters. Therefore, a key can be unwrapped 1296 using only the information present in the security block and the key 1297 encryption key provided by local security policy at the security 1298 verifier or security acceptor. 1300 6.5. Bundle Fragmentation 1302 Bundle fragmentation might prevent security services in a bundle from 1303 being verified after a bundle is fragmented and before the bundle is 1304 re-assembled. Examples of potential issues include the following. 1306 If a security block and its security target do not exist in the 1307 same fragment, then the security block cannot be processed until 1308 the bundle is re-assembled. If a fragment includes an encrypted 1309 target block, but not its BCB, then a receiving bundle processing 1310 agent (BPA) will not know that the target block has been 1311 encrypted. 1313 If a security block is cryptographically bound to a bundle, it 1314 cannot be processed even if the security block and target both 1315 coexist in the fragment. This is because fragments have different 1316 primary blocks than the original bundle. 1318 If security blocks and their target blocks are repeated in 1319 multiple fragments, policy needs to determine how to deal with 1320 issues where a security operation verifies in one fragment but 1321 fails in another fragment. This might happen, for example, if a 1322 BIB block becomes corrupted in one fragment but not in another 1323 fragment. 1325 Implementors should consider how security blocks are processed when a 1326 BPA fragments a received bundle. For example, security blocks and 1327 their targets could be placed in the same fragment if the security 1328 block is not otherwise cryptographically bound to the bundle being 1329 fragmented. Alternatively, if security blocks are cryptographically 1330 bound to a bundle, then a fragmenting BPA should consider 1331 encapsulating the bundle first and then fragmenting the encapsulating 1332 bundle. 1334 7. Normative References 1336 [AES-GCM] Dworkin, M., "NIST Special Publication 800-38D: 1337 Recommendation for Block Cipher Modes of Operation: 1338 Galois/Counter Mode (GCM) and GMAC.", November 2007. 1340 [AES-KW] Dworkin, M., "NIST Special Publication 800-38F: 1341 Recommendation for Block Cipher Modes of Operation: 1342 Methods for Key Wrapping.", December 2012. 1344 [HMAC] US NIST, "The Keyed-Hash Message Authentication Code 1345 (HMAC).", FIPS-198-1, Gaithersburg, MD, USA, July 2008. 1347 https://csrc.nist.gov/publications/detail/fips/198/1/final 1349 [I-D.ietf-dtn-bpbis] 1350 Burleigh, S., Fall, K., and E. Birrane, "Bundle Protocol 1351 Version 7", draft-ietf-dtn-bpbis-31 (work in progress), 1352 January 2021. 1354 [I-D.ietf-dtn-bpsec] 1355 Birrane, E. and K. McKeever, "Bundle Protocol Security 1356 Specification", draft-ietf-dtn-bpsec-27 (work in 1357 progress), February 2021. 1359 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1360 Requirement Levels", BCP 14, RFC 2119, 1361 DOI 10.17487/RFC2119, March 1997, 1362 . 1364 [RFC8152] Schaad, J., "CBOR Object Signing and Encryption (COSE)", 1365 RFC 8152, DOI 10.17487/RFC8152, July 2017, 1366 . 1368 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 1369 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 1370 May 2017, . 1372 [RFC8949] Bormann, C. and P. Hoffman, "Concise Binary Object 1373 Representation (CBOR)", STD 94, RFC 8949, 1374 DOI 10.17487/RFC8949, December 2020, 1375 . 1377 [SHS] US NIST, "Secure Hash Standard (SHS).", FIPS- 1378 180-4, Gaithersburg, MD, USA, August 2015. 1380 https://csrc.nist.gov/publications/detail/fips/180/4/final 1382 Appendix A. Examples 1384 This appendix is informative. 1386 This section presents a series of examples of constructing BPSec 1387 security blocks (using the security contexts defined in this 1388 document) and adding those blocks to a sample bundle. 1390 The examples presented in this appendix represent valid constructions 1391 of bundles, security blocks, and the encoding of security context 1392 parameters and results. For this reason, they can inform unit test 1393 suites for individual implementations as well as interoperability 1394 test suites amongst implementations. However, these examples do not 1395 cover every permutation of security parameters, security results, or 1396 use of security blocks in a bundle. 1398 NOTE: Figures in this section identified as "(CBOR Diagnostic 1399 Notation)" are represented using the CBOR diagnostic notation defined 1400 in [RFC8949]. This notation is used to express CBOR data structures 1401 in a manner that enables visual inspection. The bundles, security 1402 blocks, and security context contents in these figures are 1403 represented using CBOR structures. 1405 NOTE: Examples in this section use the "ipn" URI scheme for 1406 EndpointID naming, as defined in [I-D.ietf-dtn-bpbis]. 1408 NOTE: The bundle source is presumed to be the security source for all 1409 security blocks in this section, unless otherwise noted. 1411 A.1. Example 1: Simple Integrity 1413 This example shows the addition of a BIB to a sample bundle to 1414 provide integrity for the payload block. 1416 A.1.1. Original Bundle 1418 The following diagram shows the original bundle before the BIB has 1419 been added. 1421 Block Block Block 1422 in Bundle Type Number 1423 +========================================+=======+========+ 1424 | Primary Block | N/A | 0 | 1425 +----------------------------------------+-------+--------+ 1426 | Payload Block | 0 | 1 | 1427 +----------------------------------------+-------+--------+ 1429 Figure 1: Example 1 Original Bundle 1431 A.1.1.1. Primary Block 1433 The BPv7 bundle has no special processing flags and no CRC is 1434 provided because the primary block is expected to be protected by an 1435 integrity service BIB using the BIB-HMAC-SHA2 security context. 1437 The bundle is sourced at the source node ipn:2.1 and destined for the 1438 destination node ipn:1.2. The bundle creation time uses a DTN 1439 creation time of 0 indicating lack of an accurate clock and a 1440 sequence number of 40. The lifetime of the bundle is given as 1441 1,000,000 milliseconds since the bundle creation time. 1443 The primary block is provided as follows. 1445 [ 1446 7, / BP version / 1447 0, / flags / 1448 0, / CRC type / 1449 [2, [1,2]], / destination (ipn:1.2) / 1450 [2, [2,1]], / source (ipn:2.1) / 1451 [2, [2,1]], / report-to (ipn:2.1) / 1452 [0, 40], / timestamp / 1453 1000000 / lifetime / 1454 ] 1456 Figure 2: Primary Block (CBOR Diagnostic Notation) 1458 The CBOR encoding of the primary block is 1459 0x88070000820282010282028202018202820201820018281a000f4240. 1461 A.1.1.2. Payload Block 1463 Other than its use as a source of plaintext for security blocks, the 1464 payload has no required distinguishing characteristic for the purpose 1465 of this example. The sample payload is a 32 byte string whose value 1466 is "Ready Generate a 32 byte payload". 1468 The payload is represented in the payload block as a byte string of 1469 the raw payload string. It is NOT represented as a CBOR text string 1470 wrapped within a CBOR binary string. The hex value of the payload 1471 "Ready Generate a 32 byte payload" is 1472 0x52656164792047656e657261746520612033322062797465207061796c6f6164. 1474 The payload block is provided as follows. 1476 [ 1477 1, / type code: Payload block / 1478 1, / block number / 1479 0, / block processing flags / 1480 0, / CRC Type / 1481 h'52656164792047656e65726174652061 / type-specific-data: payload / 1482 2033322062797465207061796c6f6164' 1484 ] 1486 Payload Block (CBOR Diagnostic Notation) 1488 The CBOR encoding of the payload block is 0x8501010000582052656164792 1489 047656e657261746520612033322062797465207061796c6f6164. 1491 A.1.1.3. Bundle CBOR Representation 1493 A BPv7 bundle is represented as an indefinite-length array consisting 1494 of the blocks comprising the bundle, with a terminator character at 1495 the end. 1497 The CBOR encoding of the original bundle is 0x9f880700008202820102820 1498 28202018202820201820018281a000f42408501010000582052656164792047656e65 1499 7261746520612033322062797465207061796c6f6164ff. 1501 A.1.2. Security Operation Overview 1503 This example adds a BIB to the bundle using the BIB-HMAC-SHA2 1504 security context to provide an integrity mechanism over the payload 1505 block. 1507 The following diagram shows the resulting bundle after the BIB is 1508 added. 1510 Block Block Block 1511 in Bundle Type Number 1512 +========================================+=======+========+ 1513 | Primary Block | N/A | 0 | 1514 +----------------------------------------+-------+--------+ 1515 | Bundle Integrity Block | 11 | 2 | 1516 | OP(bib-integrity, target=1) | | | 1517 +----------------------------------------+-------+--------+ 1518 | Payload Block | 0 | 1 | 1519 +----------------------------------------+-------+--------+ 1521 Figure 3: Example 1 Resulting Bundle 1523 A.1.3. Bundle Integrity Block 1525 In this example, a BIB is used to carry an integrity signature over 1526 the payload block. 1528 A.1.3.1. Configuration, Parameters, and Results 1530 For this example, the following configuration and security parameters 1531 are used to generate the security results indicated. 1533 This BIB has a single target and includes a single security result: 1534 the calculated signature over the payload block. 1536 Key : h'1a2b1a2b1a2b1a2b1a2b1a2b1a2b1a2b' 1537 SHA Variant : HMAC 512/512 1538 Scope Flags : 0 1539 Payload Data: h'52656164792047656e65726174652061 1540 2033322062797465207061796c6f6164' 1541 Signature : h'd8e7c3be29effa8779e7dcb0d3cadf53 1542 39df50ebd27b9054f197c8ea9864b0a3 1543 35a0636213e5d4a9c95504f261d91a2f 1544 22757112c95e3587a76b4228361803e8' 1546 Figure 4: Example 1: Configuration, Parameters, and Results 1548 A.1.3.2. Abstract Security Block 1550 The abstract security block structure of the BIB's block-type- 1551 specific-data field for this application is as follows. 1553 [1], / Security Target / 1554 1, / Security Context ID - BIB-HMAC-SHA2 / 1555 1, / Security Context Flags - Parameters Present / 1556 [2,[2, 1]], / Security Source - ipn:2.1 / 1557 [ / Security Parameters - 2 Parameters / 1558 [1, 7], / SHA Variant - HMAC 512/512 / 1559 [3, 0] / Scope Flags - No Additional Scope / 1560 ], 1561 [ / Security Results: 1 Result / 1562 [1, h'd8e7c3be29effa8779e7dcb0d3cadf5339df50ebd27b9054f197c8ea9864 1563 b0a335a0636213e5d4a9c95504f261d91a2f22757112c95e3587a76b4228 1564 361803e8'] 1565 ] 1567 Figure 5: Example 1: BIB Abstract Security Block (CBOR Diagnostic 1568 Notation) 1570 The CBOR encoding of the BIB block-type-specific-data field (the 1571 abstract security block) is 0x810101018202820201828201078203008182015 1572 840d8e7c3be29effa8779e7dcb0d3cadf5339df50ebd27b9054f197c8ea9864b0a335 1573 a0636213e5d4a9c95504f261d91a2f22757112c95e3587a76b4228361803e8. 1575 A.1.3.3. Representations 1577 The BIB wrapping this abstract security block is as follows. 1579 [ 1580 11, / type code / 1581 2, / block number / 1582 0, / flags / 1583 0, / CRC type / 1584 h'810101018202820201828201078203008182015840d8e7c3be29effa8779e7dcb 1585 0d3cadf5339df50ebd27b9054f197c8ea9864b0a335a0636213e5d4a9c95504f2 1586 61d91a2f22757112c95e3587a76b4228361803e8', 1587 ] 1589 Figure 6: Example 1: BIB (CBOR Diagnostic Notation) 1591 The CBOR encoding of the BIB block is 0x850b0200005855810101018202820 1592 201828201078203008182015840d8e7c3be29effa8779e7dcb0d3cadf5339df50ebd2 1593 7b9054f197c8ea9864b0a335a0636213e5d4a9c95504f261d91a2f22757112c95e358 1594 7a76b4228361803e8. 1596 A.1.4. Final Bundle 1598 The CBOR encoding of the full output bundle, with the BIB: 0x9F880700 1599 00820282010282028202018202820201820018281a000f4240850b020000585581010 1600 1018202820201828201078203008182015840d8e7c3be29effa8779e7dcb0d3cadf53 1601 39df50ebd27b9054f197c8ea9864b0a335a0636213e5d4a9c95504f261d91a2f22757 1602 112c95e3587a76b4228361803e8ff. 1604 A.2. Example 2: Simple Confidentiality with Key Wrap 1606 This example shows the addition of a BCB to a sample bundle to 1607 provide confidentiality for the payload block. AES key wrap is used 1608 to transmit the symmetric key used to generate the security results 1609 for this service. 1611 A.2.1. Original Bundle 1613 The following diagram shows the original bundle before the BCB has 1614 been added. 1616 Block Block Block 1617 in Bundle Type Number 1618 +========================================+=======+========+ 1619 | Primary Block | N/A | 0 | 1620 +----------------------------------------+-------+--------+ 1621 | Payload Block | 0 | 1 | 1622 +----------------------------------------+-------+--------+ 1624 Figure 7: Example 2 Original Bundle 1626 A.2.1.1. Primary Block 1628 The primary block used in this example is identical to the primary 1629 block presented in Example 1 Appendix A.1.1.1. 1631 In summary, the CBOR encoding of the primary block is 1632 0x88070000820282010282028202018202820201820018281a000f4240. 1634 A.2.1.2. Payload Block 1636 The payload block used in this example is identical to the payload 1637 block presented in Example 1 Appendix A.1.1.2. 1639 In summary, the CBOR encoding of the payload block is 0x8501010000582 1640 052656164792047656e657261746520612033322062797465207061796c6f6164. 1642 A.2.1.3. Bundle CBOR Representation 1644 A BPv7 bundle is represented as an indefinite-length array consisting 1645 of the blocks comprising the bundle, with a terminator character at 1646 the end. 1648 The CBOR encoding of the original bundle is 0x9f880700008202820102820 1649 28202018202820201820018281a000f42408501010000582052656164792047656e65 1650 7261746520612033322062797465207061796c6f6164ff. 1652 A.2.2. Security Operation Overview 1654 This example adds a BCB using the BCB-AES-GCM security context using 1655 AES key wrap to provide a confidentiality mechanism over the payload 1656 block and transmit the symmetric key. 1658 The following diagram shows the resulting bundle after the BCB is 1659 added. 1661 Block Block Block 1662 in Bundle Type Number 1663 +========================================+=======+========+ 1664 | Primary Block | N/A | 0 | 1665 +----------------------------------------+-------+--------+ 1666 | Bundle Confidentiality Block | 12 | 2 | 1667 | OP(bcb-confidentiality, target=1) | | | 1668 +----------------------------------------+-------+--------+ 1669 | Payload Block (Encrypted) | 0 | 1 | 1670 +----------------------------------------+-------+--------+ 1672 Figure 8: Example 2 Resulting Bundle 1674 A.2.3. Bundle Confidentiality Block 1676 In this example, a BCB is used to encrypt the payload block and uses 1677 AES key wrap to transmit the symmetric key. 1679 A.2.3.1. Configuration, Parameters, and Results 1681 For this example, the following configuration and security parameters 1682 are used to generate the security results indicated. 1684 This BCB has a single target, the payload block. Three security 1685 results are generated: cipher text which replaces the plain text 1686 block-type-specific data to encrypt the payload block, an 1687 authentication tag, and the AES wrapped key. 1689 Content Encryption 1690 Key: h'71776572747975696f70617364666768' 1691 Key Encryption Key: h'6162636465666768696a6b6c6d6e6f70' 1692 IV: h'5477656c7665313231323132' 1693 AES Variant: A128GCM 1694 AES Wrapped Key: h'69c411276fecddc4780df42c8a2af892 1695 96fabf34d7fae700' 1696 Scope Flags: 0 1697 Payload Data: h'52656164792047656e65726174652061 1698 2033322062797465207061796c6f6164' 1699 Authentication Tag: h'689b98e649ae3b554e98aa2ae8f801eb' 1700 Payload Ciphertext: h'3a09c1e63fe2097528a78b7c12943354 1701 a563e32648b700c2784e26a990d91f9d' 1703 Figure 9: Example 2: Configuration, Parameters, and Results 1705 A.2.3.2. Abstract Security Block 1707 The abstract security block structure of the BCB's block-type- 1708 specific-data field for this application is as follows. 1710 [1], / Security Target / 1711 2, / Security Context ID - BCB-AES-GCM / 1712 1, / Security Context Flags - Parameters Present / 1713 [2,[2, 1]], / Security Source - ipn:2.1 / 1714 [ / Security Parameters - 4 Parameters / 1715 [1, h'5477656c7665313231323132'], / Initialization Vector / 1716 [2, 1], / AES Variant - A128GCM / 1717 [3, h'69c411276fecddc4780df42c8a / AES wrapped key / 1718 2af89296fabf34d7fae700'], 1719 [4, 0] / Scope Flags - No extra scope/ 1720 ], 1721 [ / Security Results: 1 Result / 1722 [1, h'689b98e649ae3b554e98aa2ae8f801eb'] / Payload Auth. Tag / 1723 ] 1725 Figure 10: Example 2: BCB Abstract Security Block (CBOR Diagnostic 1726 Notation) 1728 The CBOR encoding of the BCB block-type-specific-data field (the 1729 abstract security block) is 0x8101020182028202018482014c5477656c76653 1730 132313231328202018203581869c411276fecddc4780df42c8a2af89296fabf34d7fa 1731 e70082040081820150689b98e649ae3b554e98aa2ae8f801eb. 1733 A.2.3.3. Representations 1735 The BCB wrapping this abstract security block is as follows. 1737 [ 1738 12, / type code / 1739 2, / block number / 1740 1, / flags - block must be replicated in every fragment / 1741 0, / CRC type / 1742 h'8101020182028202018482014c5477656c766531323132313282020182035818 1743 69c411276fecddc4780df42c8a2af89296fabf34d7fae7008204008182015068 1744 9b98e649ae3b554e98aa2ae8f801eb' 1745 ] 1747 Figure 11: Example 2: BCB (CBOR Diagnostic Notation) 1749 The CBOR encoding of the BCB block is 0x850c020100584f810102018202820 1750 2018482014c5477656c76653132313231328202018203581869c411276fecddc4780d 1751 f42c8a2af89296fabf34d7fae70082040081820150689b98e649ae3b554e98aa2ae8f 1752 801eb. 1754 A.2.4. Final Bundle 1756 The CBOR encoding of the full output bundle, with the BCB: 0x9f880700 1757 00820282010282028202018202820201820018281a000f4240850c020100584f81010 1758 20182028202018482014c5477656c76653132313231328202018203581869c411276f 1759 ecddc4780df42c8a2af89296fabf34d7fae70082040081820150689b98e649ae3b554 1760 e98aa2ae8f801eb850101000058203a09c1e63fe2097528a78b7c12943354a563e326 1761 48b700c2784e26a990d91f9dff. 1763 A.3. Example 3: Security Blocks from Multiple Sources 1765 This example shows the addition of a BIB and BCB to a sample bundle. 1766 These two security blocks are added by two different nodes. The BCB 1767 is added by the source endpoint and the BIB is added by a forwarding 1768 node. 1770 The resulting bundle contains a BCB to encrypt the Payload Block and 1771 a BIB to provide integrity to the Primary and Bundle Age Block. 1773 A.3.1. Original Bundle 1775 The following diagram shows the original bundle before the security 1776 blocks have been added. 1778 Block Block Block 1779 in Bundle Type Number 1780 +========================================+=======+========+ 1781 | Primary Block | N/A | 0 | 1782 +----------------------------------------+-------+--------+ 1783 | Extension Block: Bundle Age Block | 7 | 2 | 1784 +----------------------------------------+-------+--------+ 1785 | Payload Block | 0 | 1 | 1786 +----------------------------------------+-------+--------+ 1788 Figure 12: Example 3 Original Bundle 1790 A.3.1.1. Primary Block 1792 The primary block used in this example is identical to the primary 1793 block presented in Example 1 Appendix A.1.1.1. 1795 In summary, the CBOR encoding of the primary block is 1796 0x88070000820282010282028202018202820201820018281a000f4240. 1798 A.3.1.2. Bundle Age Block 1800 A bundle age block is added to the bundle to help other nodes in the 1801 network determine the age of the bundle. The use of this block is as 1802 recommended because the bundle source does not have an accurate clock 1803 (as indicated by the DTN time of 0). 1805 Because this block is specified at the time the bundle is being 1806 forwarded, the bundle age represents the time that has elapsed from 1807 the time the bundle was created to the time it is being prepared for 1808 forwarding. In this case, the value is given as 300 milliseconds. 1810 The bundle age extension block is provided as follows. 1812 [ 1813 7, / type code: Bundle Age block / 1814 2, / block number / 1815 0, / block processing flags / 1816 0, / CRC Type / 1817 <<300>> / type-specific-data: age / 1818 ] 1820 Figure 13: Bundle Age Block (CBOR Diagnostic Notation) 1822 The CBOR encoding of the bundle age block is 0x85070200004319012c. 1824 A.3.1.3. Payload Block 1826 The payload block used in this example is identical to the payload 1827 block presented in Example 1 Appendix A.1.1.2. 1829 In summary, the CBOR encoding of the payload block is 0x8501010000582 1830 052656164792047656e657261746520612033322062797465207061796c6f6164. 1832 A.3.1.4. Bundle CBOR Representation 1834 A BPv7 bundle is represented as an indefinite-length array consisting 1835 of the blocks comprising the bundle, with a terminator character at 1836 the end. 1838 The CBOR encoding of the original bundle is 0x9f880700008202820102820 1839 28202018202820201820018281a000f424085070200004319012c8501010000582052 1840 656164792047656e657261746520612033322062797465207061796c6f6164ff. 1842 A.3.2. Security Operation Overview 1844 This example provides: 1846 a BIB with the BIB-HMAC-SHA2 security context to provide an 1847 integrity mechanism over the primary block and bundle age block. 1849 a BCB with the BCB-AES-GCM security context to provide a 1850 confidentiality mechanism over the payload block. 1852 The following diagram shows the resulting bundle after the security 1853 blocks are added. 1855 Block Block Block 1856 in Bundle Type Number 1857 +========================================+=======+========+ 1858 | Primary Block | N/A | 0 | 1859 +----------------------------------------+-------+--------+ 1860 | Bundle Integrity Block | 11 | 3 | 1861 | OP(bib-integrity, targets=0, 2) | | | 1862 +----------------------------------------+-------+--------+ 1863 | Bundle Confidentiality Block | 12 | 4 | 1864 | OP(bcb-confidentiality, target=1) | | | 1865 +----------------------------------------+-------+--------+ 1866 | Extension Block: Bundle Age Block | 7 | 2 | 1867 +----------------------------------------+-------+--------+ 1868 | Payload Block (Encrypted) | 0 | 1 | 1869 +----------------------------------------+-------+--------+ 1871 Figure 14: Example 3 Resulting Bundle 1873 A.3.3. Bundle Integrity Block 1875 In this example, a BIB is used to carry an integrity signature over 1876 the bundle age block and an additional signature over the payload 1877 block. The BIB is added by a waypoint node, ipn:3.0. 1879 A.3.3.1. Configuration, Parameters, and Results 1881 For this example, the following configuration and security parameters 1882 are used to generate the security results indicated. 1884 This BIB has two security targets and includes two security results, 1885 holding the calculated signatures over the bundle age block and 1886 primary block. 1888 Key: h'1a2b1a2b1a2b1a2b1a2b1a2b1a2b1a2b' 1889 SHA Variant: HMAC 256/256 1890 Scope Flags: 0 1891 Primary Block Data: h'8807000082028201028202820201820282020182001 1892 8281a000f4240' 1893 Bundle Age Block 1894 Data: h'85070200004319012c' 1895 Primary Block 1896 Signature: h'2f74b42d88234f0a8a98a6c72775ec6511aff3cb5bf 1897 c06aa648f5fc40f31ec0d' 1898 Bundle Age Block 1899 Signature: h'e61385353ce2b4cce5319bc33326cdc26f4061e76cb 1900 21b434c89199a36b00de3' 1902 Figure 15: Example 3: Configuration, Parameters, and Results for the 1903 BIB 1905 A.3.3.2. Abstract Security Block 1907 The abstract security block structure of the BIB's block-type- 1908 specific-data field for this application is as follows. 1910 [0, 2], / Security Target / 1911 1, / Security Context ID - BIB-HMAC-SHA2 / 1912 1, / Security Context Flags - Parameters Present / 1913 [2,[3, 0]], / Security Source - ipn:3.0 / 1914 [ / Security Parameters - 2 Parameters / 1915 [1, 5], / SHA Variant - HMAC 256/256 / 1916 [3, 0] / Scope Flags - No Additional Scope / 1917 ], 1918 [ / Security Results: 2 Results / 1919 [1, h'2f74b42d88234f0a8a98a6c72775ec6511aff3 / Primary Block / 1920 cb5bfc06aa648f5fc40f31ec0d'], 1921 [1, h'e61385353ce2b4cce5319bc33326cdc26f4061 / Bundle Age Block / 1922 e76cb21b434c89199a36b00de3'] 1923 ] 1925 Figure 16: Example 3: BIB Abstract Security Block (CBOR Diagnostic 1926 Notation) 1928 The CBOR encoding of the BIB block-type-specific-data field (the 1929 abstract security block) is 0x820002010182028203008282010582030082820 1930 158202f74b42d88234f0a8a98a6c72775ec6511aff3cb5bfc06aa648f5fc40f31ec0d 1931 82015820e61385353ce2b4cce5319bc33326cdc26f4061e76cb21b434c89199a36b00 1932 de3. 1934 A.3.3.3. Representations 1936 The BIB wrapping this abstract security block is as follows. 1938 [ 1939 11, / type code / 1940 3, / block number / 1941 0, / flags / 1942 0, / CRC type / 1943 h'820002010182028203008282010582030082820158202f74b42d88234f0a8a98 1944 a6c72775ec6511aff3cb5bfc06aa648f5fc40f31ec0d82015820e61385353ce2 1945 b4cce5319bc33326cdc26f4061e76cb21b434c89199a36b00de3', 1946 ] 1948 Figure 17: Example 3: BIB (CBOR Diagnostic Notation) 1950 The CBOR encoding of the BIB block is 0x850b030000585a820002010182028 1951 203008282010582030082820158202f74b42d88234f0a8a98a6c72775ec6511aff3cb 1952 5bfc06aa648f5fc40f31ec0d82015820e61385353ce2b4cce5319bc33326cdc26f406 1953 1e76cb21b434c89199a36b00de3. 1955 A.3.4. Bundle Confidentiality Block 1957 In this example, a BCB is used encrypt the payload block. The BCB is 1958 added by the bundle source node, ipn:2.1. 1960 A.3.4.1. Configuration, Parameters, and Results 1962 For this example, the following configuration and security parameters 1963 are used to generate the security results indicated. 1965 This BCB has a single target, the payload block. Two security 1966 results are generated: cipher text which replaces the plain text 1967 block-type-specific data to encrypt the payload block, and an 1968 authentication tag. 1970 Content Encryption 1971 Key: h'71776572747975696f70617364666768' 1972 IV: h'5477656c7665313231323132' 1973 AES Variant: A128GCM 1974 Scope Flags: 0 1975 Payload Data: h'52656164792047656e65726174652061 1976 2033322062797465207061796c6f6164' 1977 Authentication Tag: h'689b98e649ae3b554e98aa2ae8f801eb' 1978 Payload Ciphertext: h'3a09c1e63fe2097528a78b7c12943354 1979 a563e32648b700c2784e26a990d91f9d' 1981 Figure 18: Example 3: Configuration, Parameters, and Results for the 1982 BCB 1984 A.3.4.2. Abstract Security Block 1986 The abstract security block structure of the BCB's block-type- 1987 specific-data field for this application is as follows. 1989 [1], / Security Target / 1990 2, / Security Context ID - BCB-AES-GCM / 1991 1, / Security Context Flags - Parameters Present / 1992 [2,[2, 1]], / Security Source - ipn:2.1 / 1993 [ / Security Parameters - 3 Parameters / 1994 [1, b'Twelve121212'] / Initialization Vector /, 1995 [2, 1] / AES Variant - AES 128 /, 1996 [4, 0] / Scope Flags - No Additional Scope / 1997 ], 1998 [ / Security Results: 1 Result / 1999 [1, h'689b98e649ae3b554e98aa2ae8f801eb'] / Payload Auth. Tag / 2000 ] 2002 Figure 19: Example 3: BCB Abstract Security Block (CBOR Diagnostic 2003 Notation) 2005 The CBOR encoding of the BCB block-type-specific-data field (the 2006 abstract security block) is 0x8101020182028202018382014c5477656C76653 2007 1323132313282020182040081820150689b98e649ae3b554e98aa2ae8f801eb. 2009 A.3.4.3. Representations 2011 The BCB wrapping this abstract security block is as follows. 2013 [ 2014 12, / type code / 2015 4, / block number / 2016 1, / flags - block must be replicated in every fragment / 2017 0, / CRC type / 2018 h'8101020182028202018382014c5477656C766531323132313282020182040081 2019 820150689b98e649ae3b554e98aa2ae8f801eb', 2020 ] 2022 Figure 20: Example 3: BCB (CBOR Diagnostic Notation) 2024 The CBOR encoding of the BCB block is 0x850c0401005833810102018202820 2025 2018382014c5477656C766531323132313282020182040081820150689b98e649ae3b 2026 554e98aa2ae8f801eb. 2028 A.3.5. Final Bundle 2030 The CBOR encoding of the full output bundle, with the BIB and BCB 2031 added is: 9F88070000820282010282028202018202820201820018281a000f42408 2032 50b030000585a820002010182028203008282010582030082820158202f74b42d8823 2033 4f0a8a98a6c72775ec6511aff3cb5bfc06aa648f5fc40f31ec0d82015820e61385353 2034 ce2b4cce5319bc33326cdc26f4061e76cb21b434c89199a36b00de3850c0401005833 2035 8101020182028202018382014c5477656C76653132313231328202018204008182015 2036 0689b98e649ae3b554e98aa2ae8f801eb85070200004319012c850101000058203a09 2037 c1e63fe2097528a78b7c12943354a563e32648b700c2784e26a990d91f9dFF. 2039 A.4. Example 4: Security Blocks with Full Scope 2041 This example shows the addition of a BIB and BCB to a sample bundle. 2042 A BIB is added to provide integrity over the payload block and a BCB 2043 is added for confidentiality over the payload and BIB. 2045 The integrity scope and additional authentication data will bind the 2046 primary block, target header, and the security header. 2048 A.4.1. Original Bundle 2050 The following diagram shows the original bundle before the security 2051 blocks have been added. 2053 Block Block Block 2054 in Bundle Type Number 2055 +========================================+=======+========+ 2056 | Primary Block | N/A | 0 | 2057 +----------------------------------------+-------+--------+ 2058 | Payload Block | 0 | 1 | 2059 +----------------------------------------+-------+--------+ 2061 Figure 21: Example 4 Original Bundle 2063 A.4.1.1. Primary Block 2065 The primary block used in this example is identical to the primary 2066 block presented in Example 1 Appendix A.1.1.1. 2068 In summary, the CBOR encoding of the primary block is 2069 0x88070000820282010282028202018202820201820018281a000f4240. 2071 A.4.1.2. Payload Block 2073 The payload block used in this example is identical to the payload 2074 block presented in Example 1 Appendix A.1.1.2. 2076 In summary, the CBOR encoding of the payload block is 0x8501010000582 2077 052656164792047656e657261746520612033322062797465207061796c6f6164. 2079 A.4.1.3. Bundle CBOR Representation 2081 A BPv7 bundle is represented as an indefinite-length array consisting 2082 of the blocks comprising the bundle, with a terminator character at 2083 the end. 2085 The CBOR encoding of the original bundle is 0x9f880700008202820102820 2086 28202018202820201820018281a000f42408501010000582052656164792047656e65 2087 7261746520612033322062797465207061796c6f6164ff. 2089 A.4.2. Security Operation Overview 2091 This example provides: 2093 a BIB with the BIB-HMAC-SHA2 security context to provide an 2094 integrity mechanism over the payload block. 2096 a BCB with the BCB-AES-GCM security context to provide a 2097 confidentiality mechanism over the payload block and BIB. 2099 The following diagram shows the resulting bundle after the security 2100 blocks are added. 2102 Block Block Block 2103 in Bundle Type Number 2104 +========================================+=======+========+ 2105 | Primary Block | N/A | 0 | 2106 +----------------------------------------+-------+--------+ 2107 | Bundle Integrity Block (Encrypted) | 11 | 3 | 2108 | OP(bib-integrity, target=1) | | | 2109 +----------------------------------------+-------+--------+ 2110 | Bundle Confidentiality Block | 12 | 4 | 2111 | OP(bcb-confidentiality, targets=1, 3) | | | 2112 +----------------------------------------+-------+--------+ 2113 | Payload Block (Encrypted) | 0 | 1 | 2114 +----------------------------------------+-------+--------+ 2116 Figure 22: Example 4 Resulting Bundle 2118 A.4.3. Bundle Integrity Block 2120 In this example, a BIB is used to carry an integrity signature over 2121 the payload block. The IPPT contains the payload block block-type- 2122 specific data, primary block data, the payload block header, and the 2123 BIB header. That is, all additional headers are included in the 2124 IPPT. 2126 A.4.3.1. Configuration, Parameters, and Results 2128 For this example, the following configuration and security parameters 2129 are used to generate the security results indicated. 2131 This BIB has a single target and includes a single security result: 2132 the calculated signature over the Payload block. 2134 Key: h'1a2b1a2b1a2b1a2b1a2b1a2b1a2b1a2b' 2135 SHA Variant: HMAC 384/384 2136 Scope Flags: 7 (all additional headers) 2137 Primary Block Data: h'88070000820282010282028202018202 2138 820201820018281a000f4240 2139 Payload Data: h'52656164792047656e65726174652061 2140 2033322062797465207061796c6f6164' 2141 Payload Header: h'85010100005820' 2142 BIB Header: h'850b0300005845' 2143 Payload Signature: h'6f56e0f58ec584df34603c75cc055939 2144 00b1a938f23883f119772e1230441d86 2145 9bce6ac9559f721260314424ab14b981 2147 Figure 23: Example 4: Configuration, Parameters, and Results for the 2148 BIB 2150 A.4.3.2. Abstract Security Block 2152 The abstract security block structure of the BIB's block-type- 2153 specific-data field for this application is as follows. 2155 [1], / Security Target / 2156 1, / Security Context ID - BIB-HMAC-SHA2 / 2157 1, / Security Context Flags - Parameters Present / 2158 [2,[2, 1]], / Security Source: ipn:2.1 / 2159 [ / Security Parameters: 2 Parameters / 2160 [1, 6], / SHA Variant - HMAC 384/384 / 2161 [3, 7] / Scope Flags - All additional headers in the SHA Hash / 2162 ], 2163 [ / Security Results: 1 Result / 2164 [1, h'6f56e0f58ec584df34603c75cc05593900b1a938f23883f119772e123044 2165 1d869bce6ac9559f721260314424ab14b981'] 2166 ] 2168 Figure 24: Example 4: BIB Abstract Security Block (CBOR Diagnostic 2169 Notation) 2171 The CBOR encoding of the BIB block-type-specific-data field (the 2172 abstract security block) is 0x810101018202820201828201068203078182015 2173 8306f56e0f58ec584df34603c75cc05593900b1a938f23883f119772e1230441d869b 2174 ce6ac9559f721260314424ab14b981. 2176 A.4.3.3. Representations 2178 The BIB wrapping this abstract security block is as follows. 2180 [ 2181 11, / type code / 2182 3, / block number / 2183 0, / flags / 2184 0, / CRC type / 2185 h'8101010182028202018282010682030781820158306f56e0f58ec584df34603c 2186 75cc05593900b1a938f23883f119772e1230441d869bce6ac9559f7212603144 2187 24ab14b981', 2188 ] 2190 Figure 25: Example 4: BIB (CBOR Diagnostic Notation) 2192 The CBOR encoding of the BIB block is 0x850b0300005845810101018202820 2193 2018282010682030781820158306f56e0f58ec584df34603c75cc05593900b1a938f2 2194 3883f119772e1230441d869bce6ac9559f721260314424ab14b981. 2196 A.4.4. Bundle Confidentiality Block 2198 In this example, a BCB is used encrypt the payload block and the BIB 2199 that provides integrity over the payload. 2201 A.4.4.1. Configuration, Parameters, and Results 2203 For this example, the following configuration and security parameters 2204 are used to generate the security results indicated. 2206 This BCB has two targets: the payload block and BIB. Four security 2207 results are generated: cipher text which replaces the plain text 2208 block-type-specific data of the payload block, cipher text to encrypt 2209 the BIB, and authentication tags for both the payload block and BIB. 2211 Key: h'71776572747975696f70617364666768 2212 71776572747975696f70617364666768' 2213 IV: h'5477656c7665313231323132' 2214 AES Variant: A256GCM 2215 Scope Flags: 7 (All additional headers) 2216 Payload Data: h'52656164792047656e65726174652061 2217 2033322062797465207061796c6f6164' 2218 BIB Data: h'52656164792047656E65726174652061 2219 2033322062797465207061796C6F6164' 2220 BIB 2221 Authentication Tag: h'92bc2665e9f04350c5974f023929dd62' 2222 Payload Block 2223 Authentication Tag: h'865bc14b3910d6c53e95fdc65aa601fd' 2224 Payload Ciphertext: h'90eab64575930498d6aa654107f15e96 2225 319bb227706000abc8fcac3b9bb9c87e' 2226 BIB Ciphertext: h'438ed6208eb1c1ffb94d952175167df0 2227 902a815f2276222e1d0208c628e2c926 2228 2a0c438fc300190dbf5954ae4f84f748 2229 64e58ed1e39043633142ad2559e0e3a9 2230 c9cbce5c2d' 2232 Figure 26: Example 4: Configuration, Parameters, and Results for the 2233 BCB 2235 A.4.4.2. Abstract Security Block 2237 The abstract security block structure of the BCB's block-type- 2238 specific-data field for this application is as follows. 2240 [3, 1], / Security Target / 2241 2, / Security Context ID - BCB-AES-GCM / 2242 1, / Security Context Flags - Parameters Present / 2243 [2,[2, 1]], / Security Source - ipn:2.1 / 2244 [ / Security Parameters - 3 Parameters / 2245 [1, h'5477656c7665313231323132'] / Initialization Vector /, 2246 [2, 3] / AES Variant - AES 256 /, 2247 [4, 7] / Scope Flags - All headers in SHA hash / 2248 ], 2249 [ / Security Results: 2 Results / 2250 [1, h'865bc14b3910d6c53e95fdc65aa601fd'], / Payload Auth. Tag / 2251 [1, h'92bc2665e9f04350c5974f023929dd62'] / BIB Auth. Tag / 2252 ] 2254 Figure 27: Example 4: BCB Abstract Security Block (CBOR Diagnostic 2255 Notation) 2257 The CBOR encoding of the BCB block-type-specific-data field (the 2258 abstract security block) is 0x820301020182028202018382014c5477656C766 2259 531323132313282020382040782820150d0b506cc2e5ede57b36e6c52791457008201 2260 50865bc14b3910d6c53e95fdc65aa601fd. 2262 A.4.4.3. Representations 2264 The BCB wrapping this abstract security block is as follows. 2266 [ 2267 12, / type code / 2268 2, / block number / 2269 1, / flags - block must be replicated in every fragment / 2270 0, / CRC type / 2271 h'820301020182028202018382014c5477656C7665313231323132820203820407 2272 82820150d0b506cc2e5ede57b36e6c5279145700820150865bc14b3910d6c53e 2273 95fdc65aa601fd', 2274 ] 2276 Figure 28: Example 4: BCB (CBOR Diagnostic Notation) 2278 The CBOR encoding of the BCB block is 0x850c0201005847820301020182028 2279 202018382014c5477656C766531323132313282020382040782820150d0b506cc2e5e 2280 de57b36e6c5279145700820150865bc14b3910d6c53e95fdc65aa601fd. 2282 A.4.5. Final Bundle 2284 The CBOR encoding of the full output bundle, with the security blocks 2285 added and payload block and BIB encrypted is: 9F880700008202820102820 2286 28202018202820201820018281a000f4240850b0300005845438ed6208eb1c1ffb94d 2287 952175167df0902a815f2276222e1d0208c628e2c9262a0c438fc300190dbf5954ae4 2288 f84f74864e58ed1e39043633142ad2559e0e3a9c9cbce5c2d 850c020100584782030 2289 1020182028202018382014c5477656C766531323132313282020382040782820150d0 2290 b506cc2e5ede57b36e6c5279145700820150865bc14b3910d6c53e95fdc65aa601fd8 2291 501010000582090eab64575930498d6aa654107f15e96319bb227706000abc8fcac3b 2292 9bb9c87eFF. 2294 Appendix B. Acknowledgements 2296 The following participants contributed useful review and analysis of 2297 these security contexts: Amy Alford of the Johns Hopkins University 2298 Applied Physics Laboratory. 2300 Authors' Addresses 2302 Edward J. Birrane, III 2303 The Johns Hopkins University Applied 2304 Physics Laboratory 2305 11100 Johns Hopkins Rd. 2306 Laurel, MD 20723 2307 US 2309 Phone: +1 443 778 7423 2310 Email: Edward.Birrane@jhuapl.edu 2312 Alex White 2313 The Johns Hopkins University Applied 2314 Physics Laboratory 2315 11100 Johns Hopkins Rd. 2316 Laurel, MD 20723 2317 US 2319 Phone: +1 443 778 0845 2320 Email: Alex.White@jhuapl.edu 2322 Sarah Heiner 2323 The Johns Hopkins University Applied 2324 Physics Laboratory 2325 11100 Johns Hopkins Rd. 2326 Laurel, MD 20723 2327 US 2329 Phone: +1 240 592 3704 2330 Email: Sarah.Heiner@jhuapl.edu