OpenSSL是一个强大的加密工具,它可以在Debian系统上进行多种命令行操作
sudo apt-get update
sudo apt-get install openssl
openssl genrsa -out rsa_key.pem 2048
这将生成一个名为rsa_key.pem的2048位RSA私钥文件。
openssl req -new -key rsa_key.pem -out csr.pem
在提示时输入相关信息,如国家、组织名称等。完成后,将生成一个名为csr.pem的CSR文件。
openssl x509 -req -days 365 -in csr.pem -signkey rsa_key.pem -out certificate.pem
这将生成一个名为certificate.pem的有效期为365天的自签名证书。
input.txt的文件并将其保存为encrypted.txt,请运行:openssl enc -aes-256-cbc -salt -in input.txt -out encrypted.txt -pass pass:your_password
要解密文件,请运行:
openssl enc -d -aes-256-cbc -in encrypted.txt -out decrypted.txt -pass pass:your_password
openssl x509 -in certificate.pem -text -noout
openssl verify -CAfile ca_certificate.pem csr.pem
这些只是OpenSSL在Debian系统上的一些基本命令行操作。OpenSSL功能强大,可以实现更多高级操作。要了解更多关于OpenSSL的信息,请查阅其官方文档或使用man openssl命令查看帮助。