Messaging protected with symmetric key encryption over distributed ledger

Masked Authenticated Messaging (MAM)

IOTA Masked Authenticated Messaging makes it possible for sensors and other devices to encrypt entire data streams and securely anchor those into the IOTA Tangle in a quantum proof fashion. Only authorized parties will be able to read and reconstruct the entire data stream. In essence it works a lot like a radio where only those with the right frequency can listen in, in MAM only those with the right channel IDs get access to the data. More information about MAM can be read on IOTA development roadmap.

Get started

First, update your RuuviTags to the hackathon firmware with your phone. The full firmware contains complete hex package, you can use it if you want to have a connection to RuuviTag with developer shield. Instructions on how to upload the firmware can be found on DFU page.

We have made a NodeJS program which listens to incoming Bluetooth advertisements and tries to automatically connect to anything which has Nordic UART service available. The connection sometimes fails, and if there is an exception while program is running you might have to restart your bluetooth stack using sudo hciconfig hci0 restart. The program is tested both on Debian and Raspberry Pi running Rasbian.

Run “node example.js”, you will be given and command prompt where you can send commands to the Connected RuuviTag. If you send “4”, RuuviTag will read the temperature, humidiy and pressure sensors and send the values in plain text encrypted by MAM. Program will receive the message in series of chunks and reassemble the chunks into a MAM payload. MAM payload is then published to Tangle. Destination address is hardcoded into javascript example file, you can change the address to suit your needs.

How does it work?

RuuviTag starts advertising itself on boot and keeps advertising until a BLE connection is made. Program will send a predefined data packet when command is given through command line interface. RuuviTag parses this package and replies with plaintext package with message “INIT MAM”. After a few seconds the MAM encryption is complete on RuuviTags side and and the message is split into chunks which will be sent to connected device. You can follow the progress of the program by checking the RED LED: Led is on when there is activity on RuuviTag. You’ll see that LED is on for a few seconds while message is being processed and then led starts blinking while message is transmitted in chunks.

Once transmission is complete, RuuviTag goes back to sleep to conserve power. You can disconnect and reconnect later on to your RuuviTag and send “4” again to get another MAM message. You can check the messages in the iotasearch service.

What can I do with it?

The demonstration allows you to store environmental data into IOTA Tangle, protected with MAM. If you have an use case in your mind we’ll be happy to help you to implement any additional features you’ll require on RuuviTag.

Messaging protected with symmetric key encryption over distributed ledger was originally published on The IOTA-News Community curates, examines, and summarizes news from external services while producing its own original material. Copyrights from external sources will be credited as they pertain to their corresponding owners. The purpose is to make use of 3rd party content or pictures as either allusion or promotional endorsement of mentioned sites. If you have a claim of copyright infringement with respect to material, please mail to support[at] is a community run website and is NOT affiliated with the IOTA Foundation in any way.

You might also like

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. AcceptRead More