Knowledgebase:
Microsoft CryptoAPI Error
Posted by Sean W, Last modified by Sean W on 10 February 2020 03:10 PM

--- ISSUE ---

While opening POSitive you may get an error similar to the following:

Cryptonite.Error in Cryptonite.AcquireContext(): Error 2: Unknown Error: 2  providerName = Microsoft Enhanced Cryptographic Provider 1.0

Windows CryptoAPI error 5: 05h: Access is Denied

When you hit 'OK' it brings up the "License to:" window. Either NEXT or QUIT brings up the following box:

You have not entered valid registration Information. POSitive will now exit.

Cryptonite Crypto CryptoAPI Cryptographic Error



--- EXPLANATION ---

This is not an issue with your POSitive Maintenance Key. It is a Windows folder permissions issue.


--- SOLUTION ---

1. Change the permissions of the 'C:\ProgramData\Microsoft\Crypto\RSA' folder so that 'Everyone' has full access
This folder is used by Microsoft Windows CryptoAPI

-- STEPS --
1. On the machine that you're seeing the error, open Windows File Explorer (not Internet Explorer)
2. Navigate to the 'Crypto' folder: C:\ProgramData\Microsoft\Crypto
--- NOTE: The "ProgramData" folder may be hidden. You can just type the above path into the
address bar at the top of Windows File Explorer or turn on the option in Windows to
show hidden folders.
3. Right click on the 'RSA' folder (C:\ProgramData\Microsoft\Crypto\RSA)
4. Choose 'Properties'
5. On the 'RSA Properties' windows click the 'Security' tab
--- Does 'Everyone' exist in the list of 'Group or user names' section?
------ Yes
--------- a. Highlight 'Everyone' and click the 'Edit' button
--------- b. Make sure all checkboxes are selected under the 'Allow' column
--------- c. Click 'OK', then click 'OK' again to close the 'RSA Properties' window
------ No
--------- a. Click the 'Edit' button
--------- b. Click the 'Add...' button
--------- c. Type "Everyone" into the 'Enter the object names to select (examples)' field
--------- d. Click 'OK'
--------- e. On the 'Security' tab of the 'Permissions for RSA' window, highlight 'Everyone' in the 'Group or user names' section
--------- f. Make sure all checkboxes are selected under the 'Allow' column
--------- g. Click 'OK', then click 'OK' again to close the 'RSA Properties' window

Source: https://www.capesoft.com/docs/CryptoNite/CryptoNite.htm#FAQ


Additional legacy folder locations:

The Microsoft legacy CryptoAPI CSPs store private keys in the following directories

%APPDATA%\Microsoft\Crypto\RSA
%ALLUSERSPROFILE%\Application Data\Microsoft\Crypto\RSA


Source: https://msdn.microsoft.com/en-us/library/windows/desktop/bb204778(v=vs.85).aspx


2. Alternatively, this could also be caused by corrupt key files in the C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys folder
Delete all the files in that folder and run the program again.

3. Another thing you can try is to rename the 'RSA' folder to 'RSA.old' and restart the computer.

4. Try booting into Windows Safe Mode and renaming the 'Crypto' folder to 'Crypto.old' and restarting the computer.

Keywords: Crypto, CryptoError, Error, CryptoAPI, Cryptography, Cryptographic, Cryptonce


Updated 2/10/2020


Comments (0)