Menu

#20 API to read the Encrypted Values from Windows Registry

latest
open
None
8
2011-06-14
2011-06-14
No

Hi,

I have a requirement i need to read the values from Windows Registry that is encrypted using Auto-Generated MachineKey in windows.
Is there a way to read the encrypted data values from Windows registry using JRegistry APIs ?

My Java Application invokes a 3rd party Tool that writes the key/value to windows registry settings under : “HKLM\Software\<3rdparty>\dataValue”.

This entry is in BINARY and encrypted with 3DES, using crypto API from Microsoft.

3rd party software to encrypt the data stored in registry it
either uses C++ code: and uses the call “CryptProtectData” and “CryptUnProtectData” or
If it is a .NET (C#) it uses the call “Protect” or “UnProtect” from class “ProtectData” of WinCrypt.h from the library “Crypt32.lib.

Note: The data is encrypted using auto-generated machinekey and there is no public key shared to decrypt the Encrypted data.
Since the data is encrypted using auto-generated machinekey the same can be decrypted from a .Net / C++ application using CryptUnprotectData or UnProtect() API of WinCrypt.h from the library “Crypt32.lib.

To know more about Auto-Generated MachineKey in Windows refer the links below
http://aspnetresources.com/tools/machineKey
http://msdn.microsoft.com/en-us/library/ms998288.aspx

I need to find a way in Java to find the equivalent API to decrypt (CryptUnprotectData) and Microsoft will automatically use the correct key.
I am planning to use JRegistry for reading the values from windows registry.
But not sure if the JRegsitry support reading encrypted values from windows regsitry that is encrypted using Auto-generated machine key in windows by the .Net Application.
Also i couldn't find any information related to Java APIs to enrypt or decrypt data using auto-generated machinekey.

Is there a way to read the encrypted data from Windows regsitry settings that is encrypted using the Auto-Generated Machine Key ?

Kindly let me know if Java provides any such API or mechanism for this.

Discussion

  • Suresh Rajanna

    Suresh Rajanna - 2011-06-14
    • priority: 5 --> 8
     
  • Suresh Rajanna

    Suresh Rajanna - 2011-06-14
    • assigned_to: nobody --> bayblade
     

Log in to post a comment.