MAXREFDES143#: DeepCover Embedded Security in IoT Authenticated Sensing & Notification
Dependencies: MaximInterface mbed
The MAXREFDES143# is an Internet of Things (IoT) embedded security reference design, built to protect an industrial sensing node by means of authentication and notification to a web server. The hardware includes a peripheral module representing a protected sensor node monitoring operating temperature and remaining life of a filter (simulated through ambient light sensing) and an mbed shield representing a controller node responsible for monitoring one or more sensor nodes. The design is hierarchical with each controller node communicating data from connected sensor nodes to a web server that maintains a centralized log and dispatches notifications as necessary. The mbed shield contains a Wi-Fi module, a DS2465 coprocessor with 1-Wire® master function, an LCD, LEDs, and pushbuttons. The protected sensor node contains a DS28E15 authenticator, a DS7505 temperature sensor, and a MAX44009 light sensor. The mbed shield communicates to a web server by the onboard Wi-Fi module and to the protected sensor node with I2C and 1-Wire. The MAXREFDES143# is equipped with a standard shield connector for immediate testing using an mbed board such as the MAX32600MBED#. The simplicity of this design enables rapid integration into any star-topology IoT network requiring the heightened security with low overhead provided by the SHA-256 symmetric-key algorithm.
More information about the MAXREFDES143# is available on the Maxim Integrated website.
Revision 18:6fbf7e7b6ab6, committed 2016-08-10
- Comitter:
- IanBenzMaxim
- Date:
- Wed Aug 10 08:19:00 2016 -0500
- Parent:
- 17:41be4896ed6d
- Child:
- 19:b8b0cd35f7b4
- Commit message:
- Updated following downstream restructuring in OneWire library.
Changed in this revision
--- a/Factory.cpp Thu Jul 21 11:06:13 2016 -0500
+++ b/Factory.cpp Wed Aug 10 08:19:00 2016 -0500
@@ -78,16 +78,16 @@
DS28E15_22_25::BlockProtection protectionStatus;
bool result;
// Read block protections
- result = (sensorNode.ds28e15_22_25.readBlockProtection(blockNum, protectionStatus) == OneWireSlave::Success);
+ result = (sensorNode.ds28e15.readBlockProtection(blockNum, protectionStatus) == OneWireSlave::Success);
// Check if invalid protections are set
if (result)
result = ((protectionStatus.statusByte() & ~(desiredProtection.statusByte())) == 0x00);
// Load secret into scratchpad
if (result)
- result = (sensorNode.ds28e15_22_25.writeScratchpad(validSecret ? masterSecret : invalidMasterSecret) == OneWireSlave::Success);
+ result = (sensorNode.ds28e15.writeScratchpad(validSecret ? masterSecret : invalidMasterSecret) == OneWireSlave::Success);
// Load master secret from scratchpad without locking
if (result)
- result = (sensorNode.ds28e15_22_25.loadSecret(false) == OneWireSlave::Success);
+ result = (sensorNode.ds28e15.loadSecret(false) == OneWireSlave::Success);
// Setup is complete if not using a valid secret
if (!validSecret)
@@ -100,19 +100,19 @@
// Read page data
if (result)
- result = (sensorNode.ds28e15_22_25.readPage(sensorNode.authData.pageNum, pageData, false) == OneWireSlave::Success);
+ result = (sensorNode.ds28e15.readPage(sensorNode.authData.pageNum, pageData, false) == OneWireSlave::Success);
// Load partial secret into scratchpad
if (result)
- result = (sensorNode.ds28e15_22_25.writeScratchpad(partialSecret) == OneWireSlave::Success);
+ result = (sensorNode.ds28e15.writeScratchpad(partialSecret) == OneWireSlave::Success);
// Compute secret
if (result)
- result = (sensorNode.ds28e15_22_25.computeSecret(sensorNode.authData.pageNum, false) == OneWireSlave::Success);
+ result = (sensorNode.ds28e15.computeSecret(sensorNode.authData.pageNum, false) == OneWireSlave::Success);
// Configure slave secret on DS2465
if (result)
- result = (DS28E15_22_25::computeNextSecret(sensorNode.ds2465, pageData, sensorNode.authData.pageNum, partialSecret, sensorNode.ds28e15_22_25.romId(), sensorNode.ds28e15_22_25.manId()) == ISha256MacCoproc::Success);
+ result = (DS28E15_22_25::computeNextSecret(sensorNode.ds2465, pageData, sensorNode.authData.pageNum, partialSecret, sensorNode.ds28e15.romId(), sensorNode.ds28e15.manId()) == ISha256MacCoproc::Success);
// Enable authentication protection if not set
if (result && (protectionStatus != desiredProtection))
- result = (sensorNode.ds28e15_22_25.writeAuthBlockProtection(sensorNode.ds2465, desiredProtection, protectionStatus) == OneWireSlave::Success);
+ result = (sensorNode.ds28e15.writeAuthBlockProtection(sensorNode.ds2465, desiredProtection, protectionStatus) == OneWireSlave::Success);
// Write initial filter life and set all other segments to default value
if (result)
{
@@ -120,7 +120,7 @@
std::memset(blankSegment, SensorNode::defaultPaddingByte, blankSegment.length);
for (size_t i = 0; i < DS28E15_22_25::segmentsPerPage; i++)
{
- result = (sensorNode.ds28e15_22_25.writeAuthSegment(sensorNode.ds2465, sensorNode.authData.pageNum, i,
+ result = (sensorNode.ds28e15.writeAuthSegment(sensorNode.ds2465, sensorNode.authData.pageNum, i,
((i == sensorNode.authData.segmentNum) ? sensorNode.authData.segment : blankSegment),
pageData.toSegment(i), false) == OneWireSlave::Success);
@@ -132,22 +132,22 @@
// Reload secret with known page values
// Load master secret into scratchpad
if (result)
- result = (sensorNode.ds28e15_22_25.writeScratchpad(masterSecret) == OneWireSlave::Success);
+ result = (sensorNode.ds28e15.writeScratchpad(masterSecret) == OneWireSlave::Success);
// Load master secret
if (result)
- result = (sensorNode.ds28e15_22_25.loadSecret(false) == OneWireSlave::Success);
+ result = (sensorNode.ds28e15.loadSecret(false) == OneWireSlave::Success);
// Read page data
if (result)
- result = (sensorNode.ds28e15_22_25.readPage(sensorNode.authData.pageNum, pageData, false) == OneWireSlave::Success);
+ result = (sensorNode.ds28e15.readPage(sensorNode.authData.pageNum, pageData, false) == OneWireSlave::Success);
// Write partial secret to scratchpad
if (result)
- result = (sensorNode.ds28e15_22_25.writeScratchpad(partialSecret) == OneWireSlave::Success);
+ result = (sensorNode.ds28e15.writeScratchpad(partialSecret) == OneWireSlave::Success);
// Compute secret
if (result)
- result = (sensorNode.ds28e15_22_25.computeSecret(sensorNode.authData.pageNum, false) == OneWireSlave::Success);
+ result = (sensorNode.ds28e15.computeSecret(sensorNode.authData.pageNum, false) == OneWireSlave::Success);
// Configure slave secret on DS2465
if (result)
- result = (DS28E15_22_25::computeNextSecret(sensorNode.ds2465, pageData, sensorNode.authData.pageNum, partialSecret, sensorNode.ds28e15_22_25.romId(), sensorNode.ds28e15_22_25.manId()) == ISha256MacCoproc::Success);
+ result = (DS28E15_22_25::computeNextSecret(sensorNode.ds2465, pageData, sensorNode.authData.pageNum, partialSecret, sensorNode.ds28e15.romId(), sensorNode.ds28e15.manId()) == ISha256MacCoproc::Success);
return result;
}
\ No newline at end of file
--- a/OneWire.lib Thu Jul 21 11:06:13 2016 -0500 +++ b/OneWire.lib Wed Aug 10 08:19:00 2016 -0500 @@ -1,1 +1,1 @@ -https://developer.mbed.org/teams/Maxim-Integrated/code/OneWire/#6dcbb5166da1 +https://developer.mbed.org/teams/Maxim-Integrated/code/OneWire/#0be1b9a8eab7
--- a/SensorNode.cpp Thu Jul 21 11:06:13 2016 -0500
+++ b/SensorNode.cpp Wed Aug 10 08:19:00 2016 -0500
@@ -62,7 +62,7 @@
}
SensorNode::SensorNode(mbed::I2C & i2c, uint8_t ds7505_i2c_addr, uint8_t max44009_i2c_addr, DS2465 & ds2465)
- : m_initialLux(1),ds2465(ds2465), selector(ds2465), ds28e15_22_25(selector), ds7505(i2c, ds7505_i2c_addr), max44009(i2c, max44009_i2c_addr)
+ : m_initialLux(1),ds2465(ds2465), selector(ds2465), ds28e15(selector), ds7505(i2c, ds7505_i2c_addr), max44009(i2c, max44009_i2c_addr)
{
if (!rngInitialized)
{
@@ -88,7 +88,7 @@
// Calculate secret
if (result)
{
- result = (DS28E15_22_25::computeNextSecret(ds2465, pageData, authData.pageNum, scratchpad, ds28e15_22_25.romId(), ds28e15_22_25.manId()) == ISha256MacCoproc::Success);
+ result = (DS28E15_22_25::computeNextSecret(ds2465, pageData, authData.pageNum, scratchpad, ds28e15.romId(), ds28e15.manId()) == ISha256MacCoproc::Success);
}
return result;
}
@@ -99,12 +99,12 @@
bool result;
- result = (ds28e15_22_25.readBlockProtection(0, protectionStatus) == OneWireSlave::Success);
+ result = (ds28e15.readBlockProtection(0, protectionStatus) == OneWireSlave::Success);
if (result)
{
if (!protectionStatus.noProtection())
{
- result = (ds28e15_22_25.readSegment(authData.pageNum, authData.segmentNum, authData.segment) == OneWireSlave::Success);
+ result = (ds28e15.readSegment(authData.pageNum, authData.segmentNum, authData.segment) == OneWireSlave::Success);
if (result)
provisioned = true;
}
@@ -122,7 +122,7 @@
DS28E15_22_25::Page pageData;
// Read page data
- if (ds28e15_22_25.readPage(authData.pageNum, pageData, false) != OneWireSlave::Success)
+ if (ds28e15.readPage(authData.pageNum, pageData, false) != OneWireSlave::Success)
return false;
// Create random challenge
@@ -142,15 +142,15 @@
}
// Write challenge to scratchpad
- if (ds28e15_22_25.writeScratchpad(challenge) != OneWireSlave::Success)
+ if (ds28e15.writeScratchpad(challenge) != OneWireSlave::Success)
return false;
// Have device compute MAC
DS28E15_22_25::Mac nodeMac;
- if (ds28e15_22_25.computeReadPageMac(0, false, nodeMac) != OneWireSlave::Success)
+ if (ds28e15.computeReadPageMac(0, false, nodeMac) != OneWireSlave::Success)
return false;
// Compute expected MAC
DS28E15_22_25::Mac controllerMac;
- if (DS28E15_22_25::computeAuthMac(ds2465, pageData, authData.pageNum, challenge, ds28e15_22_25.romId(), ds28e15_22_25.manId(), controllerMac) != ISha256MacCoproc::Success)
+ if (DS28E15_22_25::computeAuthMac(ds2465, pageData, authData.pageNum, challenge, ds28e15.romId(), ds28e15.manId(), controllerMac) != ISha256MacCoproc::Success)
return false;
// Check if authentic
return (nodeMac == controllerMac);
@@ -194,7 +194,7 @@
AuthData oldAuthData(authData);
authData.filterLife = sensorData.filterLife;
// Write new filter life to DS28E15
- result = (ds28e15_22_25.writeAuthSegment(ds2465, authData.pageNum, authData.segmentNum, authData.segment, oldAuthData.segment, false) == OneWireSlave::Success);
+ result = (ds28e15.writeAuthSegment(ds2465, authData.pageNum, authData.segmentNum, authData.segment, oldAuthData.segment, false) == OneWireSlave::Success);
}
return result;
@@ -209,7 +209,7 @@
RomId romId;
if (OWReadRom(ds2465, romId) != OneWireMaster::Success)
return UnableToCommunicate;
- ds28e15_22_25.setRomId(romId);
+ ds28e15.setRomId(romId);
if (!checkProvisioned(provisioned))
return UnableToCommunicate;
--- a/SensorNode.hpp Thu Jul 21 11:06:13 2016 -0500
+++ b/SensorNode.hpp Wed Aug 10 08:19:00 2016 -0500
@@ -39,7 +39,7 @@
#include "DS7505.hpp"
#include "MAX44009.hpp"
-#include "Slaves/Authenticators/DS28E15_22_25/DS28E15_22_25.h"
+#include "Slaves/Authenticators/DS28E15_22_25/DS28E15.h"
class SensorData;
namespace OneWire
@@ -84,7 +84,7 @@
bool readSensorData(SensorData & sensorData);
/// Get the ROM ID for this sensor node.
- const OneWire::RomId romId() const { return ds28e15_22_25.romId(); }
+ const OneWire::RomId romId() const { return ds28e15.romId(); }
/// Get the initial lux measurement for this sensor node.
double initialLux() const { return m_initialLux; }
@@ -128,7 +128,7 @@
// Hardware interfaces
OneWire::DS2465 & ds2465; ///< Interface to DS2465 on Controller.
OneWire::SingledropRomIterator selector;
- OneWire::DS28E15_22_25 ds28e15_22_25; ///< DS28E15 for authentication.
+ OneWire::DS28E15 ds28e15; ///< DS28E15 for authentication.
DS7505 ds7505; ///< DS7505 temperature sensor.
MAX44009 max44009; ///< MAX44009 optical light sensor.
MAXREFDES143#: DeepCover Embedded Security in IoT Authenticated Sensing & Notification