关键词搜索

全站搜索
×
密码登录在这里
×
注册会员

已有账号? 请点击

忘记密码

已有账号? 请点击

使用其他方式登录

linux手册

linux openssl命令–加密算法

openSSL是一个强大的安全套接字层密码库,囊括主要的密码算法、常用的密钥和证书封装管理功能及SSL协议,并提供丰富的应用程序供测试或其它目的使用。对应的命令就是openssl命令,用于加密算法。

语法格式:openssl [参数]

常用参数:

-in 输入
-out 输出

参考实例

用SHA1算法计算文件file.txt的哈西值,输出到stdout:

[root@linuxcool ~]# openssl dgst -sha1 file.txt

用SHA1算法计算文件file.txt的哈西值,输出到文件digest.txt:

[root@linuxcool ~]# openssl sha1 -out digest.txt file.txt

对称加密应用例子,用DES3算法的CBC模式加密文件plaintext.doc,加密结果输出到文件ciphertext.bin:

[root@linuxcool ~]# openssl enc -des3 -salt -in plaintext.doc -out ciphertext.bin

DES3算法的OFB模式解密文件ciphertext.bin,提供的口令为trousers,输出到文件plaintext.doc:

[root@linuxcool ~]# openssl enc -des-ede3-ofb -d -in ciphertext.bin -out plaintext.doc -pass pass:trousers

生成1024位DSA参数集,并输出到文件dsaparam.pem:

[root@linuxcool ~]# openssl dsaparam -out dsaparam.pem 1024

使用参数文件dsaparam.pem生成DSA私钥匙,采用3DES加密后输出到文件dsaprivatekey.pem:

[root@linuxcool ~]# openssl gendsa -out dsaprivatekey.pem -des3 dsaparam.pem

产生1024位RSA私匙,用3DES加密它,口令为trousers,输出到文件rsaprivatekey.pem:

[root@linuxcool ~]# openssl genrsa -out rsaprivatekey.pem -passout pass:trousers -des3 1024
点击QQ咨询
开通会员
上传资源赚钱
返回顶部
×
  • 微信支付
  • 支付宝付款
扫码支付
微信扫码支付
请使用微信描二维码支付
×

提示信息

×

选择支付方式

  • 微信支付
  • 支付宝付款
确定支付下载