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
4
votes
2 answers

RSACryptoServiceProvider.ExportCspBlob data format

We are exporting a public and private key. The private key is to be consumed by non .net software written in Magic. The developers have questions around the format of the exported key. Is there a whitepaper or other resource that explains the…
Jeremy
  • 44,950
  • 68
  • 206
  • 332
4
votes
2 answers

Can I get public/private key pair from a key container in smartcard?

Can I get the public/private key pair from a key container inside a smartcard using PKCS #11 or CryptoAPI?
tandaica0612
  • 369
  • 10
  • 23
4
votes
2 answers

CCXT okex5 swap contracts - Parameter posSide error

I am trying to create a perpetual limit order using ccxt on okex exchange version 5. The API is successfully placing orders(both limit and market) on spot exchange but not on perpetual exchange. Here is what I am trying - exchange_swap =…
4
votes
2 answers

Binance WebSocket Order Book - depths change every time

Below is a python script that subscribes order book information via Biance's Websocket API (Documentation Here). In both requests(btcusdt@depth and btcusdt@depth@100ms), each json payload is streamed with a varying depth. Please shed light on what…
koyamashinji
  • 535
  • 1
  • 6
  • 19
4
votes
2 answers

How to work with CryptoAPI via C#?

There is a group of CryptoApi functions which works with crypto service providers…
VoimiX
  • 1,180
  • 3
  • 16
  • 31
4
votes
2 answers

Encrypt/Decrypt across machines is a no-no

I'm using an identical call to "CryptUnprotectData" (exposed from Crypt32.dll) between XP and Vista. Works fine in XP. I get the following exception when I run in Vista: "Decryption failed. Key not valid for use in specified state." As expected,…
Scott Marlowe
  • 7,915
  • 10
  • 45
  • 51
4
votes
2 answers

Generate a CrypoAPI (CAPI) Private Key

I am trying to implement encryption at rest using an IXmlEncryptor. Specifically using a CertificateEncryptor. (This is part of the IXmlRepository system for sharing keys for decrypting cookies and general key management in ASP.NET Core.) This…
Vaccano
  • 78,325
  • 149
  • 468
  • 850
4
votes
1 answer

How to access Kucoin OHLC data from API?

I need to access kucoin Open-high-low-close data from Kucoin API. Looking in https://docs.kucoin.com/#get-trade-histories, I deduced that to access OHLC data (for instance BTC versus USDT, with hourly timestamp), the address should be something like…
daveturner
  • 188
  • 1
  • 9
4
votes
1 answer

How to get the public key from a certificate in windows system certstore

I have added a certificate to the system store with something like this: PCCERT_CONTEXT pCertContext; HCERTSTORE hCertStore; CRYPT_KEY_PROV_INFO provInfo; if (pCertContext = CertCreateCertificateContext(MY_ENCODING_TYPE, certDER, certSize)) { …
4
votes
1 answer

Translate Windows RC4 CryptDeriveKey to PHP for openssl

This is the second component of the legacy system translation we’ve been trying to do. We have managed to match exactly the initial binary password/key that Windows ::CryptHashData generates. That password/key is passed to ::CryptDeriveKey where it…
Cosworth66
  • 597
  • 5
  • 14
4
votes
4 answers

How to generate and use public key cryptography in WinCrypt

I'm currently experimenting with the Windows Cryptography API and running into some problems with Public-Key-Cryptography. I can find lots of examples of how to encrypt items, but nothing directly addressing a start-to-finish public key…
Tom
  • 73
  • 1
  • 9
4
votes
1 answer

Converting between Windows CryptoAPI and OpenSSL x509 formats

I have a CERT_CONTEXT structure which I've extracted from a smart card on Windows via the CryptoAPI. I need to convert this structure into a DER encoded byte array which is consistent with OpenSSL. The closest match I've got so far is via…
Gearoid Murphy
  • 11,834
  • 17
  • 68
  • 86
4
votes
1 answer

Implement Windows CryptoAPI CryptDeriveKey Using OpenSSL APIs

I have a CryptoAPI code to encrypt\ decrypt given data using AES-128 and a key derived from a password using SHA-256. How can I write an OpenSSL equivalent implementation so I would be able to encrypt data with it, then decrypt it with CryptoAPI and…
rkellerm
  • 5,362
  • 8
  • 58
  • 95
4
votes
1 answer

Use AES CBC with NCrypt in windows

I'm trying to use the NCrypt.dll to encrypt some data, in C++, and I'm having trouble handling keys and algorithms. I would like to use AES with the CBC chainging method but, can't get the NCryptEncrypt function to work (I keep getting an invalid…
PMARSH
  • 167
  • 3
  • 14
4
votes
4 answers

Memory Leak while verifying Authenticode Signature of Executables?

I am using WinVerifyTrust to verify the validity of some Windows executables with the following function, called in a loop from _tmain: int signature_is_valid(const wchar_t *filepath) { GUID guid = WINTRUST_ACTION_GENERIC_VERIFY_V2; …
the_void
  • 5,512
  • 2
  • 28
  • 34