I am trying to get the RSA public key info in WinHTTP. So far I've got the certificate info in CERT_CONTEXT structure. I can get encryption algorithm and others as follows:
PCCERT_CONTEXT cert;
DWORD certLen =…
I need to mark a custom self-signed root certificate as trusted during certificate chain validation and, overall, I want to rely on the system API as much as possible.
I create a temporary memory store.
HCERTSTORE certStore =…
I am trying to sign a public/private key pair by a temporary Root CA, steps followed are next:
Create a self-signed root authority certificate (CertCreateSelfSignCertificate) (Done)
Generate public/private key pair (CryptGenKey) (Done)
Sign…
I have a Smart Card (actually USB Token) with some certificate and keys written on it. Now I need to retrieve this certificate using python on Windows. How can it be achieved?
I had a look on pyscard package but it seems too low-level and probably…
We are trying to generate RSA SHA512 signature with CNG, we wrote code and generated hash value not matching with OpenSSL.
Private key used for signing we generated with OpenSSL command in DER format as below.
openssl genpkey -out privkey.pem…
I used to work with crypto++ in Visual Studio before, but now I want to use of wincrypt.h API functions to encrypt a string with AES 256 with an IV (cbc mode).
I did bellow steps but I'm confused about CryptEncrypt() and CryptDecrypt() functions,…
I have this program working that encrypts a string of 9 bytes using AES128 from wincrypt.h but something strange happens when I change last character of the key:
from L"3igcZhRdWq96m3GUmTAiv2" to for example L"3igcZhRdWq96m3GUmTAiv1" or…
I use visual studio 2013 and windows 7 32bit.
I want to verify digital signature by root and chain of certificate.
So I get 0x80070057 error code in certcreatecertificatechainengine().
bool result = false;
HCERTCHAINENGINE …
I want to rewrite old C code from 1990 to Go. But the pain point here is migration of cryptographic algorithms. I have the following Cpp code that successfully decrypts the cipher into plain text.
#include
#include
#include…
I need to verify an .exe and ensure the publisher name matches the expected name (not based on a key since that can change as new code signing certificates are issued, the name is always the same).
I found samples of using WinVerifyTrust to verify a…
I need to write a python code that installs a certificate into my machine's (windows) or local user's trusted root certificates. I tried the below code. The code runs without error but looks like the store is not windows trusted root. I also read…
I need to verify a signed JAR file using Windows crypto API methods. I have only a basic understanding of encryption and signing matters. I'm also new to those crypto APIs (WinCrypt, Bcrypt, Ncrypt). Verifying the file hashes wasn't a problem, but…
I have a code that encrypts a file using AES CFB mode. While the code runs correctly in Windows 7, Windows 8 and previous versions of Windows 10, on Windows 10 Creators Update this line fails:
if (!CryptAcquireContext(&hProv, NULL,…
I am trying to encrypt a text message with wincrypt. My code is however unpredictable. It doesn't encrypt/decrypt the whole plaintext but only a part of it. If i change the length of password (for example to "password123") it encrypts/decrypts a…
I am learning python and trying to convert the above code snippet found online to python.
As my understanding, the below code is generating the session key based upon SHA1 hash of the password "Microsoft" but I am not sure how I can derive AES 256…