Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for LibHydrogen-based digital signatures and MQTT publishing #1970

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

simonarnell
Copy link

@simonarnell simonarnell commented Jan 31, 2025

As part of our funded contribution to the UK's Digital Security by Design project, we have developed an integration of the digital signing of JSON models produced by the Configured Things platform to securely supply configuration updates to IoT devices running on the CHERIoT platform. The wider application here includes the hardware-assured secure distribution of configuration across software compartments, if interested there are more details shared in a CHERIoT blog article.

To remove the tight coupling between the Configured Things platform and CHERIoT, we have developed a set of CyberChef plugins that allow JSON models to be signed and published from CyberChef to a CHERIoT board via any third party MQTT broker.

CHERIoT boards are microcontrollers and therefore cryptography needs to have limited computational requirements. We therefore selected the C-based LibHydrogen crypt library. Having successfully ported LibHydrogen to CHERIoT and upstreamed the changes jedisct1/libhydrogen#156, we have created a LibHydrogen Web Assembly to enable binding of this C library with non-C applications such as our own Node.js-based platform. The LibHydrogen Sign CyberChef operation uses this WASM to sign an ArrayBuffer and exposes the signature as a JSON-encoded object.

The MQTT Publish CyberChef operation utilises the MQTT.js library to publish MQTT messages over a web socket to a given MQTT broker.

We wish to upstream these operations to enable wider use of MQTT and LibHydrogen within the CyberChef user base. This contribution also includes two glue operations that allows arbitrary JSON to be serialised to an ArrayBuffer and for a digitally signed object to be serialised into a format consistent with how our platform does so to enable compatibility between CyberChef's output and our own.

The following is a screenshot of the operations working together locally:
Screenshot 2025-01-31 at 16 37 51

We will be demonstrating this end-to-end capability working on Sonata CHERIoT boards at the UK’s Secure by Design Showcase 2025 event in February.

@simonarnell

This comment was marked as resolved.

@simonarnell
Copy link
Author

Ok this seems good on my end, checks now seem to be failing due to a dependency issue on the UI tests stage of the "main" GitHub action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant