【问题标题】:Using openssl to crypto a file, with the same pubkey.pem the ciphertext is different?使用openssl加密文件,相同的pubkey.pem密文不同?
【发布时间】:2017-09-26 04:38:26
【问题描述】:

当我使用openssl加密文件时,使用相同的pubkey.pem,但密文不同?

root@09e0b54eb2b5:~/extremelyhardRSA# openssl rsautl -encrypt -pubin -inkey pubkey.pem -in test.txt -out flag.enc1
root@09e0b54eb2b5:~/extremelyhardRSA# openssl rsautl -encrypt -pubin -inkey pubkey.pem -in test.txt -out flag.enc2
root@09e0b54eb2b5:~/extremelyhardRSA# diff flag.enc1 flag.enc2 

二进制文件flag.enc1flag.enc2 不同。

【问题讨论】:

    标签: openssl rsa


    【解决方案1】:

    基本上,密文应始终视为随机输出。所以相同的消息加密两次不会产生相同的密文。如果你得到相同的密文,那就是信息泄露。它发生在 RSA 使用的掩码函数和填充函数中。

    【讨论】:

      猜你喜欢
      • 2011-11-20
      • 1970-01-01
      • 2013-06-17
      • 2021-09-07
      • 2016-01-06
      • 1970-01-01
      • 1970-01-01
      • 2018-12-25
      • 1970-01-01
      相关资源
      最近更新 更多