使用des3加密
-k 密码
-in 加密的文件
-out 加密后的文件
openssl enc -des3 -k 123456 -in pt.text -out ct.bin
使用des3解密
-d 解密
-in 须解密的文件
-out 解密后的文件
openssl enc -des3 -d -k 123456 -in ct.bin -out pt1.text
生成私钥
openssl genrsa -out priv.key 1024
生成公钥
openssl rsa -in priv.key -pubout //只是在屏幕上做输出
保持成一个文件形式
openssl rsa -in priv.key -pubout >pub.key
使用公钥加密
openssl rsautl -in test.txt -out test.bin -inkey pub.key -pubin -encrypt
使用私钥解密
openssl rsautl -in test.bin -out test.txt -inkey priv.key -decrypt
使用私钥签名
openssl rsautl -in test.txt -out test.sig -inkey priv.key -sign
使用公钥验证
openssl rsautl -in test.sig -out test2.txt -inkey pub.key -pubin -verify
md5加密
openssl dgst -md5 test.txt
md5sum test.txt
sha1 加密
openssl dgst -sha1 test.txt
sha1sum test.txt
-k 密码
-in 加密的文件
-out 加密后的文件
openssl enc -des3 -k 123456 -in pt.text -out ct.bin
使用des3解密
-d 解密
-in 须解密的文件
-out 解密后的文件
openssl enc -des3 -d -k 123456 -in ct.bin -out pt1.text
生成私钥
openssl genrsa -out priv.key 1024
生成公钥
openssl rsa -in priv.key -pubout //只是在屏幕上做输出
保持成一个文件形式
openssl rsa -in priv.key -pubout >pub.key
使用公钥加密
openssl rsautl -in test.txt -out test.bin -inkey pub.key -pubin -encrypt
使用私钥解密
openssl rsautl -in test.bin -out test.txt -inkey priv.key -decrypt
使用私钥签名
openssl rsautl -in test.txt -out test.sig -inkey priv.key -sign
使用公钥验证
openssl rsautl -in test.sig -out test2.txt -inkey pub.key -pubin -verify
md5加密
openssl dgst -md5 test.txt
md5sum test.txt
sha1 加密
openssl dgst -sha1 test.txt
sha1sum test.txt