2014-01-17 34 views
18

我忘记了我的Android密钥库的密码,但它保存在Intellij IDEA密码管理器中。我知道主密码,因此IDEA能够自动完成密钥存储密码,但我无法从文本字段查看或复制/粘贴密码。Intellij IDEA - 查看保存的密码

是否有插件可以做到这一点,也许?

我也尝试寻找一些日志或shell,因为我认为幕后IDEA使用SDK中的keytool实用程序,所以也许我可以在命令行中找到密码。

我已经跑出了想法。请帮忙。

编辑:如果有人知道加密密码保存在哪里,我可以备份该文件并在将来的IDEA安装中使用它,并使用相同的主密码。这会起作用吗?

+0

类似的问题仅供参考:http://stackoverflow.com/questions/21006690/recover-passwords-protected-by-master-password-in-intellij-idea –

回答

36

我已经设法了解的源代码足以放在一起一个小型的实用程序,使用主密码解密security.xml文件中的密码。 https://github.com/corneliudascalu/intellij-decrypt

+3

非常感谢你,拯救生命! –

+0

安全。xml位于C:\ Users \ {user} \ {intellij.folder} \ config \ options \ security.xml – homaxto

+0

在mac上,该文件位于以下位置:〜/ Library/Preferences/IntelliJIdea2016.2/options/security。 xml –

2

具有相同的问题,除非我根本没有设置主密码。

经研究发现,该密码位于security.xml文件中,位于.IntelliJIdea12/config/options filder。但它受到AES保护(至少看起来如此)。

- 编辑 -

参看下面我的评论,在那里我已经指向IDE源,处理密码存储和加密

+0

谢谢。 Intellij IDEA代码是开源的,所以应该能够弄清楚如何解密密码。我会试着去研究它。 –

+0

我发现了密码存储和编码\解码的实现,但未能弄清楚如何反转过程。与com.intellij.ide.passwordSafe namespase相关的所有代码均位于该文件中。例如 - 读取\写入密码数据库的api位于com.intellij.ide.passwordSafe.impl.providers.masterKey.PasswordDatabase(http://goo.gl/cbmFAU)。加密\ decrypt代码位于com.intellij.ide.passwordSafe.impl.providers.EncryptionUtil(http://goo.gl/0gIcBU) – itmamonth

+0

'EncryptionUtil'类似乎只从标准JAva库中导入类,所以它应该可以在不编译整个IDEA代码库的情况下使用它。解密的方法应该是public static byte [] decryptKey(byte [] password,byte [] encryptedKey)'(http://grepcode.com/file/repository.grepcode.com/java/ext/com.jetbrains/ intellij-idea/12.1.2/com/intellij/ide/passwordSafe/impl/providers/EncryptionUtil.java?av = f#148) –