Openssl enc命令
一、简介
enc - 对称加密例程,使用对称密钥对数据进行加解密,特点是速度快,能对大量数据进行处理。算法有流算法和分组加密算法,流算法是逐字节加,由于其容易被破译,现在已很少使用;分组加密算法是将数据分成固定大小的组里,然后逐组进行加密,如DES。分组算法中又有ECB,CBC,CFB,OFB,CTR等工作模式,其中默认选CBC工作模式。
二、语法
openssl enc -ciphername[-in filename] [-out filename] [-pass arg] [-e] [-d] [-a/-base64] [-A] [-k password] [-kfile filename] [-K key] [-iv IV] [-S salt] [-salt] [-nosalt] [-z] [-md] [-p] [-P] [-bufsize number] [-nopad] [-debug] [-none] [-engine id]
选项
-in <file> input file
-out <file> output file
-pass <arg> pass phrase source
-e encrypt
-d decrypt
-a/-base64 base64 encode/decode, depending on encryption flag
-k passphrase is the next argument
-kfile passphrase is the first line of the file argument
-md the next argument is the md to use to create a key
from a passphrase. See openssl dgst -h for list.
-S salt in hex is the next argument
-K/-iv key/iv in hex is the next argument
-[pP] print the iv/key (then exit if -P)
-bufsize <n> buffer size
-nopad disable standard block padding
-engine e use engine e, possibly a hardware device.
三、实例
1、使用des3算法对文件进行加密,并解密
openssl enc -p -des3 -pass pass: -in test.txt -out cipher.txt
openssl enc -d -des3 -pass pass:123456 -in cipher.txt -out plain.txt
2、加密对数据进行base64编码,并在解密前对数据进行base64解码
openssl enc -p -des3 -a -pass pass: -in test.txt -out cipher.txt
openssl enc -d -des3 -a -pass pass: -in cipher.txt -out plain.txt
Openssl enc命令的更多相关文章
- openssl enc(对称加密)
openssl系列文章:http://www.cnblogs.com/f-ck-need-u/p/7048359.html 对称加密工具.了解对称加密的原理后就很简单了,原理部分见下文. openss ...
- (9) openssl enc(对称加密)
对称加密工具,了解对称加密的原理后就很简单了,原理部分见下文. openssl enc -ciphername [-in filename] [-out filename] [-pa ...
- openssl 对称加密算法enc命令详解
1.对称加密算法概述 openssl的加密算法库提供了丰富的对称加密算法,我们可以通过openssl提供的对称加密算法指令的方式使用,也可以通过调用openssl提供的API的方式使用. openss ...
- 7.openssl enc
对称加密工具.了解对称加密的原理后就很简单了. [root@xuexi tmp]# man enc NAME enc - symmetric cipher routines SYNOPSIS open ...
- openssl enc 加解密
国内私募机构九鼎控股打造APP,来就送 20元现金领取地址:http://jdb.jiudingcapital.com/phone.html内部邀请码:C8E245J (不写邀请码,没有现金送)国内私 ...
- 使用openssl在命令行加密
对于需要在应用软件中进行加密编程的开发者,通过命令行把基本的加密操作做一遍是很有意义的.openssl支持在命令行进行各种基本加密算法的操作.这些操作过程无需编程,其命令参数与程序函数调用加密的参数有 ...
- openssl常用命令行汇总
openssl常用命令行汇总 随机数 openssl rand -out rand.dat -base64 32 摘要 直接做摘要 openssl dgst -sha1 -out dgst.dat p ...
- (转)openssl 命令: openssl req 命令详解
openssl req命令主要的功能有,生成证书请求文件, 查看验证证书请求文件,还有就是生成自签名证书.本文就主要记录一下open ...
- Openssl asn1parse命令
一.简介 asn1parse命令是一种用来诊断ASN.1结构的工具,也能用于从ASN1.1数据中提取数据 二.语法 openssl asn1parse [-inform PEM|DER] [-in f ...
随机推荐
- Python——基础数据类型(补充)
1.基础数据类型汇总补充 (1)小数据池: 为了节省空间,数字和字符串有,其他的没有[了解] 数字:-5---256之间的数字共用一个内存地址 #(1)i1 = i2 id(i1) == id ...
- Unit01: JDBC原理 、 JDBC基础编程
Unit01: JDBC原理 . JDBC基础编程 这个文件里面有两块内容: 1.用比较麻烦的方式连接数据库,test1(),test4() 2.创建DBTool,测试DBTool连接数据库 ,tes ...
- redis数据结构对象
redis的数据结构对象包括 字符串 列表 哈希 集合 有序集合五种数据结构对象,由底层的8种数据结构组成这五种对象,每种对象的实现不同的数据都是不一样的. 结构 typedef struct red ...
- scanf在竞赛中的技巧总结ing
前言 当输入流是一个字符串,我们需要在其中提取我们所需要的数值时,我们可以在读入阶段就完成数据的筛选工作. 使用方法 scanf("%ns", str); 表示读取长度为n的字符串 ...
- struts2学习(15)struts2防重复提交
一.重复提交的例子: 模拟一种情况,存在延时啊,系统比较繁忙啊啥的. 模拟延迟5s钟,用户点了一次提交,又点了一次提交,例子中模拟这种情况: 这样会造成重复提交: com.cy.action.St ...
- Java编程打印出1000以内所有的完数
/*如果一个数等 于其所有因子之和,我们就称这个数为"完数" * 例如6的因子为1,2,3, 6=1+2+3, 6就是一一个完数. * 请编程打印出1000以内所有的完数*/ pu ...
- 用IO字节流复制文件-CopyFileByIo
import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import ...
- 【BZOJ】1911: [Apio2010]特别行动队(斜率优化dp)
题目 传送门:QWQ 分析 用$ dp[i] $ 表示前 i 个人组成的战斗力之和 然后显然$ dp[i]=Max ( dp[j]+a*(sum[i]-sum[j])^2+b*(sum[i]-sum ...
- Linux 之rsyslog+LogAnalyzer 日志收集系统
一.LogAnalyzer介绍 LogAnalyzer工具提供了一个易于使用,功能强大的前端,用于搜索,查看和分析网络活动数据,包括系统日志,事件日志和其他许多日志源.由于它只是将数据展示到我们用户的 ...
- ubuntu安装Theano+cuda
由于学习需要用到GPU加速机器学习算法,需要安装theano+cuda. 开源库的一大问题就是:难安装. 为了搞好这个配置,我是前前后后花了3天,重装了3次ubuntu重装了5次驱动才搞定. 故发此贴 ...