Questions tagged [cryptoapi]

Cryptography API: Application programming interface that enables application developers to add authentication, encoding, and encryption to Windows-based applications. The API are oriented on the developer of unmanaged (native) applications in C/C++.

Cryptography API: Application programming interface that enables application developers to add authentication, encoding, and encryption to Windows-based applications. The API are oriented on the developer of unmanaged (native) applications in C/C++.

Microsoft cryptographic technologies include CryptoAPI, Next Generation (CNG), Cryptographic Service Providers (CSP), CryptoAPI Tools, CAPICOM, WinTrust, issuing and managing certificates, and developing customizable public key infrastructures. Certificate and smart card enrollment, certificate management, and custom module development are also described.

636 questions
0
votes
1 answer

“System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine

I am trying to decrypt some data using a certificate private key. It all works fine when the certificate is installed on the local machine (I am using a self signed certificate for testing and I have the private key for the certificate) but When I…
Nimesh Madhavan
  • 6,290
  • 6
  • 44
  • 55
0
votes
3 answers

Using CAPI engine with openssl

To load the capi engine dynamically, the following code is used: EVP_PKEY *key = NULL; ENGINE_load_builtin_engines(); ENGINE *engine = ENGINE_by_id("dynamic"); ENGINE_ctrl_cmd_string(engine, "SO_PATH", "./capi.dll", 0);…
User1234
  • 1,543
  • 4
  • 22
  • 32
0
votes
1 answer

CAPI AES: Why does CryptSetKeyParam returns NTE_BAD_DATA (0x80090005)

I am trying to encrypt/decrypt data using AES 128 bit with zero padding. I can encrypt/decrypt fine if I don't attempt to futz with the padding mode (defaults to PKCS5_PADDING), so the following snippet of code is to show where things are breaking…
rguilbault
  • 553
  • 1
  • 5
  • 17
0
votes
1 answer

Deprecated function from wincrypt

What does it mean that a function, in particular CryptExportPKCS8 is deprecated? https://msdn.microsoft.com/en-us/library/windows/desktop/aa379932(v=vs.85).aspx I'm aware that one can't use it with newer version of wincrypt just because it is not…
Leśny Rumcajs
  • 2,259
  • 2
  • 17
  • 33
0
votes
1 answer

Getting exception when calling CryptGetKeyParam

I'm trying to use the CryptoAPI (CAPI) to perform a Diffie Hellman Key Exchange. I'm using the MSDN documentation. // Step 0) Acquire context if (!CAPI.CryptAcquireContext(ref this._cryptographicProvider, null, null,…
cpkblake
  • 11
  • 1
0
votes
1 answer

SUBMIT certificate request - outside domain

I need to submit a PKCS#10 certificate request to a certificate authority who is outside my domain. This article in MSDN shows a way to submit certificate requests within a network using ICertRequest2 COM object. hr = CertRequest->Submit(…
Raj
  • 1,113
  • 1
  • 17
  • 34
0
votes
1 answer

'BUG: scheduling while atomic' with crypto_alloc_hash

I am trying to use Linux kernel's crypto libraries to calculate an HMAC value, given key and message. The idea is to calculate the HMAC and insert it in a TCP option during an iperf session (this part is not relevant). This is the function I wrote…
Fabrizio Demaria
  • 453
  • 1
  • 4
  • 15
0
votes
1 answer

SignerSignEx as the Azure WebJob

I found a brilliant use of SignerSignEx on C# here: https://stackoverflow.com/a/26372061 It works fine on the dev. machine, but on Azure WebJob you have to use something like this: X509Certificate2 cert = new X509Certificate2(certPath, …
0
votes
1 answer

How does Crypto API Call works

I'm working on securing the API {WSDL Endpoints} to HTTPS, trying to make use of CryptoAPI Calls in ASP.NET. Can any one tell me what a CryptoAPI call means, I have already gone through many websites, but I really don't understand why do we use…
Avinash
  • 1
  • 3
0
votes
0 answers

Using CryptoAPI do encrypt Winsock communication

I came across the CryptoAPI from the Microsoft MSDN to encrypt communication between my Clients and my Server for a basic Networking Application. (Just to learn about securing network communications). I decide to use AES 256bit cypher in CBC for…
0
votes
1 answer

determine, is cert. store system or physical, having HCERTSTORE handle only

let us assume, we have a valid HCERTSTORE handle of opened certificate store. How can we determine - is opened store physical or system? Restriction 1 - we should use CryptoAPI (C++) only. Restriction 2 - we've successfully forgotten, what kind of…
MrCat
  • 107
  • 2
0
votes
2 answers

encrypting a large file by cryptoapi in C++

I am using CryptoApi to encrypt a file (asymmetric encryption). Everywthing is ok but when the file is large, it can not encrypt it. I searched and found that I must encrypt block by block. Except for the last block the Final flag in CryptEncrypt…
user3864147
  • 285
  • 1
  • 3
  • 9
0
votes
1 answer

How to find the correct certificate when decdrypting with Crypt32 in c#?

I try to decrypt an ecrypted file. Sender sent 2 files, one from pord one from test environment. I can decrypt the prod version, but i can't decrypt the test version. When try to decrypt the good verison, my tool use my certificate to decrypt, but…
Mancika
  • 1
  • 2
0
votes
1 answer

Computing hash with crypto API

I've been trying to compute md5 hash using crypto API but have faced a lot of issues. char * getHashedKey(char *keybuf) { char * output; struct scatterlist sg; struct crypto_hash *tfm; struct hash_desc desc; int i; printk("%s received…
Natasha
  • 367
  • 1
  • 5
  • 15
0
votes
1 answer

Slow key enumeration in a machine RSA key container

I need to enumerate keys in the machine key container. Although this is generally an optional provider function, both MS_STRONG_PROV and MS_ENH_RSA_AES_PROV support it. I do not think I am doing anything wrong or unusual: first, acquiring a context…