开发者

delphi blowfish mode ecb (python converter to 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.ci开发者_开发技巧pher.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!


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)


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


@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.


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

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜