-
Notifications
You must be signed in to change notification settings - Fork 16
Access Control
NDN-Lite provides application support including security bootstrapping, service discovery, access control, and etc. In this document, we describe the spec of the access control protocol implemented in NDN-Lite.
The access control module aims to
- provide data confidentiality and access control and thus improve the security and privacy of the system.
- provide an automatic and lightweight keys distribution and management implementation
As shown in the figure, the NDN IoT Access Control is as follow.
-
Encryption Key (EK) Negotiation Between Encryptor and Controller
To obtain the key for the encryptor to encrypt content, a data producer (called encryptor in NDN-Lite Access Control) will negotiate the
encryption key (EK)
with the system controller. The encryptor first sends a EK Request Interest containing encryptor's ECDH pub key bits and the controller will check the access control policy and replies the Data packet containing corresponding encryption keys encrypted with encrytor's AES key. This AES key is derived and obtained from the security bootstrapping. -
Decryption Key (DK) Distribution Between Decryptor and Controller
Notice that NDN-Lite Access Control uses per service level symmetric key for content encryption and decryption. Therefore, we have
EK == DK
.To obtain the key for the decryptor to decrypt content, a data consumer (called decryptor in NDN-Lite Access Control) will negotiate an
ephemeral key
with the system controller and system controller will encrypt the EK with the ephemeral key and deliver it to the decryptor. The encryption in the second step uses AES key between controller and decryptor. This key material is derived and obtained from the security bootstrapping.
/**
* Access control protocol spec:
*
* Get EKEY from the controller:
* ==============
* Interest Name: /[home-prefix]/NDN_SD_AC/NDN_SD_AC_EK/[service-id]
* Params: MustBeFresh
* Sig Info:
* Key locator: /[home-prefix]/[room]/[device-id]
* Sig Value:
* ECDSA Signature by identity key
* ==============
* This Interest will be sent right after security bootstrapping.
* Repied Data:
* ==============
* Content:
* T=TLV_AC_AES_IV L=? V=bytes: AES IV
* T=TLV_AC_ENCRYPTED_PAYLOAD L=? V=bytes: AES encrypted payload, which is the EKEY for the service
* ==============
*
* Get DKEY from the controller:
* ==============
* Interest Name: /[home-prefix]/NDN_SD_AC/NDN_SD_AC_DK/[service-id]
* Params: MustBeFresh
* Sig Info:
* Key locator: /[home-prefix]/[room]/[device-id]
* Sig Value:
* ECDSA Signature by identity key
* ==============
* This Interest will be sent right after security bootstrapping.
* Repied Data
* ==============
* Content:
* T=TLV_AC_AES_IV L=? V=bytes: AES IV
* T=TLV_AC_ENCRYPTED_PAYLOAD L=? V=bytes: AES encrypted payload
* ==============
*/
EK Negotiation:
Encryptor Controller
| |
| EK Request Interest |
| --------------------------------------> |
| |
| EK Request Response Data |
| <-------------------------------------- |
DK Negotiation:
Decryptor Controller
| |
| DK Request Interest |
| --------------------------------------> |
| |
| DK Request Response Data |
| <-------------------------------------- |
Data Consumption:
Decryptor Encryptor
| |
| Content Interest |
| --------------------------------------> |
| |
| Encrypted Content Data |
| <-------------------------------------- |
After receiving the DK request Interest, the controller should
- Check the access control policy to see whether the decryptor is authorized to decrypt the content
- The controller uses the AES KEY to encrypt the required EK
- The controller gets the lifetime of the EK and calculated the lifetime of DK
DK_lifetime = EK_generated_time + EK_liftime - current_time
- The controller replies the encrypted EK
- AES Key: 128 bits from HKDF
- AES IV: derived from HKDF
- AES Encryption: CBC mode
When Data content is supposed to be encrypted, NDN-Lite defines the encrypted content TLV.
Content = ENCRYPTED_CONTENT_TLV Length
AC_Key_ID AES_IV
Encrypted_Payload
AC_Key_ID = TLV_NAME_TYPE Length
NameValue
AES_IV = TLV_AES_IV_TYPE Length
Bytes
Encrypted_Payload = TLV_ENCRYPTED_PAYLOAD_TYPE Length
Bytes
When the consumer receives the Data packet, the consumer should
- check whether it has the corresponding DK or not
- if yes, the consumer can directly decrypt the content
- if no, the consumer should try to apply for the key from the controller using NDN-Lite Access Control protocol.
- after obtaining the DK, the consumer should cache the decryption until the key expires.