OpenSSL是一個功能強大的加密工具包,提供了多種命令行工具,用于在Linux系統中執行加密、解密、簽名、驗證等各種操作。以下是一些常用的OpenSSL命令行工具及其功能:
openssl genrsa -out private.key 2048
openssl rsa -in private.key -pubout -out public.key
openssl req -x509 -newkey rsa:2048 -keyout private.key -out certificate.crt -days 365
openssl enc -aes-256-cbc -salt -in plaintext.txt -out encrypted.txt -k mypassword
openssl enc -d -aes-256-cbc -in encrypted.txt -out decrypted.txt -k mypassword
openssl dgst -sha256 -sign private.key -out signature.bin file.txt
openssl dgst -sha256 -verify public.key -signature signature.bin file.txt
openssl x509 -in certificate.crt -text -noout
openssl x509 -outform der -in certificate.pem -out certificate.der
openssl dgst -sha1 file.txt
openssl rand -base64 32 -out key.key
openssl enc -list -cipher-algorithms
openssl list -cipher-commands
在使用OpenSSL命令行工具時,請注意以下幾點以確保安全性:
通過這些命令和技巧,你可以在Linux環境下高效地使用OpenSSL命令行工具,提升工作效率和安全性。