天天看点

linux下使用openssl命令行加密文件

OS: ubuntu 12.04

命令行输入openssl,进入openssl命令行状态

# openssl

OpenSSL>

" 加密文件 -e (加密) -aes-128-cbc(加密算法)

OpenSSL> enc -e -aes-128-cbc -in <input file path> -out <output file path>

“ 输入加密密码,回车

enter aes-128-cbc encryption password:

” 再次输入密码,回车

Verifying - enter aes-128-cbc encryption password:

加密OK!!

" 解密文件 -d (加密) -aes-128-cbc(加密算法)

OpenSSL> enc -d -aes-128-cbc -in <input file path> -out <output file path>

“ 输入加密密码,回车

enter aes-128-cbc decryption password:

解密OK!!

继续阅读