Im trying to decrypt the value of an database on which i have access on. The password is crypted via Windows API. So my thought was ok. Lets just try then to decrypt it the same way!
Im using Java 1.8.0_60 with JNA-platform.jar...
while (results.next()) {
String address = results.getString("value1");
String username = results.getString("value2");
String password = new String(Crypt32Util.cryptUnprotectData(results.getBytes("value_which_is_crypted")));
list.add(new String[] { value1,value2,value_which_is_crypted });
}
However, if im trying to execute my code im getting an ClassNotFoundException!
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/jna/Structure
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.sun.jna.platform.win32.Crypt32Util.cryptUnprotectData(Crypt32Util.java:121)
at com.sun.jna.platform.win32.Crypt32Util.cryptUnprotectData(Crypt32Util.java:103)
at com.sun.jna.platform.win32.Crypt32Util.cryptUnprotectData(Crypt32Util.java:90)
at recover.Chrome.recover(Chrome.java:35)
at recover.Chrome.main(Chrome.java:49)
Caused by: java.lang.ClassNotFoundException: com.sun.jna.Structure
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 17 more
I hope this is enough information because this clearly gave me a headache. Thanks for help!
EDIT:
ok lesson learned.. when using jna include both jna.jar and jna-platform.jar >in your buildpath! Thanks for your help!
You also need jna.jar
in the classpath - com/sun/jna/Structure.class
is in that jar.