开发者

Default parameters using Blowfish in TCL

Our production environment (TCL) are storing some data in the开发者_JS百科 DB with blowfish encryption and I'm trying to do the same from Java for our test automation.

I fail to get encrypt/decrypt with same result and I suspect the standard settings for Blowfish in TCL are different from Java. Anyone now what the default settings are for Blowfish in TCL so I can reproduce the same code in Java?

I'm not that good in TCL but this is the code executing the encryption

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

Thanks, Stefan


Is this the blowfish code from Tcllib? If so, what exactly it is doing is documented on the manual page. In short, you really ought to specify the mode (ECB or CBC) and initialization vector when initializing the cypher; try specifying it and seeing whether it gives the same results. If so, you've got the settings you need to replicate from the other side.

Also, from that page:

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜