Skip to content

Enable AES counter mode #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Enable AES counter mode #168

wants to merge 7 commits into from

Conversation

solney
Copy link

@solney solney commented Nov 30, 2023

Here is a PR to expose AES_CTR mode.

The documentation states that it was not supported due to lack of hardware supporting it. We have been able to enable and use it successfully with a software HSM (SoftHSM), and on the AWS CloudHSM platform.

To run tests against SoftHSM

In a fresh env e.g docker container

docker run --rm -it  -v $(pwd):/work -w /work ubuntu:20.04 bash

Install deps

apt-get update
apt-get install softhsm pip -y
pip install -r dev-requirements.txt -r requirements.txt pytest

Install project deps and run tests:

softhsm2-util  --init-token --free --label test-python-pkcs11 --pin 1234 --so-pin 1234
export PKCS11_MODULE=/usr/lib/softhsm/libsofthsm2.so
export PKCS11_TOKEN_LABEL=test-python-pkcs11
export PKCS11_TOKEN_PIN=1234
export PKCS11_TOKEN_SO_PIN=1234
pytest -v tests/test_aes.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant