【问题标题】:Why can't ECDSA signatures on Linux be verified successfully on Windows?为什么Linux上的ECDSA签名不能在Windows上验证成功?
【发布时间】:2021-12-22 17:08:02
【问题描述】:

我使用以下命令行在 Linux 中生成 ECDSA 签名。在 Linux 中,您可以使用命令行来验证签名。这个没问题

在Windows中,同样的命令行也可以签名验证成功

openssl ecparam -name secp192k1 -genkey -out ec.key
openssl ec -in ec.key -pubout -out ec.pubkey
openssl dgst -sha1 -sign ec.key -out ec.sig content.txt
openssl dgst -sha1 -verify ec.pubkey -signature ec.sig content.txt

但事情就是这样。

我把Linux中生成的所有文件都放到Windows中,然后用命令行验证签名,结果报错,为什么?

【问题讨论】:

  • 错误是什么?

标签: linux windows ecdsa


【解决方案1】:

content.txt,Linux 生成以字节 0x0a 结尾的内容,但 Windows 创建不以字节 0x0A 结尾的内容。所以,其实 Linux 和 Windows 签署的内容不同,所以 Windows 会验​​证 Linux 没有正确签署它

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-18
    • 1970-01-01
    • 2020-06-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多