# Nitrokey HSM 2, encrypt with AES

**URL:** <https://support.nitrokey.com/t/nitrokey-hsm-2-encrypt-with-aes/2663>\
**Category:** Nitrokeys\
**Created:** [September 30, 2020, 1:36pm UTC](https://support.nitrokey.com/t/nitrokey-hsm-2-encrypt-with-aes/2663 "2020-09-30T13:36:38Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![sc-hsm](https://support.nitrokey.com/user_avatar/support.nitrokey.com/sc-hsm/32/304_2.png) [@sc-hsm](https://support.nitrokey.com/u/sc-hsm)\
**Post date:** [September 30, 2020, 6:57pm UTC](https://support.nitrokey.com/t/nitrokey-hsm-2-encrypt-with-aes/2663/4 "2020-09-30T18:57:18Z")

</div>

You need to use the sc-hsm-pkcs11 module from the sc-hsm-embedded project. OpenSC does not yet include support for AES keys on a SmartCard-HSM.

See [testAES](https://github.com/CardContact/sc-hsm-embedded/blob/740057c6f04e186c3e3ecf46363672e277b62e06/src/tests/sc-hsm-pkcs11-test.c#L1037) for details on how AES keys can be used via the PKCS#11 interface.

If you download the [starterkit](https://www.cardcontact.de/download/sc-hsm-starterkit.zip), then you find in sc-hsm-workspace-20200310.zip a workspace for the [Smart Card Shell](https://www.openscdp.org/scsh3/index.html). The aes-performance.js and importAES.js scripts in examples/ show how AES operations can be performed.

---

_[View the full topic](https://support.nitrokey.com/t/nitrokey-hsm-2-encrypt-with-aes/2663)._
