Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 20260505 instead.
Reason given by maintainers: Missing packges for different platforms

Python CryptoAuthLib module

Introduction

This module provides a thin python ctypes layer to evaluate the cryptoauthlib interface to Microchip CryptoAuthentication devices.

Code Examples

Code examples for python are available on github as part of CryptoAuthTools under the python/examples directory

Installation

CryptoAuthLib python module can be installed through Python's pip tool:

    pip install cryptoauthlib

To upgrade your installation when new releases are made:

    pip install -U cryptoauthlib

If you ever need to remove your installation:

    pip uninstall cryptoauthlib

What does python CryptoAuthLib package do?

CryptoAuthLib module gives access to most functions available as part of standard cryptoauthlib (which is written in 'C'). These python functions for the most part are very similar to 'C' functions. The module in short acts as a wrapper over the 'C' cryptoauth library functions.

Microchip cryptoauthlib product page: Link

Supported hardware

Supported devices

The family of devices supported currently are:

Using cryptoauthlib python module

The following is a 'C' code made using cryptoauthlib 'C' library.

#include "cryptoauthlib.h"

void main()
{
    ATCA_STATUS status;
    uint8_t revision[4];
    uint8_t randomnum[32];

    status = atcab_init(cfg_ateccx08a_kitcdc_default);
    if (status != ATCA_SUCCESS)
    {
        printf("Error");
        exit();
    }

    status = atcab_info(revision);
    if (status != ATCA_SUCCESS)
    {
        printf("Error");
        exit();
    }

    status = atcab_random(randomnum);
    if (status != ATCA_SUCCESS)
    {
        printf("Error");
        exit();
    }
}

The same code in python would be:

from cryptoauthlib import *

ATCA_SUCCESS = 0x00
revision = bytearray(4)
randomnum = bytearray(32)

# Locate and load the compiled library
load_cryptoauthlib()

assert ATCA_SUCCESS == atcab_init(cfg_ateccx08a_kithid_default())

assert ATCA_SUCCESS == atcab_info(revision)
print(''.join(['%02X ' % x for x in revision]))

assert ATCA_SUCCESS == atcab_random(randomnum)
print(''.join(['%02X ' % x for x in randomnum]))

In the above python code, "import cryptoauthlib" imports the python module. load_cryptoauthlib() function loads the compiled library. The load_cryptoauthlib() is a function that you will not see in the 'C' library, this is a python specific utility function and is required for python scripts to locate and load the compiled library.

In Summary

Step I: Import the module

from cryptoauthlib import *

Step II: Initilize the module

load_cryptoauthlib()

assert ATCA_SUCCESS == atcab_init(cfg_ateccx08a_kithid_default())

Step III: Use Cryptoauthlib APIs

Call library APIs of your choice

Code portability

Microchip's CryptoAuthentication products can now be evaluated with the power and flexibility of python. Once the evaluation stage is done the python code can be ported to 'C' code.

As seen above the python API maintains a 1 to 1 equivalence to the 'C' API in order to easy the transition between the two.

Cryptoauthlib module API documentation

help() command

All of the python function's documentation can be viewed through python's built in help() function.

For example, to get the documentation of atcab_info() function:

    >>> help(cryptoauthlib.atcab_info)
    Help on function atcab_info in module cryptoauthlib.atcab:

    atcab_info(revision)
    Used to get the device revision number. (DevRev)

    Args:
        revision            4-byte bytearray receiving the revision number
                            from the device. (Expects bytearray)

    Returns:
        Status code

dir() command

The dir command without arguments, return the list of names in the current local scope. With an argument, attempt to return a list of valid attributes for that object. For example dir(cryptoauthlib) will return all the methods available in the cryptoauthlib module.

Code Examples

Code examples for python are available on github as part of CryptoAuthTools under the python/examples directory

Tests

Module tests can be located in the python/tests of the main cryptoauthlib repository. The README.md has details for how to run the tests. The module tests are not comprehensive for the entire functionality of cryptoauthlib but rather are meant to test the python module code only against the library to ensure the interfaces are correct and ctypes structures match the platform.

Release notes

See Release Notes

Metadata

Release files for cryptoauthlib 20250213

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for cryptoauthlib 20250213
File
cryptoauthlib-20250213-pp310-pypy310_pp73-win_amd64.whl PyPy 3.10 PyPy 3.10 7.3 Windows x86-64 Details
cryptoauthlib-20250213-pp39-pypy39_pp73-win_amd64.whl PyPy 3.9 PyPy 3.9 7.3 Windows x86-64 Details
cryptoauthlib-20250213-pp38-pypy38_pp73-win_amd64.whl PyPy 3.8 PyPy 3.8 7.3 Windows x86-64 Details
cryptoauthlib-20250213-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
cryptoauthlib-20250213-cp313-cp313-win32.whl CPython 3.13 CPython 3.13 Windows x86-32 Details
cryptoauthlib-20250213-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
cryptoauthlib-20250213-cp312-cp312-win32.whl CPython 3.12 CPython 3.12 Windows x86-32 Details
cryptoauthlib-20250213-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
cryptoauthlib-20250213-cp311-cp311-win32.whl CPython 3.11 CPython 3.11 Windows x86-32 Details
cryptoauthlib-20250213-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
cryptoauthlib-20250213-cp310-cp310-win32.whl CPython 3.10 CPython 3.10 Windows x86-32 Details
cryptoauthlib-20250213-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
cryptoauthlib-20250213-cp39-cp39-win32.whl CPython 3.9 CPython 3.9 Windows x86-32 Details
cryptoauthlib-20250213-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
cryptoauthlib-20250213-cp38-cp38-win32.whl CPython 3.8 CPython 3.8 Windows x86-32 Details

Total release size: 2.2 MB

Release files / cryptoauthlib-20250213-pp310-pypy310_pp73-win_amd64.whl

Download URL cryptoauthlib-20250213-pp310-pypy310_pp73-win_amd64.whl
Size 155.1 kB
Tags PyPy 3.10 PyPy 3.10 7.3 Windows x86-64
SHA-256 checksum
How to use checksums
2a3f89182ba5d57d3d9b0f172d6dd762b589d017b2685a525a3922992002ddab
BLAKE2b-256 checksum
How to use checksums
d385aa8b0606b4d3a839fe9acbfd95a36bf45659a8d8df7abe00606cbe6c5eec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.9

Release files / cryptoauthlib-20250213-pp39-pypy39_pp73-win_amd64.whl

Download URL cryptoauthlib-20250213-pp39-pypy39_pp73-win_amd64.whl
Size 155.1 kB
Tags PyPy 3.9 PyPy 3.9 7.3 Windows x86-64
SHA-256 checksum
How to use checksums
0b59dfc08bab259b7e084dc51eb030d7300b04d801fece4b556b64356277d6d3
BLAKE2b-256 checksum
How to use checksums
e72dc8638c43ce74dfc15ff46a926354dec83560b2da07352c8d41f6a5f12257
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.9

Release files / cryptoauthlib-20250213-pp38-pypy38_pp73-win_amd64.whl

Download URL cryptoauthlib-20250213-pp38-pypy38_pp73-win_amd64.whl
Size 155.1 kB
Tags PyPy 3.8 PyPy 3.8 7.3 Windows x86-64
SHA-256 checksum
How to use checksums
34d4b0ba2eb61d07dc21d21f84f6e37c3186293d9fcaa0a810656a1838a95072
BLAKE2b-256 checksum
How to use checksums
c95a7db0820851ec2e1ce64f9a66551abaa61ff924c4691a72f32297a953ef06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.9

Release files / cryptoauthlib-20250213-cp313-cp313-win_amd64.whl

Download URL cryptoauthlib-20250213-cp313-cp313-win_amd64.whl
Size 155.1 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
e46fc218e66ed1ceeee3d1050f16c61c88f2a8e81a6bf3b30a21fb51b31206b2
BLAKE2b-256 checksum
How to use checksums
30f78295d80e9db8ec5c163c2adb87ebd031354ca878baf23f289c239df4b565
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.9

Release files / cryptoauthlib-20250213-cp313-cp313-win32.whl

Download URL cryptoauthlib-20250213-cp313-cp313-win32.whl
Size 134.7 kB
Tags CPython 3.13 Windows x86-32
SHA-256 checksum
How to use checksums
b3d8d6b3ee7c2b2135712028dfc4a2a16654eb025b6660c6c700885af2d9c3b4
BLAKE2b-256 checksum
How to use checksums
4527c12de1731efbc609825337e8a976af600fb1bfd8b10ca945f89ec0efc302
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.9

Release files / cryptoauthlib-20250213-cp312-cp312-win_amd64.whl

Download URL cryptoauthlib-20250213-cp312-cp312-win_amd64.whl
Size 155.1 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
1f2280df132db4b0f790c3dd30788a1b3caebf69241737bf261ef84f0de1ec51
BLAKE2b-256 checksum
How to use checksums
c193f060682a798be83985499a5cbd04c4c6b2be52a21f53360b10979ab82558
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.9

Release files / cryptoauthlib-20250213-cp312-cp312-win32.whl

Download URL cryptoauthlib-20250213-cp312-cp312-win32.whl
Size 134.7 kB
Tags CPython 3.12 Windows x86-32
SHA-256 checksum
How to use checksums
5a7b3b3ceb1ae729e5a226bf003b2c895514a296edc67bf09d67302dbd9bbda0
BLAKE2b-256 checksum
How to use checksums
c43b52160d36f2065d81aff04cece1f2cec7ea2d92a16f094ec596badfaa2577
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.9

Release files / cryptoauthlib-20250213-cp311-cp311-win_amd64.whl

Download URL cryptoauthlib-20250213-cp311-cp311-win_amd64.whl
Size 155.1 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
f94bd01a87bee453dfa447d29a073c4b5e919331e9e4bbde40f88601fb3a190b
BLAKE2b-256 checksum
How to use checksums
8f6b01d18a9c69b7e817ea22521326c532ae7b99f7e0bbcc72e147261e80c6dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.9

Release files / cryptoauthlib-20250213-cp311-cp311-win32.whl

Download URL cryptoauthlib-20250213-cp311-cp311-win32.whl
Size 134.7 kB
Tags CPython 3.11 Windows x86-32
SHA-256 checksum
How to use checksums
532397c1afef2bc2950bcca6e4d019c04d39007b93d646d7cb08446412ad4d1e
BLAKE2b-256 checksum
How to use checksums
6191ff69599733fb1de8633656666772287f59c94501cc972fdd0ec04a4d164c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.9

Release files / cryptoauthlib-20250213-cp310-cp310-win_amd64.whl

Download URL cryptoauthlib-20250213-cp310-cp310-win_amd64.whl
Size 155.1 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
187b528c53ecfd3343fb28b280b76fe135ffd244670c3f6f758e8bb0ec5f90ca
BLAKE2b-256 checksum
How to use checksums
552a7c12f8ff97b3f9b77ac9ca1b87f5cd6c90c4ad7c5de04270796eec056fca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.9

Release files / cryptoauthlib-20250213-cp310-cp310-win32.whl

Download URL cryptoauthlib-20250213-cp310-cp310-win32.whl
Size 134.7 kB
Tags CPython 3.10 Windows x86-32
SHA-256 checksum
How to use checksums
4a8755b1be64e0b11d6397566ae26a3733a0e13d0b56bf57755bf0cd7989cb9e
BLAKE2b-256 checksum
How to use checksums
78392e3b3b376a145f2aef8c3dbc7180fbd19520c6018315cb86755f9f912785
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.9

Release files / cryptoauthlib-20250213-cp39-cp39-win_amd64.whl

Download URL cryptoauthlib-20250213-cp39-cp39-win_amd64.whl
Size 155.1 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
68d34e76afd8539f0084d8b808cac2e6186f200b02fc185520bbc9d8dc220f43
BLAKE2b-256 checksum
How to use checksums
06d06c66a5ab9ba99d349550a7e3303e6afca2fc6e1afbe9905fc5ca4e52de4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.9

Release files / cryptoauthlib-20250213-cp39-cp39-win32.whl

Download URL cryptoauthlib-20250213-cp39-cp39-win32.whl
Size 134.7 kB
Tags CPython 3.9 Windows x86-32
SHA-256 checksum
How to use checksums
414f011e2523dedd9c31d79aac18c079069d67d6f8fa38ab27b4f856fafdfc80
BLAKE2b-256 checksum
How to use checksums
87ccebf41b7c3771f4f42dddfef214c42526eda6d872843df3e104230b0b6540
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.9

Release files / cryptoauthlib-20250213-cp38-cp38-win_amd64.whl

Download URL cryptoauthlib-20250213-cp38-cp38-win_amd64.whl
Size 155.0 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
61c878eff29df16b9a61b5f95cd3e2beceffd5f1c522eb27725aa1aa6a878b05
BLAKE2b-256 checksum
How to use checksums
aa5c5fa610ea38927ae891ddc3d64401fa63fcff8abf2c7e6f6e6187138b0257
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.9

Release files / cryptoauthlib-20250213-cp38-cp38-win32.whl

Download URL cryptoauthlib-20250213-cp38-cp38-win32.whl
Size 134.6 kB
Tags CPython 3.8 Windows x86-32
SHA-256 checksum
How to use checksums
6facbc538e86d3eef35fa759ab543f3ffd71f2c1e823386be5fb3190dbe0f601
BLAKE2b-256 checksum
How to use checksums
6aa5f966b68456b0c7751c12c89e6abaa6f4d27ca9264ff6ebaf87d7f685922a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.9

Release history Release notifications | RSS feed

This release

20250213 This release

15 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page