I am testing a Nitrokey usb HSM, using Java and running on Ubuntu Linux.
The operation I am doing is an RSA 2048 encryption of 512bytes.
This is executed continuously and the latency is measured around the javax.crypto.Cipher.doFinal method call.
I am finding pretty consistent results of each operation taking about 650ms +=5ms.
Can anyone else confirm this level or performance and has anyone been able to improve on this?
Actually the encryption is done independent of the Nitrokey device, meaning, in software only. The Nitrokey hardware is only involved for signing and decryption.
Sorry I was not clear, the operation uses the java Cipher instance of “RSA/ECB/NoPadding” to perform an Cipher.ENCRYPT_MODE operation with the private key on the NK.
I’m not so familiar with the Java implementation in particular. But when using RSA, encryption is done with the public key (not private key). Therefore I’m pretty sure your crypto operation is performed in software but not on the Nitrokey hardware. Perhaps you could do a comparison with a key stored in JKS.