Traditional approaches to access control generally require one point of trust, e.g., a centralized server managed by a data custodian or a hardware security module. NuCypher presents a departure from this trust-dependent paradigm to introduce a decentralized network for managing permissions over encrypted data, powered by threshold proxy re-encryption. With NuCypher, data originally encrypted under a public key can be re-encrypted by a group of proxies in the network, each of them only transforming a “fragment” of the original ciphertext. In such a system the data owner can maintain full control over who has access to their data. Blockchain is used by the nucypher network for coordination of nodes and for outlining access permissions, making the access control auditable.
What if vehicle owners could securely share their vehicle onboard diagnostics data (OBD) with entities in an auditable fashion while maintaining full control of data by being able to grant and revoke access to the data? One example could be an Insurance company. Sharing the data could yield cheaper insurance rates, provide predictive maintenance analytics, or resolve a conflict regarding a vehicular accident. NuCypher’s proxy re-encryption technology and decentralized proxy network make this possibility a reality.
What it does
Alicia has a vehicle with an onboard diagnostics (OBD) device that measure various components and outputs this data in encrypted form. At some point in the future, Alicia may want to share this data with her Insurance company perhaps for reduced insurance premiums or to resolve a dispute regarding an accident that she was involved in. What if this could be done in a performant manner and such that Alice maintains full control over who can and can’t access her data
Since Alicia thinks that she may want to share this data in the future, she uses NuCypher to create a policy public key for the OBD device to use, so she can read and delegate access to the encrypted data as she sees fit. The OBD device uses this public key to produce encrypted records of sensor measurements; this encrypted data is stored using MQTT and then pulled into a database - alternatively, it could be directly stored in a database which can be located on some storage service (e.g., IPFS, S3, whatever).
At some point, she wants to share this information her Insurance company (Bob). Once she obtains her Insurer's public keys, she can create a policy in the NuCypher network to grant access to him. Through the power of NuCypher’s re-encryption network, her Insurer can now obtain the encrypted data (which is populated by the OBD device) and request a re-encrypted ciphertext for each measurement, which can subsequently be decrypted with the Insurer's private key. Additionally, the Insurer’s access can be revoked by Alicia at any point which will disallow access to real-time data from the revocation time forward.
This simple use case showcases many interesting and distinctive aspects of NuCypher:
- Alicia can create policy public keys before knowing who can be the potential consumers.
- Alicia, or any entity with the policy public key (e.g., the OBD device), can produce encrypted data that belongs to the policy. Again, this can happen before granting access to any consumer.
- As a consequence of the previous point, Data Sources, like the OBD device, are completely unaware of the recipients. In their mind, they are producing data for Alicia.
- Alicia never interacts directly with the Insurer: she only needs the Insurer's public key.
- Alicia only interacts with the NuCypher network for granting access to the Insurer. After this, she can even disappear from the face of the Earth.
- The Insurer never interacts with Alicia or the OBD device: he only needs the encrypted data and some policy metadata.
How we built it
We built the demo on top of NuCypher’s proxy re-encryption network library called
In order to obtain real vehicular diagnostics data, we developed a script to be run in a Raspberry Pi connected to an ODBII device. The script can read data from the onboard diagnostic bus of the car and encrypt it directly. We have also created a session around the Ada Byron research building in Malaga, Spain, that can be played back to see the code in action without the need for an actual OBDII device. The car service uses MQTT to communicate with all other parties and only needs the public key of the owner of the data, Alicia, to start sending the encrypted data.
Each of Alicia’s OBD diagnostic values at a particular timestamp is encrypted using a symmetric key, and the symmetric key is encrypted using a policy public key. This data is pushed to MQTT and is then pulled by an Enrico subscriber to a database. When Bob wants to gain access to the sensor data, he must use nucypher’s network of proxies to re-encrypt each set of measurements (each row in the database) so that it is made decryptable by Bob’s private key, all without the data ever being decrypted or exposed to the proxy, as is typical for regular public key encryption.
Challenges we ran into
NuCypher’s proxy re-encryption network is not yet public. However, we have been testing it using an internal federated testnet network. Unfortunately, the federated proxy network went through an overhaul and introduced changes that prevented the network from interacting with the demo. Instead, we use a single local proxy node to perform the re-encryption. Even though the node is local it acts the same way as it would within the nucypher network - the only difference being that network only has one node and requests are made to a local IP.
Accomplishments that we're proud of
Integrating all of these various technologies was challenging.
What we learned
The OBD-II interface and the types of data that could be collected by vehicles was something new for us. MQTT provided a way for us to have the Raspberry time send real time data from the OBD-II device in the car to the demo. We also simulate the real-time collection of data and recorded driving session. Also, we used the Plotly Dash library to provide a UI for the demo which was something we learned on the fly.
What's next for OBDX
Code cleanup Better visualizations of data by Bob Use the demo to showcase the power of nucypher’s proxy re-encryption technology with projects focused on the vehicle IoT space. These projects could integrate nucypher’s technology into their stack - eg. the AutoPi project: https://www.autopi.io/