ATECC508A and ATECC608A cryptoauthlib

Discuss development of drivers for external hardware and components, such as LCD screens, sensors, motor drivers, etc.
Target audience: Users and developers of drivers.
Post Reply
pagano.paganino
Posts: 89
Joined: Fri Sep 11, 2015 10:47 pm
Location: Italy

ATECC508A and ATECC608A cryptoauthlib

Post by pagano.paganino » Wed Jan 23, 2019 10:02 am

Hi folks,
at this link https://github.com/dmazzella/ucryptoauthlib I have created a driver in pure-python for interact with the Microchip's secure element ATECC508A and ATECC608A from a PyBoard.

The API are the same of the C library/driver from Microchip https://github.com/MicrochipTech/cryptoauthlib

Currently the following commands are supported:
  • INFO
  • LOCK
  • NONCE
  • RANDOM
  • READ (1)
  • SHA (1)
  • WRITE (1)
  • VERIFY (1)
  • GENKEY
  • SIGN

(1) Not all features are implemented

Do not hesitate to contact me for more info, problems or insults about it :lol: ;)

Saluti,
Damiano

PinkInk
Posts: 65
Joined: Tue Mar 11, 2014 3:42 pm

Re: ATECC508A and ATECC608A cryptoauthlib

Post by PinkInk » Tue May 24, 2022 5:04 pm

Hi Damiano,

Just taking my first tenative steps with your library using an Arduino Nano rp2040 connect board (contains the ATECC608A) ... atcab_random seems to return some decidedly unrandom data?

Code: Select all

import cryptoauthlib.device
import micropython
from ubinascii import hexlify

sda = machine.Pin(12)
scl = machine.Pin(13)
bus = machine.I2C(0, scl=scl, sda=sda, freq=133000)

device = cryptoauthlib.device.ATECCX08A(
    bus = bus, 
    address = cryptoauthlib.device.I2C_ADDRESS, 
    retries = cryptoauthlib.device.RX_RETRIES
)

for _ in range(10):
    print(hexlify(device.atcab_random().response_data ))
returns;

Code: Select all

b'23ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000411a'
b'23ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000411a'
etc.
Any ideas?

Other basic tests e.g. computing sha digests seem to be returning plausible data (although I haven't actually validated it yet).

Tim

pagano.paganino
Posts: 89
Joined: Fri Sep 11, 2015 10:47 pm
Location: Italy

Re: ATECC508A and ATECC608A cryptoauthlib

Post by pagano.paganino » Mon May 30, 2022 7:28 pm

Hi Tim,
sorry for late response ...

you haven’t configured the device, as reported in datasheet. see https://github.com/MicrochipTech/crypto ... issues/121

Regards,
D.

PinkInk
Posts: 65
Joined: Tue Mar 11, 2014 3:42 pm

Re: ATECC508A and ATECC608A cryptoauthlib

Post by PinkInk » Thu Jun 02, 2022 4:14 pm

Hi Damiano,

Thanks! Some light reading to do then ;o)

Regards, Tim

Post Reply