I am making an application that displays ur saved browser password(s) (right now I'm using Google Chrome) in an easy way. Everytime I run this code I get an error at byte[] newbyte = Crypt32Util.cryptUnprotectData(mybyte);
. The code used is written below. This code provides some context. I never had this problem and after some research I can't find a clear solution. I hope someone can help me with it.
Code:
Connection connection = null; connection = DriverManager.getConnection("jdbc:sqlite:" + path_to_copied_db); PreparedStatement statement = connection.prepareStatement("SELECT `origin_url`,`username_value`,`password_value` FROM `logins`"); ResultSet re = statement.executeQuery(); StringBuilder builder = new StringBuilder(); while (re.next()) { String pass = ""; try { byte[] mybyte = (byte[])re.getBytes("password_value"); byte[] newbyte = Crypt32Util.cryptUnprotectData(mybyte); //Error on this line:71 pass = new String(newbyte); }catch(Win32Exception e){ e.printStackTrace(); } builder.append(user + ": " + re.getString("origin_url") + " " + re.getString("username_value") + " " + re.getBinaryStream("password_value") + "\n"); }
Error:
com.sun.jna.platform.win32.Win32Exception: The parameter is incorrect. 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 Client.Client.main(Client.java:71)
https://stackoverflow.com/questions/66766869/win32exception-the-parameter-is-incorrect March 24, 2021 at 12:03AM
没有评论:
发表评论