Questions tagged [cng]

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.

256 questions
0
votes
0 answers

Implementing custom ECDH into OpenSSL 1.1.0e using Windows CNG API

I'm integrating a custom engine into OpenSSL v1.1.0e and currently implementing the ECDH functions using Windows CNG (the BCrypt functions). I'm a little confused as to what design to follow. As far as I understand, I would need to implement the…
themadking
  • 67
  • 1
  • 7
0
votes
0 answers

Wincrypto (CNG): unable to create certificate using any CNG algorithm

I'm writing a code that would create a certificate in Certificate Store, and I'm using CNG. Actually not really writing, but adapting an example from MSDN. My code compiles, it creates keys for some algorithms, but none of those keys can be used to…
MorJ
  • 566
  • 4
  • 14
0
votes
1 answer

what is the CngKeyBlobFormat of EccPrivateBlob generated by CngAlgorithm.ECDiffieHellmanP521/P256/P384?

CngKey key = CngKey.Create(CngAlgorithm.ECDiffieHellmanP521, null, new CngKeyCreationParameters { ExportPolicy = CngExportPolicies.AllowPlaintextExport }); byte[] keyBlob= key.Export(CngKeyBlobFormat.EccPrivateBlob); the length of keyBlob is…
0
votes
1 answer

Best approach for Id generation and password hashing using DDD for User Domain model

I'm new to DDD and right now I'm in the process of implementing user registration. Basically the flow is: Controller receives request Maps the received data from client to User Domain model. Maps the User Domain model to an EF-core entity…
0
votes
0 answers

C# CngKey ECDelfieHellmanP521

I have been struggling to create a CNGKey with a certain private key and with a key name can someone please assist me. Below is the code. I need to create this cngkey on multiple servers with the specific private key. When the key is created it does…
Lexi
  • 1
  • 5
0
votes
1 answer

Unresolved external symbol bcrypt_gensalt

I have one problem with library . Compiler say error with function bcrypt_gensalt. #include #include using namespace std; int main() { const char* passwd = "Secret_Password"; char…
0
votes
0 answers

Can I decrypt a .gpg file by using Windows CNG store?

I'm creating this tool in C# that would take a .gpg file and decrypt it using Windows CNG. I get a .gpg file as my input parameter and it is encrypted with my key using WinPT. Decrypting it works with the tool and I can also decrypt using…
Tomaz Leopold
  • 75
  • 1
  • 9
0
votes
0 answers

Application specific isolated CngKey

I am creating a CngKey. The key is being generated successfully. The problem I am facing is that, I want to use concept of Sandboxing. Like in Android or iOS, one application cannot access the data of another application. I want the similar behavior…
0
votes
1 answer

CNG/BCrypt APIs in Windows IoT?

Does Windows IOT supports CNG/BCrypt APIs? If possible, I'd like to have some references in case it does support.
rbw
  • 187
  • 5
0
votes
1 answer

Can/how do microsoft docker containers work with CNG KSPs?

I have some windows c++ code that uses CNG to access the Microsoft Software Key Storage Provider: https://learn.microsoft.com/en-us/windows/desktop/seccertenroll/cng-key-storage-providers#microsoft-software-key-storage-provider I would like to…
Timothy John Laird
  • 1,101
  • 2
  • 13
  • 24
0
votes
2 answers

CA2202: Object can be disposed of more than once

I'm getting the following warning in the following code snippet but I cannot understand why warning CA2202: Microsoft.Usage : Object 'memStream' can be disposed more than once in method 'Encrypt(string)'. To avoid generating a…
Ben Adelson
  • 33
  • 1
  • 4
0
votes
1 answer

Load Private Key Only By Company Signed Application

For my applications, I have a private key stored using the Windows CNG functions, but I don't have a way to ensure when the applications communicate that the messages are from my applications. I need is a way for me to only allow the private key…
JadziaMD
  • 2,690
  • 5
  • 31
  • 42
0
votes
2 answers

BCryptDeriveKeyPBKDF2 replacement for Windows Embedded Compact 2013

I have to compile existing C code using CNG (Cryptography API: Next Generation) functions for Windows Embedded Compact 2013. This code is using BCryptDeriveKeyPBKDF2, which is not available under Windows Embedded Compact 2013. That means I need a…
haide
  • 11
  • 1
  • 5
0
votes
1 answer

Import key on a given token with CNG

I've recently started fiddling with CNG to manage smartcards in our applications, and something remains quite unclear: How do you import a key into a given smartcard ? It seems to me that the KSP just creates the key on the first card it…
lieblo
  • 182
  • 1
  • 1
  • 9
0
votes
1 answer

RSACng setting salt value

I have official test vectors (FIPS 186-4 https://csrc.nist.gov/projects/cryptographic-algorithm-validation-program/digital-signatures#rsavs, SigGenPSS_186-3.txt) for PSS, I need to add a specific salt to test PSS. Is there any way I could add custom…
karolyzz
  • 480
  • 4
  • 28