https://github.com/andreastedile/pkcs11-learning-old
https://github.com/andreastedile/pkcs11-learning-old
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/andreastedile/pkcs11-learning-old
- Owner: andreastedile
- Created: 2024-08-16T09:31:00.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2025-05-19T19:35:07.000Z (about 1 year ago)
- Last Synced: 2025-07-15T19:02:32.399Z (12 months ago)
- Language: Python
- Size: 134 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PKCS #11 learning
## Run an attack
```shell
python learn_known_attacks.py -h
```
Output:
```text
usage: learn_known_attacks.py [-h] so token_label user_pin
PKCS#11 automaton learning
positional arguments:
so Shared object
token_label Token label
user_pin User PIN
options:
-h, --help show this help message and exit
```
Example:
```shell
python learn_known_attacks.py /usr/local/lib/opencryptoki/libopencryptoki.so primo 1234
```
## Remove all results
```shell
./cleanup.sh
```
## Compare HSM models
First, convert dot files to the aut format: https://mcrl2.org/web/user_manual/tools/lts.html.
For example:
```shell
python3 lts.py model.dot
```
Then:
```shell
ltscompare --counter-example --preorder=trace-ac model2.aut model1.aut
tracepp --format=plain counter_example_trace_preorder.trc
```