Chinaunix首页 | 论坛 | 博客
  • 博客访问: 441433
  • 博文数量: 113
  • 博客积分: 446
  • 博客等级: 下士
  • 技术积分: 1229
  • 用 户 组: 普通用户
  • 注册时间: 2012-12-09 16:01
个人简介

Let's go!!!!!

文章分类

全部博文(113)

文章存档

2019年(5)

2018年(4)

2017年(9)

2016年(5)

2015年(39)

2014年(6)

2013年(28)

2012年(17)

分类: LINUX

2015-02-08 16:55:11


openssl enc -ciphername [-in filename] [-out filename] [-pass arg] [-e]
[-d] [-a] [-A] [-k password] [-kfile filename] [-K key] [-iv IV] [-p]
[-P] [-bufsize number] [-nopad] [-debug]
说明:
-chipername选项:加密算法,

-in选项:输入文件,对于加密来说,输入的应该是明文文件;对于解密来说,输入的应该是加密的文件。该选项后面直接跟文件名。
-out选项:输出文件,对于加密来说,输出的应该是加密后的文件名;对于解密来说,输出的应该是明文文件名。

-pass选项:选择输入口令的方式,输入源可以是标准输入设备,命令行输入,文件、变量等。

-e选项:实现加密功能(不使用-d选项的话默认是加密选项)。

-d选项:实现解密功能。

-a-A选项:对文件进行BASE64编解码操作。

-K选项:手动输入加密密钥(不使用该选项,Openssl会使用口令自动提取加密密钥)。

-IV选项:输入初始变量(不使用该选项,Openssl会使用口令自动提取初始变量)。

-salt选项:是否使用盐值,默认是使用的。

-p选项:打印出加密算法使用的加密密钥。

 

root@Capsheaf_1:~/file_packet # ls

file.txt

root@Capsheaf_1:~/file_packet # cat file.txt

test

root@Capsheaf_1:~/file_packet # openssl enc -e -aes-128-cbc -in file.txt -out enc.txt

enter aes-128-cbc encryption password:

Verifying - enter aes-128-cbc encryption password:

root@Capsheaf_1:~/file_packet # ls

enc.txt  file.txt

root@Capsheaf_1:~/file_packet # cat enc.txt

Salted___|?h[1;33mroot@Capsheaf_1:~/file_packet #

root@Capsheaf_1:~/file_packet # openssl enc -d -aes-128-cbc -in enc.txt -out denc.txt             

enter aes-128-cbc decryption password:

root@Capsheaf_1:~/file_packet # ls

denc.txt  enc.txt  file.txt

root@Capsheaf_1:~/file_packet # cat denc.txt

test

 

root@Capsheaf_1:~ # tar -czf - file_packet | openssl des3  -salt -out file_packet.tar.gz

enter des-ede3-cbc encryption password:

Verifying - enter des-ede3-cbc encryption password:

root@Capsheaf_1:~ # tar -xzf file_packet.tar.gz

gzip: stdin: not in gzip format

tar: Child returned status 1

tar: Exiting with failure status due to previous errors

root@Capsheaf_1:~ # rm file_packet -rf

root@Capsheaf_1:~ # openssl des3 -d -salt -in file_packet.tar.gz | tar -xzf  -

enter des-ede3-cbc decryption password:

root@Capsheaf_1:~ # ls -l file_packet

total 4

-rw-r--r--  1 root root 5 Feb  7 23:04 file.txt


阅读(4223) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~