Questions tagged [wincrypt]

The portion of Windows API dealing with cryptography.

The portion of Windows API dealing with cryptography.

85 questions
0
votes
1 answer

Decoding windows certificate serial number in python

I'm trying to decode the serial number of a X.509 certificate, I opened with win32crypt in Python (http://timgolden.me.uk/pywin32-docs/PyCERT_CONTEXT.html) import win32crypt import sys # lpszStoreProvider CERT_STORE_PROV_SYSTEM = 0x0000000A #…
sewe
  • 53
  • 7
0
votes
0 answers

Where are UWP application certificates stored? I can't see them in the wincrypt functions

I am trying to access a certificate that was created using a C# UWP app from a managed C++ DLL within that same application. I can't however use the C# interface as I need to support SNI on this socket (As far as I can tell, UWP does not support SNI…
YodaGhost
  • 11
  • 2
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

Can’t create contex for AES encryption. Windows XP

I have made such code that will create contex for aes encryption (with Win32API support): if (!CryptAcquireContext(&hProvs, NULL, NULL, PROV_RSA_AES, CRYPT_VERIFYCONTEXT)) { if (!CryptAcquireContext(&hProvs, NULL, NULL, PROV_RSA_AES,…
0
votes
0 answers

Get session key generated from CryptDeriveKey()

I am working with the crypto libraries and I am trying to create a simple password algorithm with the libraries. I used MSDN's Deriving a Session Key from a Password to generate keys by passing in a "username", but I'm not sure how to get the key…
droidnoob
  • 333
  • 5
  • 17
0
votes
1 answer

Finding CRL distribution point URL from certificate using visual c++

I have to find CRL distribution point URL from a certificate. I managed to get obtain context (CERT_CONTEXT) of a certificate. From this, how do I find CRL URL? To obtain publickeylength, there was a function CertGetPublicKeyLength. Similary is…
Oxia
  • 1
  • 1
0
votes
1 answer

CryptQueryObject systematically falls

I try to integrate root certificate installation within my programm installer. I have to create an object from certificate and then add it to the store. const std::string cert = R"cert( -----BEGIN CERTIFICATE----- /***/ -----END…
EmmaStone
  • 23
  • 8
0
votes
1 answer

How export all my certificates of software separately to a .pfx file?

I want export programatically of a computer all my certificates of software separately to .pfx file to sign 2 new softwares that already are in final step of building in another pc. To make this i found a C++ code example (that after i translate to…
user9672569
0
votes
0 answers

wincrypt output not matching other languages

I've been attempting to play around with the wincrypt api, but can't seem to figure out why the output from CryptEncrypt doesn't match the output from a language like Go. wincrypt code BYTE *inBuffer = (BYTE*)"Hello World"; HCRYPTPROV phProv =…
b00stfr3ak
  • 303
  • 1
  • 4
  • 10
0
votes
1 answer

BCryptImportKeyPair returns STATUS_INVALID_PARAMETER when i try to import public key

I followed this example. I am trying to add the public key which i got from the server into the key Pair and I am getting STATUS_INVALID_PARAMETER. BCRYPT_DH_KEY_BLOB header; header.dwMagic = BCRYPT_DH_PUBLIC_MAGIC; header.cbKey =…
Prakash N
  • 1,020
  • 1
  • 8
  • 20
0
votes
1 answer

NTE_BAD_DATA in CryptSetKeyParam while setting KP_P in wincrypt

I am having the below code. I am setting a prime for diffie-hellman algorithm using char *. I am getting bad data after i set the prime. Where am i doing wrong? I followed the same example in this…
Prakash N
  • 1,020
  • 1
  • 8
  • 20
0
votes
1 answer

Wincrypt Diffie Hellman error

I am trying to use wincrypt to generate the private key using P and G values. I get ERROR_INVALID_PARAMETER I am not sure what is wrong in my code. It is the same implementation as in example code given in microsoft…
Prakash N
  • 1,020
  • 1
  • 8
  • 20
0
votes
0 answers

CryptDestroyKey access violation exception in VS2015

I am working on a task in a C++ project to upgrade some components from building with VS2010 to build with VS2015 and noticed a strange behavior that I could not find any discussions online. Simplified code is as follows: #include "stdafx.h" int…
0
votes
2 answers

AES-128 encryption using WinCrypt

I need to encrypt strings under AES-128 for my C/C++ app making use of WinCrypt. Just for understanding how the whole thing works, I have written a program to encrypt a 16 byte string with a 16 byte AES key (128 bits) but it is not working as…
Captain Nemo
  • 262
  • 1
  • 7
  • 22
0
votes
0 answers

Errors when compiling (Sublime/Visual Studio)

I am using Sublime Text 3 (build 3126) with g++ on Windows 10 x64 to compile my c++. My code so far is: #include #include #include #include using namespace std; int main() { return 0; } But when I…
rE bOot
  • 27
  • 5