OpenSSL のバックアップ(No.3)
- バックアップ一覧
- 差分 を表示
- 現在との差分 を表示
- ソース を表示
- OpenSSL へ行く。
- 1 (2021-11-14 (日) 21:02:27)
- 2 (2021-11-15 (月) 12:33:59)
- 3 (2022-04-24 (日) 14:04:46)
- 4 (2022-05-21 (土) 22:14:45)
- 5 (2023-10-05 (木) 08:50:43)
OpenSSL とは †
コマンド †
openssl †
- プロンプトを起動
openssl
- 文字列のハッシュ生成
echo -n "MESSAGE" | openssl sha1 echo -n "MESSAGE" | openssl dgst -md5 echo -n "MESSAGE" | openssl dgst -sha256
公開鍵暗号方式:RSA †
- 鍵の生成
- 暗号化・復号
- 公開鍵で暗号化
openssl rsautl -encrypt -pubin -inkey <public-keyfile.pem> -in <input-file.txt> -out <output-file.rsa>
- 秘密鍵で復号 ※平文が出力される
openssl rsautl -decrypt -inkey <private-keyfile.pem> -in <input-file.rsa>
- 公開鍵で暗号化
- 鍵の中身を出力
- 秘密鍵
openssl rsa -in <private-keyfile.pem> -text -noout
- 公開鍵
openssl rsa -pubin -in <public-keyfile.pem> -text -noout
- 秘密鍵
- 鍵の形式を変換して出力(PEM→DER)
- 秘密鍵
openssl rsa -in <private-keyfile.pem> -out <private-keyfile.der> -outform der
- 公開鍵
openssl rsa -pubin -in <public-keyfile.pem> -out <public-keyfile.der> -outform der
- 秘密鍵
- 鍵の形式を変換して出力(DER→PEM)
- 秘密鍵
openssl rsa -in <private-keyfile.der> -inform der -out <private-keyfile.pem>
- 公開鍵
openssl rsa -pubin -in <public-keyfile.der> -inform der -out <public-keyfile.pem>
- 秘密鍵
デジタル証明書:X.509 †
- 鍵の中身を出力
openssl x509 -in <public-keyfile.crt> -text -noout
脆弱性 †
- HeartBleed
- OpenSSLのVer.1.0.1のSSLの死活監視機能(heartbeat)の脆弱性
- https://www.jnsa.org/secshindan/secshindan_11.html
参考サイト †
- UNIX/Linuxの部屋 opensslコマンドの使い方
http://x68000.q-e-d.net/~68user/unix/pickup?openssl
- OpenSSLのマニュアルの日本語訳
http://home.att.ne.jp/theta/diatom/FrontPage.html