您在Ruby代码中传递了错误的密钥大小。它应该是192。(因为key.size
24字节== 192位)
cipher = OpenSSL::Cipher::AES.new(192, :CFB)
cipher.encrypt
cipher.key = key
cipher.iv = iv
encrypted = cipher.update(input) + cipher.final()
puts "Output: [" + encrypted.bytes.join(" ") + "]"
输出:
Output: [155 79 127 80 31 163 142 111 13 211 221 163 219 248]
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句