有人可以解释一下openssl cli和c ++ DES输出的差异吗?
Can someone explain the difference in openssl cli and c++ DES output
使用openSSL,我的一个程序正在产生与openSSL的命令行实用程序不同的加密输出。 使用"aaaa"作为纯文本,"A"作为键,我一直在运行
openssl enc -des -e -nosalt -in test1.txt -out test1out.txt
获取示例加密,但我的示例程序 (http://pastebin.com/e4P0DGYR) 永远不会产生相同的哈希。
要运行示例程序,请输入
./a.out 40 42 $(hexdump -ve '1/1 "%.2x"' test1.txt) $(hexdump -ve '1/1 "%.2x"' test1out.txt)
我用这个(http://www.codealias.info/technotes/des_encryption_using_openssl_a_simple_example)作为例子。
正如您在openssl用户邮件列表中发布此内容时有人回答的那样,CLI 使用 ECB 模式,程序使用 CFB 模式。DES-ECB与DEC-CFB(或任何其他模式)不同。
相关文章:
- 递归函数计算序列中的平方和(并输出过程)
- 如何使用 < 和 > 命令获取 c++ 中的输入和输出?
- 请解释"函数1(p1,p2,p3);"的输出
- C++:将控制台输出存储在宏中更好吗
- 创建一个函数以在输入为负数或零时输出字符串.第一次执行用户定义的函数
- 如何在OMNET++中指定与命令行参数组合的输出文件名
- 为什么我的代码在输出中增加了93天
- 如何从void函数输出字符串
- 输入到文件并输出到另一个文件,并将流文件传递给函数
- AES加密到解密未正确输出
- 如何将c++程序的一些输出传递给shell,以便在shell中使用
- 使用C++程序合并排序没有得到正确的输出
- 为什么我不能在不创建字符串变量的情况下使用函数的字符串输出
- C++格式化输出问题
- 将值从二维数组输出到文本文件
- 集合上的输出迭代器:assign和increment迭代器
- 在while循环中输入带有std::cin的字符串后,控制台会输出大量胡言乱语
- 为什么rk4.do_step不输出C++中的初始条件
- 输出没有重复元素的动态数组(收缩数组)C++
- 有人可以解释一下openssl cli和c ++ DES输出的差异吗?