Crypt in perl, decrypt in delphi7 [closed]
I need not so strong crypt method in Perl, which will be compatible decryption in Delphi7.
To crypt some string value in Perl which http get from Delphi7.
I prefer si开发者_如何学Gomple solution based on standard libraries/modules, if it possible.
Not 100% sure what you're looking for. Say I have a string, and a password of swordfish, and I used that to encrypt the string. You would want to be able to decrypt the string with the same password. Is that correct?
The standard Perl crypt
command is a hash -- a one way encryption system. That is, it generates a hash that you can use to encrypt a string, but won't be able to decrypt that string even if you know the password. It's mainly used to store the hash instead of a password. That way, if someone types in a new password, you can encrypt that and verify it against the hash.
What you want is a full blown encryption/decryption algorithm. Something like Blowfish, a tough cypher that's open source, so widely implemented. That way, you're likely to find a encryption/decription module in both Delphi and Perl that'll match. Fortunately, Perl has a module called Crypt::Blowfish that will allow you to encrypt and decrypt using Blowfish. I saw an open source page of various encrypt/decrypt modules including one that does Blowfish.
If that doesn't work, you can try DES. Again the open source Delphi encryption library and Perl have modules that can do DES encryption/decryption. Perl's module is Crypt::DES.
精彩评论