Introduction
RSA implementation based on Sybren A. Stüvel’s python-rsa pure-python RSA implementation.
Dependencies
This driver depends on:
pyasn1 Library (some functionality)
CPython’s
rsa
Library (some functionality)
Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle.
Installing from PyPI
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:
pip3 install adafruit-circuitpython-rsa
To install system-wide (this may be required in some cases):
sudo pip3 install adafruit-circuitpython-rsa
To install in a virtual environment in your current project:
mkdir project-name && cd project-name
python3 -m venv .venv
source .venv/bin/activate
pip3 install adafruit-circuitpython-rsa
Usage Example
Examples for this library are avaliable in the examples/ folder.
Documentation
API documentation for this library can be found on Read the Docs.
For information on building library documentation, please check out this guide.
Contributing
Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.
Table of Contents
Examples
API Reference
- Adafruit CircuitPython RSA API
- RSA module
adafruit_rsa._compat
byte()
get_word_alignment()
is_bytes()
is_integer()
write_to_stdout()
xor_bytes()
adafruit_rsa.asn1
PubKeyHeader
OpenSSLPubKey
AsnPubKey
adafruit_rsa.common
NotRelativePrimeError
bit_length()
bit_size()
byte_size()
ceil_div()
crt()
extended_gcd()
inverse()
adafruit_rsa.core
assert_int()
decrypt_int()
encrypt_int()
fast_pow()
adafruit_rsa.key
PrivateKey
PublicKey
newkeys()
adafruit_rsa.machine_size
get_word_alignment()
adafruit_rsa.pem
load_pem()
save_pem()
adafruit_rsa.pkcs1
CryptoError
DecryptionError
VerificationError
decrypt()
encrypt()
sign()
verify()
adafruit_rsa.prime
are_relatively_prime()
getprime()
adafruit_rsa.randnum
randint()
read_random_bits()
read_random_int()
read_random_odd_int()
adafruit_rsa.transform
bytes2int()
bytes_leading()
int2bytes()