I am trying to extract cookies from Chrome browser. I have found this post Reading and Inserting Chrome Cookies Java It takes cookies from user browser. The problem is that it doesn't work. This part of code throws an exception:
System.setProperty("jna.predictable_field_order","true");
decryptedBytes = Crypt32Util.cryptUnprotectData(encryptedCookie.getEncryptedValue());
com.sun.jna.platform.win32.Win32Exception: Недопустимые данные.
at com.sun.jna.platform.win32.Crypt32Util.cryptUnprotectData(Crypt32Util.java:128)
at com.sun.jna.platform.win32.Crypt32Util.cryptUnprotectData(Crypt32Util.java:103)
at com.sun.jna.platform.win32.Crypt32Util.cryptUnprotectData(Crypt32Util.java:90)
at CookieExtractor.CookieExtractor$ChromeBrowser.decrypt(CookieExtractor.java:486)
at CookieExtractor.CookieExtractor$ChromeBrowser.processCookies(CookieExtractor.java:448)
at CookieExtractor.CookieExtractor$Browser.getCookiesForDomain(CookieExtractor.java:256)
at CookieExtractor.CookieExtractor.getCookie(CookieExtractor.java:50)
at CookieExtractor.CookieExtractor.main(CookieExtractor.java:38)
I started to dig how could I decrypt Chrome cookie and found this jar http://jdpapi.sourceforge.net/ but it didn't work too because this jar could not work with 64 bit OS. So I am really confused of how I can decrypt cookie from Chrome.
Any help appriciated!