Skip to content

Instantly share code, notes, and snippets.

@bsodmike
Created July 10, 2016 21:49
Show Gist options
  • Save bsodmike/97834301a039c36de50298404fff7198 to your computer and use it in GitHub Desktop.
Save bsodmike/97834301a039c36de50298404fff7198 to your computer and use it in GitHub Desktop.
IoT Security with the Atmel ATECC508A

IoT Security with the Atmel ATECC508A

Get Public ECC Key
Key Number [0-15]
Public Key 15
PubKey:26712508A3544575F38526FA3D6AAAF920728A3ABDF2421841243F1961222944AF116DDFB4AF797EA70FCD09C9FEBC490793C271165410FAF3672BE5FD8D1B5D

Hash Data
Enter Message to hash: Thing Innovations Crypto
Hash: 6710AB24724A9F1F4B98DCCBB555A98089793C6E977247DC6612D11172E0A00F

# 
Sign Data
Enter Message to sign: Thing Innovations Crypto
Key Number [0-15] 0
Signature:5F20AA9ADEBBF77B9005FC3095E36E8650B75A0D4F7C296D097F7BCBA8A95E615DD1F4A8BE9B67AD4361F4241B686A5CCA990A8EF9DEEA2566ADE50B0B320204

Verify Data
Enter Message to verify: Thing Innovations Crypto
Enter Public Key: 71F0772217CB873922BEE01E1B7AFCA08F665AB4A6E3DDB9A8617DE75A95EA60C73A19D3C604E3F6194454EF3A60660CF886F7518547EC22F846AA65FFC9C536
Enter Signature: 7C98326921AD4A795A44AB599B0230DE9B554D3842CB4AF26B12F4CC76C97F6BFB87A4DB03BFD19F28AE7B5EFF8FEC44DAD319E76D36E88B8729CDA2D583698B
Verify OK

It is also possible to perform an offline verification using libcrypti2c. This can be demonstrated with an Raspberry Pi and cryptotronix/EClet.

There is an off-line mode that does not use the ATECC508A chip, instead it uses the crypto library so can be used to verify data where the crypto hardware chip is not available as shown in the example below. Again, this returns an exit code of 0 for successful verification.

pi@raspberrypi2B ~/crypto/EClet $ echo -n "Thing Innovations crypto test" | ./eclet offline-verify-sign
--signature 25899774090368CBCF22ECB31F3E033CC6DB87F459F6EEF45A8F63B423E11B96F9B8742A8BF38F4A91056D704CC4E5B6286864F6EACF18E0410598201C404EE3
--public-key 046DAAAE69650D2B77ADC792C999FD09307413DB4067018DA4C315CCBF8E20743421330051699A859106E3C94486A4799C4074D04892C19CE37C842ABA4C6F5175

cryptotronix/EClet achieves this by making a call to lca_ecdsa_p256_verify (pub_key, signature, file_digest) which is handled by the libcrypti2c and performs an ECDSA verification in software

Reference: https://thinginnovations.uk/developing-an-iot-security-solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment