I am trying encrypt and decrypt data using function
CryptDecrypt(..) these are MFC function it compile and deploy fine. But this function parameter hkey is null when i debug it then when // Get the handle to the default provider.
CryptAcquireContext(&hCryptProv, this hCryptProv is also null i think therefore it not created hKey.
May i know is this
CryptDecrypt(..) function are compatibel or any other function there for cryptography. Please help me out this condition.
Could you quickly check this link : https://www.codeproject.com/Articles/1658/Obtain-the-plain-text-session-key-using-CryptoAPI and let us know, is it helps you?
Please wait for a day, let me search in WinCE code base and get back you tomorrow. Thank you.
ok, Its work fine on Desktop windows 10 but, How about wince toradex platform.
We never tested these functions but there are samples available from the WinCE code base.
Could you install WinCE platform builder and take a look at those codes, we should not share the code here.
If possible, could you share the reproducible demo project that will help us to debug it quickly?
in this code attached only i commented
- Advapi32.lib at line 12 as commente name
- 35 and 36 line
- And put path for encrypt file at 39 and 40
Maybe certain crypto functionality not supported on Window Embedded Compact. Could you check the Microsoft documentation here: https://csrc.nist.gov/csrc/media/projects/cryptographic-module-validation-program/documents/security-policies/140sp825.pdf. Sorry we don’t have experience on this, you would also consider getting help from MSDN forum: https://social.msdn.microsoft.com/Forums/en-US/home?forum=winembplatdev
Below sample code is working on WinCE
if (!CryptAcquireContext( &m_hProv, L"mycontainer", // Default key container NULL, // Default provider PROV_RSA_AES, CRYPT_NEWKEYSET | CRYPT_SILENT))
please share demo code.
Sorry, we should not share the Microsoft sample code over the public forum. Could you install WinCE6 or WinCE7 platform builder with private(shared) code there can find the samples?