gpt4 book ai didi

Java Keystore 密码没意义?

转载 作者:IT老高 更新时间:2023-10-28 23:24:13 27 4
gpt4 key购买 nike

keystore 密码背后的具体含义是什么,例如在 JKS/BKS keystore 中?

这显然不是为了安全,因为我可以用编辑器打开文件并将所有条目复制到新文件中而无需密码检查。受密码保护的 Keystore 中的数据未加密!

这个密码保护什么?这似乎只是为了惹恼开发者oO......

最佳答案

假设您在 keystore 中保存了一个名为“this is my sentence”的字符串,当您用记事本打开它时,您看到了密文“blabla”,然后您将“blabla”复制到另一个文件并声明了您找出明文,是“blabla”,显然是不正确的,直到通过密码恢复才能知道原始的pliant-ext。

==编辑==

对于 JKS keystore , keystore 密码用于验证完整性, src

636   if (password != null) {
637 md = getPreKeyedHash(password);
638 dis = new DataInputStream(new DigestInputStream(stream, md));
639 }

DigestInputStream 生成一个签名并将其与实际签名进行比较以查看是否被修改。

BouncyCaSTLe keystore UBER更安全,整个 keystore 使用基于 SHA1 和 Twofish (PBEWithSHAAndTwofish-CBC) 的 PBE 加密

        Cipher cipher = this.makePBECipher(cipherAlg, Cipher.DECRYPT_MODE, password, salt, iterationCount);
CipherInputStream cIn = new CipherInputStream(dIn, cipher);

Digest dig = new SHA1Digest();
DigestInputStream dgIn = new DigestInputStream(cIn, dig);

this.loadStore(dgIn);

关于Java Keystore 密码没意义?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12073702/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com