In this blog, I will implement secure authentication with IoT.
The Microchip's SAM E51 Curiosity Nano Evaluation Kit offers on-board features like AES(Advanced Encryption Standard), PUKCC(Public Key Cryptography Controller) and TRNG(True Random Number Generator).
I will implement the login protection in hardware, in AWS IoT Cloud and in Google PlayStore applet, with the simple password, and login failure and successful demonstration. The security implementations with AWS IoT Cloud and on Google PlayStore applet, are in their respective blogs.
1. True Random Number Generator
The True Random Number Generator (TRNG) of 'Microchip's SAM E51 Curiosity Nano Evaluation Kit' provides 32-bit random number every 84 clock cycles, passing the American NIST Special Publication 800-22 and Diehard Random Tests Suites. This TRNG can also be used as an entropy source for seeding DRNG (Deterministic RNG), which the requirement of FIPS PUB 140-2 and 140-3.
2. Advanced Encryption Standard
The Microchip's SAM E51 has onboard cryptography module to implement FIPS Publication 197 Compliant Advanced Encryption Standard (AES).
The recycling database, files and folders of employees health, the air quality levels in the recyclying processes will be encrypted using symmetric-key algorithm of AES. Different keysizes are available using Microchip's SAM E51
2.1 Encryption Process
Iin the above figure,
- In the ADD ROUND KEY, each byte is combined with round key (which are derived using Rijndael's key) using bitwise XOR.
- The SubBytes is a non-linear substitution where each byte is replaced according to lookup table.
- The ShiftRows is a transposition step.
- The MixColumns is a mixing operation.
For 2 byte parallel processing, ClockFrequency=Throughput2×Nr + 1.
2.2 Decryption Process
3. Public Key Cryptography Controller
Using the Microchip's SAM E51 Curiosity Nano Evaluation Kit's, PUKCC(Public Key Cryptography Controller), one can implement public key cryptography- RSA((Rivest-Shamir-Adleman), DSA,Elliptic Curves and DRNG.
The RSA can be implemented with modular exponentiation upto 7168 bits with Chinese Remainder Theorem and up to 5376 bits without Chinese Remainder Theorem.
3.1 Implementation of Public Key Cryptography Controller,on Microchip SAM E51 Curiosity Nano Evaluation Kit
void e14upcycle_iot_PUKCC(void)
{
memset(&PUKCLParam, 0, sizeof(PUKCL_PARAM));
pvPUKCLParam = &PUKCLParam;
vPUKCL_Process(e14upcycle, pvPUKCLParam);
}
while (PUKCL(u2Status) != PUKCL_OK) {;}
while (pvPUKCLParam->P.PUKCL_e14upcycle.u4Version != PUKCL_VERSION) {;}
while (pvPUKCLParam->P.PUKCL_e14upcycle.u4CheckNum1 != 0x6E70DDD2) {;}
while (pvPUKCLParam->P.PUKCL_e14upcycle.u4CheckNum2 != 0x25C8D64F) {;}
int main(void)
{
e14upcycle_iot_design_init();
while ((PUKCCSR & BIT_PUKCCSR_CLRRAM_BUSY) != 0);
}
e14upcycle_iot_PUKCC();
while(1){}
3.2 Implementation of SHA-256 on Microchip SAM E51 Curiosity Nano Evaluation Kit
The kit has integrated module which offers SHA1, SHA224, SHA256. I will implement Integrity Check Module based Secure Hash Algorithm,SHA256.
Code is known and elementary
Output Testing