Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [pkcs11]

PKCS #11 (Public-Key Cryptography Standard 11) defines a platform-independent API to cryptographic tokens, such as hardware security modules (HSM) and smart cards called *Cryptoki*.

2
votes
1answer
49 views

Inconsistency with PKCS#11 v2.40 CKM_AES_KEY_WRAP_PAD

There appears to be some inconsistencies between the PKCS#11 v2.40 Current Mechanism Specification and the specification for AES Key Wrap Pad as defined in SP800-38F. First, according to PKCS#11: ...
2
votes
1answer
56 views

HMAC computation using AES key

I want to compute an HMAC value of a data set using CKM_SHA256_HMAC mechanism with AES key. I have the error code CKR_KEY_TYPE_INCONSISTENT because it seems that I need to use a key of key_type ...
2
votes
1answer
92 views

Using PKCS #11 Certificate Objects for Verification

What is the proper way to use the public key contained in a X.509 certificate with PKCS #11? ...
1
vote
0answers
65 views

PKCS#11. Possibility of performing Ecryption/Decryption in hardware [closed]

Cheers. I'm dealing with HSM via PKCS#11 C/Python interface. I'm wondering is it possible to do some C_Encrypt/C_Decrypt in ...
1
vote
0answers
146 views

Unwrapping secrete key without exposing original key? [closed]

I am trying to unwrap a secret key (AES/DES) using Java APIs and SunPKCS11. Problem is that it reveals the value of an unwrapped key (out of HSM) in the key object. Here is the code: ...
2
votes
0answers
43 views

What is the proper return code for C_Login when a CKU_SO attempts to log into a non-initialized token?

Looking at the PKCS#11 2.4 spec, C_Login returns CKR_USER_PIN_NOT_INITIALIZED when a "normal user's PIN has not yet been ...
1
vote
0answers
52 views

What is a parallel session in PKCS#11

I have seen in the PKCS#11 spec that "parallel sessions" are not supported "in Cryptoki Version 2.01 and up, no token supports parallel sessions" but I can also ...
1
vote
1answer
49 views

How should short term keys (keys stored in RAM or volatile memory) be described by PKCS#11?

How are short term keys usually implemented by PKCS#11? Is the proper way to distinguish between keys that are more temporary/stored in volatile memory and those stored in non-volatile memory to ...
3
votes
1answer
215 views

RSA hybrid decryption via PKCS#11 - unwrap or decrypt?

I have an application that does RSA hybrid encryption/decryption – i.e., messages are encrypted with a fresh AES key, which is then itself encrypted with RSA-OAEP and sent with the message. Decryption ...
3
votes
1answer
125 views

How can CKA_TRUSTED be set to true?

I'm confused by the wording of the PKCS#11 v2.40 specification in terms of when CKA_TRUSTED can be set to true on a public key certificate object: The CKA_TRUSTED attribute cannot be set to CK_TRUE ...
1
vote
1answer
190 views

Basic question on interaction with HSM using PKCS11

I am a beginner on cryptography, I've been reading about PKCS11 and usage of PKCS11 on HSM's I understand the concept of HSM, I read about the HD wallets in bitcoin how keys are hashed and combined ...
1
vote
1answer
229 views

PKCS #11 – Deriving a Key where MSB perform encryption and LSB perform CMAC operation?

I am using Thales HSM, a PKCS #11 Compliant device. I have an 32 byte AES key and derivation input. I want to use AES-ECB encryption Mode to derive a 32 byte key where 16 MSB should be considered as ...
0
votes
2answers
457 views

Is ssl_sign safe as it is using OPENSSL_PKCS1_PADDING

I've been hearing a lot of scare talk about PKCS1 padding attacks. Is PKCS1 v1.5 safe in signatures as it is practically transporting only message digest? I'm using it in one of my applications so i'...
2
votes
1answer
663 views

setting the MGF hash to a different value other than the regular hash with openssl for PSS signatures

In PKCS1's Probabilistic Signature Mode you have the Hash and the MGF Hash. Both appear to be, by default, sha1, with the OpenSSL CLI client, however, I can change it to sha256 with the following: <...
1
vote
1answer
442 views

PKCS#11 Sessions [closed]

I am maintaining an application that uses PKCS#11 to talk to a smartcard. Somehow a session gets generated, but i cant figure out where in the code. I am using c# and the PKCS11Interop wrapper. The ...
2
votes
0answers
393 views

Limit the number of private key uses for RSASSA-PKCS1-v1_5 with SHA-256 signature?

Assuming all messages and their signatures are available to the attacker, is it secure to use the same RSA private key to sign many messages (roughly $10^{6}$) via PKCS#11 ...
5
votes
4answers
3k views

Source for PKCS#11 Header Files

Is there a known authoritative source for the ANSI C header files for PKCS#11 Cryptoki? Specifically, I am having trouble locating pkcs11.h, pkcs11t.h, and pkcs11f.h for v2.30 and v2.40. Are there ...
2
votes
0answers
279 views

Can CKM_RSA_PKCS signature be made secure by lowering its maximum input size?

The CKM_RSA_PKCS Mechanism in PKCS#11 v2.20 section 12.1.6 PKCS #1 v1.5 RSA is a signature scheme commonly used to implement RSASSA-PKCS1-v1_5 of PKCS#1 signature of data hashed externally to a ...
1
vote
1answer
812 views

How do SignRecover and VerifyRecover work?

In PKCS#11, there are the SignRecover and VerifyRecover methods, where the data can be recovered from the signature. How do these methods work? Can I implement signrecover and verifyrecover with ...
3
votes
1answer
417 views

Why is C_digest defined in PKCS#11?

Digesting doesn't require any key and can be performed on the client side. Why does the PKCS#11 token interface standard have a C_digest method? For example, why should I send my data to a PKCS11 HSM ...
4
votes
2answers
703 views

Smart Card - Entropy during on-board public key generation

I know that some (advanced) smart cards or tokens allow generating key pair directly on the device, but I wonder how the card can gather entropy during the process. Any idea ?
2
votes
0answers
281 views

Does NSS fully implement PKCS 11?

I am looking towards using NSS in a Linux application that makes use of a TPM (HSM). So, I am checking the support of PKCS 11 in NSS, at least for the management of Elliptic Curve keys, signature with ...
1
vote
1answer
1k views

Using C_Sign to create a PKCS7 signature

I am using the PKCS#11 function C_Sign to sign some data. The output I get is just a signature. How do I get it in PKCS#7 format - i.e. ASN1 with signature and certificate (for detached) or ASN1 with ...
5
votes
1answer
4k views

What are options to compute DES retail MAC (aka ISO 9797-1 mode 3) under PKCS#11?

The DES retail MAC, also known as ISO 9797-1 mode 3 with DES, computes the MAC of a block of data using a 16-byte (112 bit) key. It can be seen as CBC-MAC using simple DES with the first half of the ...
1
vote
1answer
289 views

Does OpenTSA support PKCS11 to talk to HSMs?

We are planning to implement the time-stamping service (RFC 3161) using OpenTSA wanted to know: Does OpenTSA support PKCS-11 (Cryptoki) to talk to HSMs? BTW: I did not find documentation or much ...
-1
votes
1answer
3k views

Is the random data at the end of my decrypted message supposed to be there?

This is my PKCS#5 & AES/ECB Python 3.3 code: ...
1
vote
1answer
470 views

PKCS#11: Can C_GetMechanismInfo() return CKR_OK on a disabled mechanism?

According to PKCS#11 v2.20, "C_GetMechanismInfo obtains information about a particular mechanism possibly supported by a token." Does that mean ...
7
votes
1answer
4k views

CKM_RSA_PKCS vs CKM_RSA_X_509 mechanisms in PKCS#11

What is the exact difference between the CKM_RSA_PKCS and CKM_RSA_X_509 mechanisms in the PKCS#11 v2.20 specification (Please ...
0
votes
1answer
193 views

PKCS#11: Which CKK_types are supported by CKM_PKCS5_PBKD2?

On Solaris there's a function pkcs11_PasswdToKey() which is a wrapper of C_GenerateKey(). I made a simple test and it turned out ...