Delphi Blowfish 模式 ECB(Python 到 Delphi 的转换器)

发布于 2024-09-18 15:04:36 字数 600 浏览 4 评论 0原文

我知道作为一名程序员,很少有人能做到这一点,但我实际上需要它,但根本不能,所以有人需要将这个小函数加密 python 转换为 delphi。

function: `
from Crypto.Cipher import Blowfish   

class Blowfish(object):   
    cipher = None   

    def __init__(self, key, mode = Blowfish.MODE_ECB):   
        self.cipher = Blowfish.new(key, mode)   

    def encrypt(self, texto):   
        encriptar = self.cipher.encrypt(texto)   
        return encriptar `

-

one example
key = 123key
text = hi man
result = ìûÕ]–•¢

我很多次因为我尝试在 Delphi 中做并且总是向我展示不同的结果然后做得更好并询问了解 python / delphi 的人

非常感谢!

I know as a programmer that is rare for someone to do, but I actually need it and can not at all so someone needs to convert this small function cryptography python for delphi.

function: `
from Crypto.Cipher import Blowfish   

class Blowfish(object):   
    cipher = None   

    def __init__(self, key, mode = Blowfish.MODE_ECB):   
        self.cipher = Blowfish.new(key, mode)   

    def encrypt(self, texto):   
        encriptar = self.cipher.encrypt(texto)   
        return encriptar `

-

one example
key = 123key
text = hi man
result = ìûÕ]–•¢

I people much times because I tried to do in Delphi and always shows me different results then do better and ask for someone who understands python / delphi

thank so much!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

川水往事 2024-09-25 15:04:36

对于 DCPcrypt 的评论,也许您的 python 库会生成原始加密字节,而 DCPcrypt (或其他 Delphi 库,如 Turbo Lockbox)的结果会为您提供以 UU64 o MIME 之类的内容编码的结果(这样做是为了轻松传输 o 存储)结果)

For the comment on DCPcrypt, maybe your python library results the raw encrypted bytes, and the result of DCPcrypt (or other delphi library like Turbo Lockbox) gives you the result encoded in something like UU64 o MIME (this is done to easily transfer o store the result)

盗梦空间 2024-09-25 15:04:36

如果您只想在 Delphi 中实现 Blowfish 算法,请尝试 DCPcrypt

If you just want to implement Blowfish algorithm in Delphi, try DCPcrypt.

星軌x 2024-09-25 15:04:36

@Mili,您无法将此代码转换为delphi,因为delphi中不存在具有blowfish支持的RTL库(或函数),您需要为此使用第三方组件。我向你推荐
Delphi 加密教程第 I 部分 v.5.2。您可以尝试这个链接以获取更多组件。

@Mili, you can't translate this code to delphi because does not exist a RTL library (or function) in delphi with blowfish support, dou you need use a third party component for this. i recommend you the
Delphi Encryption Compedium Part I v.5.2. you can try out this link for more components.

花落人断肠 2024-09-25 15:04:36

您还可以在 http://lockbox.seanbdurkin.id.au/ 尝试 TurboPower LockBox 3.1.0 。
该库还实现了 Blowfish。

You can also try TurboPower LockBox 3.1.0 at http://lockbox.seanbdurkin.id.au/ .
This library also implements Blowfish.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文