gpt4 book ai didi

java - TCL中使用Blowfish的默认参数

转载 作者:行者123 更新时间:2023-12-02 08:22:17 25 4
gpt4 key购买 nike

我们的生产环境(TCL)正在使用河豚加密在数据库中存储一些数据,我正在尝试从 Java 中为我们的测试自动化执行相同的操作。

我无法获得相同结果的加密/解密,我怀疑 TCL 中 Blowfish 的标准设置与 Java 不同。现在有人知道 TCL 中 Blowfish 的默认设置是什么,以便我可以在 Java 中重现相同的代码吗?

我不太擅长 TCL,但这是执行加密的代码

return [blowfish encrypt -hex $CFG(secretkey) -bin $data]

谢谢,斯特凡

最佳答案

这是来自 Tcllib 的河豚代码吗?如果是这样,它到底在做什么记录在案on the manual page 。简而言之,您确实应该在初始化密码时指定模式(ECB 或 CBC)和初始化 vector ;尝试指定它并查看它是否给出相同的结果。如果是这样,您就已经获得了需要从另一端复制的设置。

此外,从该页面:

The -mode and -dir options are optional and default to cbc mode and encrypt respectively. The initialization vector -iv takes an 8 byte binary argument which defaults to 8 zeros. See MODES OF OPERATION for more about available modes and their uses.

关于java - TCL中使用Blowfish的默认参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5258730/

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