Questions tagged [wincrypt]

The portion of Windows API dealing with cryptography.

The portion of Windows API dealing with cryptography.

85 questions
0
votes
0 answers

How to use 64-bit crypt32.dll or cryptnet.dll in 64-bit C# application

Infos: I have a 32-bit C# (.Net Framework 4.8) application which does Crypto operations and Database operations via ODBC drivers (MSSQL and MySQL). This application will be/is executed on Windows. The target machine will have either MSSQL/MySQL…
mDev
  • 1
  • 1
0
votes
1 answer

How to encrypt data in one instance of Windows and decrypt in different OS instance running on the same system?

This is an extension of How to encrypt data in one app and decrypt it in different Windows app with RSA keys tied to local system?. From the linked question above, I was able to encrypt/decrypt data between multiple apps under same OS instance (i.e.…
videoguy
  • 1,732
  • 2
  • 24
  • 49
0
votes
1 answer

How to encrypt data in one app and decrypt it in different Windows app with RSA keys tied to local system?

I have a setup where I need to encrypt blob of data in one app and decrypt it in different app. I built a sample app that creates a named CngKey object. Then create a RSACng using CngKey object. Then use RSACng object to do encryption/decryption.…
videoguy
  • 1,732
  • 2
  • 24
  • 49
0
votes
1 answer

PFXExportCertStoreEx to export private and public keys

I have used PFXExportCertStoreEx API to successfully export public and private key of a RSA certificate from Windows key store. Can the same PFXExportCertStoreEx be used to export public and private keys of DSS and ECDSA certificates from the…
0
votes
1 answer

Export Private key from Windows Certificate Store when "Enable Strong Private Key protection" is set

I am trying to use WinCrypt APIs to extract private key for a certificate installed in Windows Certificate Store. The certificate is installed in LocalMachine - "My" store and by default the "Enable Strong Private Key protection" is greyed out (as…
0
votes
1 answer

Why does CryptDecrpyt() from MS CryptoAPI not decrypt the first 16 bytes correctly on remote system?

I was trying to come up with how to use MS CryptoAPI to create a session key and transfer to a remote so they can encrypt data being sent over a private network (so not worried about man in the middle, just packet sniffer). Also need to support…
user3161924
  • 1,849
  • 18
  • 33
0
votes
0 answers

How do you use WinCrypt to exchange symmetric keys using RSA between client / server?

I'm completely lost looking at the WinCrypt samples, I think it's doing a lot of stuff automatically, but I don't get it. I can use it fine locally but what I want to do is generate a RSA private/public key pair on two different networked systems.…
user3161924
  • 1,849
  • 18
  • 33
0
votes
1 answer

CertGetNameString throws heap corruption

CertGetNameString() throws heap corruption error randomly, using the function CertGetNameStringW() does the same LPCWSTR pszName = (LPCWSTR)malloc(cbSize * sizeof(TCHAR)); if…
namus
  • 59
  • 1
  • 7
0
votes
1 answer

JWT Verification on WIN32

I'm attempting to verify a RS512 JWT using the WIN32 cryptography functions. I've got the public key, data to be verified, and signature data as in-memory arrays. I'm able to create the certificate context and import the public key, but so far I…
Runt8
  • 547
  • 1
  • 7
  • 17
0
votes
1 answer

Visual Studio: Getting all certificate issuer details from executable

I want to be able to get all the issuer data that you can get from Windows Explorer like here: I've been able to get CN from https://learn.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-certgetnamestringw, but I don't know what it is…
Opux
  • 702
  • 1
  • 10
  • 30
0
votes
1 answer

how to connect firebase with libcurl

I want to connect my code to firebase with using libcurl library and read datas i have function like this static size_t my_write(void* buffer, size_t size, size_t nmemb, void* param) { std::string& text = *static_cast(param); …
0
votes
1 answer

Why does Windows CryptVerifySignature Fail on Signature created by PHP?

I want to create a hash in PHP and sign it on a Linux server (using XAMPP on Windows for the testing) and then verify the hash on Windows using the public key. I have the following PHP script to generate it (I then right click, view source,…
0
votes
0 answers

C# Error Using ProtectedData.Unprotect() Function

I'm experimenting with ProtectData.Protect() and ProtectData.Unprotect() functions in C#. I've written a program that writes encrypted data to an SQLite database, and then reads the database and decrypt the data. Every time I run my code I receive…
0
votes
0 answers

How to use CryptEncrypt and CryptDecrypt?

In my C application, I use a CryptEncrypt with a key, which I get from a string that I read from a file with the help CreateHash, DeriveKey etc. HCRYPTPROV hProv = 0; HCRYPTKEY hKey = 0; HCRYPTHASH hHash = 0; char* dataToEncrypt =…
Sova Kefirova
  • 201
  • 1
  • 9
0
votes
1 answer

How to point to/access a cert file `CertCreateCertificateContext` function? (wincrypt api)

A little new to windows programming/C++. I'm trying to install a .p7b root certificate file to the Trusted Root Certificate Store. I want to use the Windows Wincrypt library. Specifically, these are the suggested steps that I got from an old forum:…
bwang
  • 49
  • 7