OpenSSL

暗号化(あんごうか) と SSL/TLS ツールキット

暗号化(あんごうか)復号(ふくごう)

AES-256-CBC 暗号化(あんごうか)

openssl aes-256-cbc -in 123.txt -out encrypted_123

AES-256-CBC 復号(ふくごう)

openssl aes-256-cbc -d -in encrypted_123 -out abc.txt

証明書(しょうめいしょ) 操作(そうさ)

秘密(ひみつ) (かぎ)生成(せいせい)

openssl genrsa -out private.key 2048

CSR を生成(せいせい)

openssl req -new -key private.key -out certificate.csr

自己(じこ) 署名(しょめい) 証明書(しょうめいしょ)生成(せいせい)

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout private.key -out certificate.crt

証明書(しょうめいしょ) 情報(じょうほう)表示(ひょうじ)

openssl x509 -in certificate.crt -text -noout

証明書(しょうめいしょ)秘密(ひみつ) (かぎ)一致(いっち)確認(かくにん)

openssl x509 -noout -modulus -in certificate.crt | openssl md5
openssl rsa -noout -modulus -in private.key | openssl md5

ハッシュと検証(けんしょう)

MD5

openssl md5 filename

SHA256

openssl sha256 filename

接続(せつぞく) テスト

SSL/TLS 接続(せつぞく) をテスト

openssl s_client -connect example.com:443

サーバー証明書(しょうめいしょ)表示(ひょうじ)

openssl s_client -connect example.com:443 -showcerts