Alexander Afanasyev | 6e64ac9 | 2018-06-14 17:25:38 -0400 | [diff] [blame] | 1 | NAC Specification |
| 2 | ================= |
| 3 | |
Alexander Afanasyev | e96538a | 2018-06-13 20:32:53 -0400 | [diff] [blame] | 4 | .. figure:: _static/nac-overview.png |
| 5 | :alt: Overview of NAC entities |
| 6 | :align: center |
Alexander Afanasyev | 0db0feb | 2018-06-13 20:33:10 -0400 | [diff] [blame] | 7 | |
| 8 | Terminology |
| 9 | ----------- |
| 10 | |
| 11 | +-----------------+------------------------------------------------------------------------------------------+ |
| 12 | | Term | Description | |
| 13 | +=================+==========================================================================================+ |
| 14 | | KEK | Key Encryption Key (RSA public key) | |
| 15 | +-----------------+------------------------------------------------------------------------------------------+ |
| 16 | | KDK | Key Decryption Key (RSA private key) | |
| 17 | +-----------------+------------------------------------------------------------------------------------------+ |
| 18 | | CK | Content Key (AES symmetric key) | |
| 19 | +-----------------+------------------------------------------------------------------------------------------+ |
Alexander Afanasyev | 1a21e10 | 2018-06-13 20:33:21 -0400 | [diff] [blame] | 20 | | CK data | Data packet carrying a KDK-encrypted CK as payload | |
Alexander Afanasyev | 0db0feb | 2018-06-13 20:33:10 -0400 | [diff] [blame] | 21 | +-----------------+------------------------------------------------------------------------------------------+ |
| 22 | | Access Manager | (Data Owner) Entity that control access to the data associated with the namespace | |
| 23 | +-----------------+------------------------------------------------------------------------------------------+ |
| 24 | | Encryptor | (Producer) Entity that encrypts data based on namespace association | |
| 25 | +-----------------+------------------------------------------------------------------------------------------+ |
| 26 | | Decryptor | (Consumer) Entity that decrypts data based on namespace association | |
| 27 | +-----------------+------------------------------------------------------------------------------------------+ |
| 28 | |
| 29 | EncryptedContent |
Alexander Afanasyev | e96538a | 2018-06-13 20:32:53 -0400 | [diff] [blame] | 30 | ---------------- |
Alexander Afanasyev | 0db0feb | 2018-06-13 20:33:10 -0400 | [diff] [blame] | 31 | |
Junxiao Shi | dddc19a | 2020-08-10 13:13:06 -0600 | [diff] [blame] | 32 | The ``EncryptedContent`` element contains encrypted blob, optional Initialization Vector (for AES CBC encryption), |
Alexander Afanasyev | 0db0feb | 2018-06-13 20:33:10 -0400 | [diff] [blame] | 33 | optional EncryptedPayloadKey, and Name elements. |
| 34 | |
Junxiao Shi | dddc19a | 2020-08-10 13:13:06 -0600 | [diff] [blame] | 35 | .. code-block:: abnf |
Alexander Afanasyev | 0db0feb | 2018-06-13 20:33:10 -0400 | [diff] [blame] | 36 | |
Junxiao Shi | dddc19a | 2020-08-10 13:13:06 -0600 | [diff] [blame] | 37 | EncryptedContent = ENCRYPTED-CONTENT-TYPE TLV-LENGTH |
| 38 | EncryptedPayload |
| 39 | [InitializationVector] |
| 40 | [EncryptedPayloadKey] |
| 41 | [Name] |
Alexander Afanasyev | 0db0feb | 2018-06-13 20:33:10 -0400 | [diff] [blame] | 42 | |
Junxiao Shi | dddc19a | 2020-08-10 13:13:06 -0600 | [diff] [blame] | 43 | EncryptedPayload = ENCRYPTED-PAYLOAD-TYPE TLV-LENGTH *OCTET |
| 44 | InitializationVector = INITIALIZATION-VECTOR-TYPE TLV-LENGTH *OCTET |
| 45 | EncryptedPayloadKey = ENCRYPTED-PAYLOAD-KEY-TYPE TLV-LENGTH *OCTET |
Alexander Afanasyev | e96538a | 2018-06-13 20:32:53 -0400 | [diff] [blame] | 46 | |
Alexander Afanasyev | e96538a | 2018-06-13 20:32:53 -0400 | [diff] [blame] | 47 | Access Manager |
| 48 | -------------- |
| 49 | |
| 50 | .. figure:: _static/access-manager.png |
| 51 | :alt: Access Manager |
| 52 | :align: center |
| 53 | |
Alexander Afanasyev | 1a21e10 | 2018-06-13 20:33:21 -0400 | [diff] [blame] | 54 | Access Manager controls decryption policy by publishing granular per-namespace access policies in the form of key encryption (KEK, plaintext public) and key decryption (KDK, encrypted private key) key pair. |
Alexander Afanasyev | e96538a | 2018-06-13 20:32:53 -0400 | [diff] [blame] | 55 | |
| 56 | KEK is published as a single data packet with name ``/[access-namespace]/NAC/[dataset]/KEK/[key-id]``, following the following format: |
| 57 | |
Junxiao Shi | dddc19a | 2020-08-10 13:13:06 -0600 | [diff] [blame] | 58 | .. code-block:: abnf |
Alexander Afanasyev | e96538a | 2018-06-13 20:32:53 -0400 | [diff] [blame] | 59 | |
Junxiao Shi | dddc19a | 2020-08-10 13:13:06 -0600 | [diff] [blame] | 60 | Kek = DATA-TYPE TLV-LENGTH |
Davide Pesavento | 3c7f645 | 2021-10-02 04:06:26 -0400 | [diff] [blame] | 61 | Name ; /[access-namespace]/NAC/[dataset]/KEK/[key-id] |
Junxiao Shi | dddc19a | 2020-08-10 13:13:06 -0600 | [diff] [blame] | 62 | MetaInfo ; ContentType = KEY, FreshnessPeriod = 1 hour default value |
| 63 | KekContent |
| 64 | DataSignature |
Alexander Afanasyev | e96538a | 2018-06-13 20:32:53 -0400 | [diff] [blame] | 65 | |
Junxiao Shi | dddc19a | 2020-08-10 13:13:06 -0600 | [diff] [blame] | 66 | KekContent = CONTENT-TYPE-TLV TLV-LENGTH |
| 67 | *OCTET ; = BER of public key /[access-namespace]/NAC/[dataset]/KEY/[key-id] |
Alexander Afanasyev | e96538a | 2018-06-13 20:32:53 -0400 | [diff] [blame] | 68 | |
Alexander Afanasyev | e96538a | 2018-06-13 20:32:53 -0400 | [diff] [blame] | 69 | Different versions of KDK are published, encrypted by the public key of the individual authorized member, following naming convention: ``/[access-namespace]/NAC/[dataset]/KDK/[key-id]/ENCRYPTED-BY/<authorized-member>/KEY/[member-key-id]``. KDK is published in the following format: |
| 70 | |
Junxiao Shi | dddc19a | 2020-08-10 13:13:06 -0600 | [diff] [blame] | 71 | .. code-block:: abnf |
Alexander Afanasyev | e96538a | 2018-06-13 20:32:53 -0400 | [diff] [blame] | 72 | |
Junxiao Shi | dddc19a | 2020-08-10 13:13:06 -0600 | [diff] [blame] | 73 | Kdk = DATA-TYPE TLV-LENGTH |
Davide Pesavento | 3c7f645 | 2021-10-02 04:06:26 -0400 | [diff] [blame] | 74 | Name ; /[access-namespace]/NAC/[dataset]/KDK/[key-id]/ENCRYPTED-BY/<authorized-member>/KEY/[member-key-id] |
Junxiao Shi | dddc19a | 2020-08-10 13:13:06 -0600 | [diff] [blame] | 75 | MetaInfo ; ContentType = BLOB, FreshnessPeriod = 1 hour default value |
| 76 | KdkContent |
| 77 | DataSignature |
Alexander Afanasyev | e96538a | 2018-06-13 20:32:53 -0400 | [diff] [blame] | 78 | |
Junxiao Shi | dddc19a | 2020-08-10 13:13:06 -0600 | [diff] [blame] | 79 | KdkContent = CONTENT-TYPE-TLV TLV-LENGTH |
| 80 | EncryptedContent |
| 81 | |
| 82 | Within the ``EncryptedContent`` element, |
| 83 | |
Davide Pesavento | 135cd2d | 2023-01-19 19:06:08 -0500 | [diff] [blame] | 84 | * ``EncryptedPayload`` contains `SafeBag <https://docs.named-data.net/ndn-cxx/0.8.1/specs/safe-bag.html>`__ of private key ``/[access-namespace]/NAC/[dataset]/KEY/[key-id]`` |
Junxiao Shi | dddc19a | 2020-08-10 13:13:06 -0600 | [diff] [blame] | 85 | * ``EncryptedPayloadKey`` contains password for SafeBag, encrypted by public key ``/<authorized-member>/KEY/[member-key-id]`` |
| 86 | * ``InitializationVector`` and ``Name`` must be omitted |
Alexander Afanasyev | 1a21e10 | 2018-06-13 20:33:21 -0400 | [diff] [blame] | 87 | |
| 88 | Encryptor |
| 89 | --------- |
| 90 | |
| 91 | .. figure:: _static/encryptor.png |
| 92 | :alt: Encryptor |
| 93 | :align: center |
| 94 | |
| 95 | Encryptor encrypts (synchronous operation) the requested content and returns an ``EncryptedContent`` element with values: |
| 96 | |
| 97 | :: |
| 98 | |
| 99 | EncryptedPayload = AES CBC encrypted blob |
Junxiao Shi | dddc19a | 2020-08-10 13:13:06 -0600 | [diff] [blame] | 100 | InitializationVector = Random initial vector for AES CBC encryption |
Davide Pesavento | 3c7f645 | 2021-10-02 04:06:26 -0400 | [diff] [blame] | 101 | EncryptedPayloadKey (not set) |
Junxiao Shi | dddc19a | 2020-08-10 13:13:06 -0600 | [diff] [blame] | 102 | Name = Prefix of ContentKey (CK) data packet /[ck-prefix]/CK/[ck-id] |
Alexander Afanasyev | 1a21e10 | 2018-06-13 20:33:21 -0400 | [diff] [blame] | 103 | |
| 104 | During initialization or when requested by the application, the Encryptor (re-)generates a random key for AES CBC encryption. |
| 105 | The encrypted version of this key is published (asynchronous operation, contingent on successful retrieval and validation of KEK) as a data packet, following the naming convention: ``/[ck-prefix]/CK/[ck-id]/ENCRYPTED-BY/[access-namespace]/NAC/[dataset]/KEK/[key-id]``. CK data is published in the following format: |
| 106 | |
Junxiao Shi | dddc19a | 2020-08-10 13:13:06 -0600 | [diff] [blame] | 107 | .. code-block:: abnf |
Alexander Afanasyev | 1a21e10 | 2018-06-13 20:33:21 -0400 | [diff] [blame] | 108 | |
Junxiao Shi | dddc19a | 2020-08-10 13:13:06 -0600 | [diff] [blame] | 109 | CkData = DATA-TYPE TLV-LENGTH |
Davide Pesavento | 3c7f645 | 2021-10-02 04:06:26 -0400 | [diff] [blame] | 110 | Name ; /[ck-prefix]/CK/[ck-id]/ENCRYPTED-BY/[access-namespace]/NAC/[dataset]/KEK/[key-id] |
Junxiao Shi | dddc19a | 2020-08-10 13:13:06 -0600 | [diff] [blame] | 111 | MetaInfo ; ContentType = BLOB, FreshnessPeriod = 1 hour default value |
| 112 | CkContent |
| 113 | DataSignature |
Alexander Afanasyev | 1a21e10 | 2018-06-13 20:33:21 -0400 | [diff] [blame] | 114 | |
Junxiao Shi | dddc19a | 2020-08-10 13:13:06 -0600 | [diff] [blame] | 115 | CkContent = CONTENT-TYPE-TLV TLV-LENGTH |
| 116 | EncryptedContent |
| 117 | |
| 118 | Within the ``EncryptedContent`` element, |
| 119 | |
| 120 | * ``EncryptedPayload`` contains ContentKey encrypted by public key ``/[access-namespace]/NAC/[dataset]/KEK/[key-id]`` |
| 121 | * ``EncryptedPayloadKey``, ``InitializationVector``, and ``Name`` must be omitted |
| 122 | |
Alexander Afanasyev | ff3ee9f | 2018-06-13 20:33:30 -0400 | [diff] [blame] | 123 | Decryptor |
| 124 | --------- |
| 125 | |
| 126 | .. figure:: _static/decryptor.png |
| 127 | :alt: Decryptor |
| 128 | :align: center |
| 129 | |
| 130 | Encryptor decrypts (asynchronous operation, contingent on successful retrieval of CK data, KDK, and decryption of both) the supplied ``EncryptedContent`` element. |
Junxiao Shi | dddc19a | 2020-08-10 13:13:06 -0600 | [diff] [blame] | 131 | |
| 132 | TLV-TYPE number assignments |
| 133 | --------------------------- |
| 134 | |
Davide Pesavento | 135cd2d | 2023-01-19 19:06:08 -0500 | [diff] [blame] | 135 | +----------------------------------------+------------------+------------------+ |
| 136 | | Type | Assigned number | Assigned number | |
| 137 | | | (decimal) | (hexadecimal) | |
| 138 | +========================================+==================+==================+ |
| 139 | | EncryptedContent | 130 | 0x82 | |
| 140 | +----------------------------------------+------------------+------------------+ |
| 141 | | EncryptedPayload | 132 | 0x84 | |
| 142 | +----------------------------------------+------------------+------------------+ |
| 143 | | InitializationVector | 133 | 0x85 | |
| 144 | +----------------------------------------+------------------+------------------+ |
| 145 | | EncryptedPayloadKey | 134 | 0x86 | |
| 146 | +----------------------------------------+------------------+------------------+ |