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

CryptDecryptMessage failing

I have been trying to write some code to use the Microsoft CryptoAPI. The goal is very simple: encrypt and then decrypt a string. I seem to have it almost working, but the very last call to CryptDecryptMessage fails. So, I am able to successfully…
David I. McIntosh
  • 2,038
  • 4
  • 23
  • 45
0
votes
2 answers

Windows Crypto Api bad length

I found a simple unit for generating a RSA KeyPair and encrypting / decrypting. It works fine on small strings but on larger text I get error : Bad Length. What could be the cause , here is the unit, the unit wcrypt2 you can download here Tested on…
opc0de
  • 11,557
  • 14
  • 94
  • 187
0
votes
1 answer

how to pass the string to this MD5 program.?

am trying to implement an application that uses an MD5 hash underneath, i have acquired the MD5 hash program from the internet, but i don't know how to pass the string from my program ( my program written in C) to the program that calculate the MD5…
chard
  • 5
  • 3
0
votes
1 answer

Problems to import RSA key in other computer

I am creating a little tool for encrypt and decrypt using a pair keys (public and private keys). I export public and private key on my computer and I can encrypt and decrypt files without problems. I have problem when I try decrypt files in other…
Virkof
  • 1
0
votes
1 answer

Why does CryptAcquireContext return ERROR_ACCESS_DENIED when called from a process started via WMI?

I have an executable which calls CryptAcquireContext with CRYPT_NEWKEYSET: BOOL b_result; HCRYPTPROV prov; b_result = CryptAcquireContext(&prov, L"testcontext6", MS_DEF_PROV, PROV_RSA_FULL, CRYPT_NEWKEYSET); if(!b_result) { int err =…
richvdh
  • 1,163
  • 11
  • 19
0
votes
2 answers

java - get key from byte array

I have a java program that encrypts file content with a random-generated key. That key is encrpyted with RSA and saved into a text file. Now, I have a java program that given the file and the keystore where the RSA key is stored, needs to first…
MichBoy
  • 299
  • 1
  • 4
  • 13
0
votes
1 answer

Issue validating ASHWID (HardwareToken) in the cloud

I'm trying to validate HardwareToken issued by HardwareIdentification.GetPackageSpecificToken with an azure (.net 4.5) service. I followed the official guidance. But i'm stuck in the very last checking. I can't figure why the signature checking is…
0
votes
2 answers

OpenSSL decrypted text length

I am using this simple function for decrypting a AES Encrypted string unsigned char *aes_decrypt(EVP_CIPHER_CTX *e, unsigned char *ciphertext, int *len) { int p_len = *len, f_len = 0; unsigned char *plaintext = (unsigned char*)malloc(p_len +…
opc0de
  • 11,557
  • 14
  • 94
  • 187
0
votes
0 answers

how to crypto api for writing kernel module

I want to write a small kernel module in which I have to take a static string, hex-encode it and then use arc4 algorithm to encrypt it and then reverse the process. The logic is pretty clear to me. What I am suffering is that of a guideline of using…
rr_ovi
  • 283
  • 4
  • 14
0
votes
0 answers

C# cryptosystem .NET API interface with C

I am looking to implement the C# Cryptosystem .NET api with C code, so i am wondering what a possible at best route would be? I have currently begun looking at this link below. http://libtom.org/?page=features&whatfile=crypt I am wondering if it…
Recurrsion
  • 231
  • 3
  • 13
0
votes
1 answer

IX509PrivateKey::Create throws access denied when called as "Network Service"

I'm using IX509PrivateKey to create a key for an X.509 cert request (as "NT AUTHORITY\NETWORK SERVICE"), and the Create method is generating an access denied (I'm P/Invoke-ing the dispatch interface from C#, so the HRESULT is getting translated to a…
JohnC
  • 844
  • 4
  • 10
0
votes
2 answers

Is CryptEncrypt() thread-safe?

Microsoft says: The CryptEncrypt function is not guaranteed to be thread safe and may return incorrect results if invoked simultaneously by multiple callers. Does this mean that the function modifies global data? Or does it simply mean that you…
user541686
  • 205,094
  • 128
  • 528
  • 886
-1
votes
1 answer

Sign with ECDH using Cryptography API: Next Generation C++

The Signing Data with CNG example, shows how to sign and verify using ECDSA. I changed the code: BCRYPT_ECDSA_P256_ALGORITHM to BCRYPT_ECDH_P256_ALGORITHM NCRYPT_ECDSA_P256_ALGORITHM to NCRYPT_ECDH_P256_ALGORITHM However, the signature verification…
Cobaia
  • 1,503
  • 3
  • 22
  • 41
-1
votes
1 answer

about encryption and decryption using Crypto++ library

Can anyone please give a sample code for encryption and decryption of a text file using Crypto++ library.. Thanks in advance
Maruthu
  • 11
  • 1
-1
votes
1 answer

How to find chart for given symbol and date and screenshot it using python Selenium?

I am upgrading discord crypto bot and I need chart as an image to be able to be sent on discord. So when user type command (!info btc 7) (bitcoin 7 days chart) it should give him bitcoin chart for the past 7 days, and you can get it either on…
Ged0jzn4
  • 80
  • 6