Haskell HsOpenSSL密码结果与M2Crypto和命令行不同?

Haskell HsOpenSSL密码结果与M2Crypto和命令行不同?,haskell,openssl,evp-cipher,Haskell,Openssl,Evp Cipher,我正在编写一个程序来与另一个用python编写的程序进行接口。我发现加密的结果是不同的 在ghci中,使用HsOpenSSL,加密结果是\GS\n\197: import OpenSSL import OpenSSL.EVP.Cipher import Data.Maybe method <- fmap fromJust $ withOpenSSL $ getCipherByName "bf-cfb" cipher method "\x90\x01\x50\x98\x3c\xd2\x4f

我正在编写一个程序来与另一个用python编写的程序进行接口。我发现加密的结果是不同的

在ghci中,使用HsOpenSSL,加密结果是
\GS\n\197:

import OpenSSL
import OpenSSL.EVP.Cipher 
import Data.Maybe
method <- fmap fromJust $ withOpenSSL $ getCipherByName "bf-cfb"
cipher method "\x90\x01\x50\x98\x3c\xd2\x4f\xb0\xd6\x96\x3f\x7d\x28\xe1\x7f\x72" "\xcc\x88\xa5\x26\x85\xaf\x7f\x8d" Encrypt "abcd"

在shell中,abcd.txt包含字符串“abcd”,vim中的abcd.bin显示为
K^PI>M2Crypto使用8位反馈大小;而OpenSSL对河豚使用64位反馈。我在mcrypt和Crypto++中遇到了类似的问题。填充也可能有问题。但是首先检查反馈大小。HsOpenSSL是OpenSSL的包装,它应该以相同的函数调用结束。我提出了一个要点来说明问题:
import M2Crypto
M2Crypto.EVP.Cipher("bf_cfb", "\x90\x01\x50\x98\x3c\xd2\x4f\xb0\xd6\x96\x3f\x7d\x28\xe1\x7f\x72", "\xcc\x88\xa5\x26\x85\xaf\x7f\x8d", 1).update("abcd")
openssl bf-cfb -in abcd.txt -out abcd.bin -pass pass:abc -K 900150983cd24fb0d6963f7d28e17f72 -iv cc88a52685af7f8d -nosalt