-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
simonarnell
wants to merge
17
commits into
gchq:master
Choose a base branch
from
ConfiguredThings:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+773
−16
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Adding MQTT publish operation
Libhydrogen support
This comment was marked as resolved.
This comment was marked as resolved.
2 tasks
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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](https://private-user-images.githubusercontent.com/14029547/408626951-ee316362-abcc-4277-aee8-b23555a76098.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NTk5MTksIm5iZiI6MTczODk1OTYxOSwicGF0aCI6Ii8xNDAyOTU0Ny80MDg2MjY5NTEtZWUzMTYzNjItYWJjYy00Mjc3LWFlZTgtYjIzNTU1YTc2MDk4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA3VDIwMjAxOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA3MWU5OGRlMTZlN2U5ZGZlNGU1OWI3NmI1NTY2OWEzOWUwMzNkZGJiMTI0NWM4ZDYyNDQ3ZWEyMTM1Yzg0MGEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.MfSz8IMzaF4tym0WIastoPsyNWDvXo62GlsYEJyd-DA)
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.