日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

[crypto]-53-openssl命令行的使用(aes/rsa签名校验/rsa加密解密/hmac)

發布時間:2025/3/21 编程问答 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 [crypto]-53-openssl命令行的使用(aes/rsa签名校验/rsa加密解密/hmac) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

常用技巧

如何編寫一個二進制規律性的文件, 比如你可以編寫一個"0123456789abcdef"的文本文件,記得刪除換行符然后用ultraedit打開,ctrl+H就可以看到二進制文件,對應的0x30 0x31 0x32…或者使用xxd -i 1.txt查看

AES

openssl enc -aes-128-cbc -in mingwen.data -K 000102030405060708090A0B0C0D0E0F -iv a0a1a2a3a4a5a6a7a8a9aAaBaCaDaEaF -out miwen.data

openssl aes-128-cbc -d -in miwen.data -K 000102030405060708090A0B0C0D0E0F -iv a0a1a2a3a4a5a6a7a8a9aAaBaCaDaEaF -out mingwen.data

RSA

產生公私密鑰對
openssl genrsa -out test_priv.pem 2048
openssl rsa -pubout -in test_priv.pem -out test_pub.pem

公鑰加密、私鑰解密
openssl rsautl -encrypt -in hello -inkey test_pub.key -pubin -out hello.en
openssl rsautl -decrypt -in hello.en -inkey test_priv.key -out hello.de

私鑰簽名、公鑰驗簽
openssl dgst -sign test_priv.pem -sha256 -out sign.txt file.txt
openssl dgst -verify test_pub.pem -sha256 -signature sign.txt file.txt

公鑰中提取N和E
1、openssl rsa -inform PEM -in Key0_pub.pem -pubin -text -out Key1_pub.txt
2、或使用網頁:https://the-x.cn/base64

私鑰中提取N和E
1、openssl rsa -in test_priv.pem -text -out 1.txt
2、或使用網頁:https://the-x.cn/base64

HMAC

1、openssl dgst -hmac hmackey -sha256 -out out.hash in.data
2、或者在線計算: https://1024tools.com/hmac


相關推薦:
?????????[crypto]-01-對稱加解密AES原理概念詳解
?????????[crypto]-02-非對稱加解密RSA原理概念詳解
?????????[crypto]-03-數字摘要HASH原理概念詳解
?????????[crypto]-04-國產密碼算法(國密算法sm2/sm3/sm4)介紹
?????????[crypto]-05-轉載:PKCS #1 RSA Encryption Version 1.5介紹
?????????[crypto]-05.1-PKCS PKCS#1 PKCS#7 PKCS#11的介紹
?????????[crypto]-06-CA證書介紹和使用方法


?????????[crypto]-30-The Armv8 Cryptographic Extension在linux中的應用
?????????[crypto]-31-crypto engion的學習和總結


?????????[crypto]-50-base64_encode和base64_decode的C語言實現
?????????[crypto]-51-RSA私鑰pem轉換成der, 在將der解析出n e d p q dp dq qp
?????????[crypto]-52-python3中rsa(簽名驗簽加密解密)aes(ecb cbc ctr)hmac的使用,以及unittest測試用
?????????[crypto]-53-openssl命令行的使用(aes/rsa簽名校驗/rsa加密解密/hmac)


?????????[crypto]-90-crypto的一些術語和思考

總結

以上是生活随笔為你收集整理的[crypto]-53-openssl命令行的使用(aes/rsa签名校验/rsa加密解密/hmac)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。