CryptoAPI Next Generation (CNG) is the next version of the Windows CryptoAPI available since Vista. It adds NSA Suite B algoritms (including elliptic-curve cryptography) and is FIPS 140-2 certified.
Questions tagged [cng]
256 questions
1
vote
0 answers
Create X.509 certificate in .NET with CNG (private key in HSM)
We have a self-signed CA certificate with private key stored in a HSM solution. We need to create a short-lived X.509 certificate signed by the CA certificate through .NET code. The short-lived X.509 certificate will be used for client certificate…

dparnas
- 4,090
- 4
- 33
- 52
1
vote
1 answer
C++ - Decrypting without encryption size
I've looked for a while and I have not found the solution to this problem. I am using BCryptDecrypt to decrypt my encrypted data but it requires the size of the EncryptedData, How are you able to decrypt without knowing the size?
I know…

Trevin Corkery
- 651
- 7
- 19
1
vote
1 answer
What header to include for an NTSTATUS when building for ARM platforms?
I'm working under the VS2013 ARM Developer Prompt. I'm trying to use Microsoft's Cryptography Next Generation (CNG), but I'm experiencing some non-trivial problems.
I'm trying to compile a simple test program:
#include
#include…

jww
- 97,681
- 90
- 411
- 885
1
vote
1 answer
What is an analog CryptSetProvParam(PP_SIGNATURE_PIN) analog in CryptoAPI NG?
I'm writing an application for smartcards. I know how my application can obtain the PIN using a method CryptSetProvParam, but I don't know how to do the same thing when I'm using CryptoAPI NG. I want to prevent the PIN request UI window pop up.

Sergey Zaitsev
- 164
- 9
1
vote
2 answers
How to export the GetHashInterface function?
I'm going to write a simple algorithm provider under CNG (Cryptography Next Generation), exactly an user-mode Hash Provider.
According to the instruction in CNG Development Kit Help "A hash provider must implement the GetHashInterface function and…

Vova
- 53
- 7
1
vote
1 answer
Creating public RSA key with RSACng: specified key is not a valid size for this algorithm
I'm currently trying to create a RSA encryption key as part of a web service authentication for Tableau.
I'm an noob when it comes to cryptography and can't quite figure out how to generate the public key.
I have a modulus that is 256 bytes and…

miketri
- 13
- 4
1
vote
0 answers
NCryptOpenStorageProvider returns 0x800706D9
The call NCryptOpenStorageProvider(myProvider, MS_KEY_STORAGE_PROVIDER, 0) returns 0x800706D9. Since I couldn't find this retcode in MSDN, I am really in a mess. What went wrong?

sashadereh
- 223
- 1
- 15
1
vote
1 answer
Import a persistent key in to Windows key storage using CNG storage functions
I'm trying to import a persistent RSA public key into the key storage. I read on the CNG help page that it's possible for private keys and I wonder if I can also apply is to public keys (specifically the BCRYPT_RSAPUBLIC_BLOB). I've tried with the…

GloriousLemon
- 509
- 7
- 18
1
vote
1 answer
Use key stored in Windows key store as a pre-shared secret key in OpenSSL
I'm wondering if this is possible. I've already implemented an SSL connection that uses PSK, but I wanted to somehow secure the PSK so that it could only be accessible by the current user. I figured the windows key store would be the safest.
Does…

GloriousLemon
- 509
- 7
- 18
1
vote
0 answers
BCrypt obtain symmetric key from BCRYPT_KEY_HANDLE
Hence given a BCRYPT_KEY_HANDLE (Lets say from the BCryptEncrypt function) is it possible to obtain the 'Master secret' or the 'SymmetricKey' to see SSL stream on wireshark un encrypted?

Frustrated
- 13
- 4
1
vote
1 answer
CNG replacements for CryptBinaryToString/CryptStringToBinary?
I was expecting to find CNG alternatives to the older Crypto API calls for serializing BLOB data. However there do not seem to be CNG replacements for CryptBinaryToString and CryptStringToBinary.
Am I missing something, or do most programmers…

Bob77
- 13,167
- 1
- 29
- 37
1
vote
1 answer
Endianness of BcryptSignHash output signature
The private and public key blobs generated by BcryptGenerateKeyPair are big-endian encoded (http://msdn.microsoft.com/en-us/library/windows/desktop/aa375520%28v=vs.85%29.aspx).
Using these keys, i sign a data using BcryptSignHash and generate a…

Fazlin
- 2,285
- 17
- 29
1
vote
0 answers
Adding new cipher suites in SSL (TLS) using CNG
As far as I know since Windows Vista CNG(Cryptography Next Generation), a personal user can add a new own cipher algorithm, which makes an own coded message (according information, for example, from…

Roman
- 11
- 2
1
vote
1 answer
Understanding BCryptSignHash output signature
I have signed a hash value in windows using BCryptSignHash with ECDSA algorithm. The output signature buffer is of length 64 bytes. I also generated the public and private key blobs using BCryptGenerateKeyPair function (BCRYPT_ECDSA_P256_ALGORITHM…

Fazlin
- 2,285
- 17
- 29
1
vote
2 answers
Make CNG crypto API work on Windows XP?
Is there a way to get the Microsoft Cryptography API: Next Generation to work on Windows XP?

Prof. Falken
- 24,226
- 19
- 100
- 173