Page 1 of 1

ATECC508A and ATECC608A cryptoauthlib

Posted: Wed Jan 23, 2019 10:02 am
by pagano.paganino
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

Re: ATECC508A and ATECC608A cryptoauthlib

Posted: Tue May 24, 2022 5:04 pm
by PinkInk
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

Re: ATECC508A and ATECC608A cryptoauthlib

Posted: Mon May 30, 2022 7:28 pm
by pagano.paganino
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.

Re: ATECC508A and ATECC608A cryptoauthlib

Posted: Thu Jun 02, 2022 4:14 pm
by PinkInk
Hi Damiano,

Thanks! Some light reading to do then ;o)

Regards, Tim