Chinaunix首页 | 论坛 | 博客
  • 博客访问: 734448
  • 博文数量: 235
  • 博客积分: 4309
  • 博客等级: 中校
  • 技术积分: 2325
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-17 11:25
个人简介

If you don\\\\\\\\\\\\\\\'t wanna do it, you find an EXCUSE; if you do, you\\\\\\\\\\\\\\\'ll find a WAY :-)

文章分类

全部博文(235)

文章存档

2014年(3)

2013年(2)

2012年(31)

2011年(199)

分类: LINUX

2011-01-17 19:40:49

# display currently version
openssl version
# openssl list-message-digest-commands
openssl dgst -sha1 file #(sha1,md5 etc.)
openssl md5 < file  <==>  md5sum file
openssl sha1 < file <==>  sha1sum file

# openssl list-cipher-commands
man openssl >> to see more details about enc ==> man enc <== u can see more!
# asn1parse(1), ca(1), config(5), crl(1), crl2pkcs7(1), dgst(1),
# dhparam(1), dsa(1), dsaparam(1), enc(1), gendsa(1), genrsa(1), nseq(1),
# openssl(1), passwd(1), pkcs12(1), pkcs7(1), pkcs8(1), rand(1), req(1),
# rsa(1), rsautl(1), s_client(1), s_server(1), s_time(1),
# smime(1),spkac(1), verify(1), version(1), x509(1), crypto(3),ssl(3)

# To encrypt a file named file.txt with a password, using triple DES in CBC
# mode,stored base64 encoded:
openssl enc -des3 -e -a -salt -in file.txt -out file.des3
# To decrypt the resulting file.des3 file:
openssl enc -des3 -d -a -salt -in file.des3 -out file.txt

#EXAMPLES:
#Just base64 encode a binary file:
openssl base64 -in file.bin -out file.b64
#Decode the same file:
openssl base64 -d -in file.b64 -out file.bin

#Encrypt a file using triple DES in CBC mode using a prompted password:
openssl des3 -salt -in file.txt -out file.des3
#Decrypt a file using a supplied password:
openssl des3 -d -salt -in file.des3 -out file.txt -k mypassword

#Encrypt a file then base64 encode it (so it can be sent via mail for  example) using Blowfish in CBC mode:
openssl bf -a -salt -in file.txt -out file.bf 
#Base64 decode a file then decrypt it:
openssl bf -d -salt -a -in file.bf -out file.txt
阅读(1528) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~