GithubHelp home page GithubHelp logo

dmazzella / ucryptoauthlib Goto Github PK

View Code? Open in Web Editor NEW
38.0 38.0 8.0 1.96 MB

Lightweight driver for Microchip's Crypto Authentication secure elements written in pure python for micropython

License: MIT License

Python 100.00%
atecc atecc508a atecc608a micropython pyboard

ucryptoauthlib's Introduction

life is short, use python! ๐Ÿ

ucryptoauthlib's People

Contributors

dmazzella avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ucryptoauthlib's Issues

RP2 ARDUINO_NANO_RP2040_CONNECT

Hello Damiano,

i tried to compile your lib for RP2 ARDUINO_NANO_RP2040_CONNECT.
These are my commands:

$ git clone https://github.com/micropython/micropython.git
$ cd micropython
micropython$ git submodule update --init
micropython$ git clone https://github.com/dmazzella/ucryptoauthlib.git micropython-lib/ucryptoauthlib
micropython$ make -C mpy-cross && make -C ports/rp2 BOARD=ARDUINO_NANO_RP2040_CONNECT FROZEN_MANIFEST="$(pwd)/micropython-lib/ucryptoauthlib/manifest.py""

After flashing the rp2040 with the uf2 image, and the following command:

device = ATECCX08A()

i got this error

  File "<stdin>", line 1, in <module>
  File "cryptoauthlib/device.py", line 30, in __init__
NoDevicesFoundError: For protocols that support device discovery (kit protocol), no devices were
found

Do you have an idea how I can fix the device detection for the arduino rp2040 https://docs.arduino.cc/hardware/nano-rp2040-connect ?

Kind regards,
Matt

Some questions on implementing the atcab_read_enc function

I have started trying to implement the atcab_read_enc() function.

This function relies on the atcab_gendig() function which I notice in code appears to be implemented, but the readme does not have a tick next to it. What is the current state of the atcab_gendig() function?

I am using as a guide the datasheets including "Atmel CryptoAuthentication Encrypted Reads and Writes" and the Atmel C++ library, but just wonder if you have any advise for me?

thanks,
Chris

Error in constructor of ATECCX08A

I am building Micropython for ESP32 as per the instructions https://github.com/micropython/micropython/tree/master/ports/esp32, having first copied the files in modules/cryptoauthlib to the modules/cryptoauthlib in the esp32 directory. This builds successfully and I can see it compiling the cryptoauthlib files. I then deployed this and attempt to test that the device is working. I confirmed that its visible on I2C bus with

from machine import Pin, I2C

scl = Pin(5)
sda = Pin(18)
i2c = I2C(-1, scl, sda)
print(i2c.scan())

which gave 96, which is correct. I then tried to initialize the device with:

from cryptoauthlib.device import ATECCX08A
from machine import Pin, I2C

device = ATECCX08A(bus=I2C(-1, Pin(5), Pin(18), freq=133000))

but this fails with:

Traceback (most recent call last):
  File "<stdin>", line 4, in <module>
  File "cryptoauthlib/device.py", line 36, in __init__
  File "cryptoauthlib/packet.py", line 59, in __getitem__
IndexError: memoryview index out of range

I actually have your library working correctly on another esp32 and device, but unfortunately I did not keep a copy of this binary. I have the swapped the devices between the esp32's and they both work correctly with my first esp32. I have tried this new binary on two different esp32's and it gives the same error on both.

Any suggests on how to fix this? Thx

Chris

Using ucryptoauthlib with CPython

I happen to find myself in a situation where I need to interface with the ATECC508A on a Raspberry Pi. Python is my prefered language, so when I found ucryptoauthlib, I thought it was perfect until I realised it was for MicroPython, not for Python (CPython).

I've mucked about to the point that I've got everything to import / run correctly except for trying to actually initialize the device. CPython kinda craps out when it goes looking for the machine library and doesn't find it. I can't find any kind of analog or drop in replacement, even micropython-cpython-machine doesn't seem to satisfy.

Do you have any idea what would need to be done to "port" ucryptoauthlib to run correctly under CPython instead of MicroPython?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.