OpenSSL: enc symmtric key encryption

 

Symmetric key encryption is performed using the enc operation of OpenSSL.

查看可用encryption

openssl enc -list

 

Encrypt

use -pass pass:minutia 指定密码

openssl enc -e -aes-256-cbc -p -pass pass:minutia -in netconfig -out netconfig.enc

-aes-256-cbc

the cipher name (symmetric cipher: AES; block to stream conversion: CBC (cipher block chaining)
-pass pass:<password> 

to specify the password

-p 

print out the salt, key and IV used

-base64

密文使用base64 encode

-nosalt

Do not use salt

-S salt

Also you can specify the salt value with the -S flag.If you provide the salt value, then you become responsible for generating proper salts, trying to make them as unique as possible (in practice, you have to produce them randomly). It is preferable to let openssl handle that.

.

Decrypt

openssl enc -aes-256-cbc -pass pass:minutia -d -p -in netconfig.enc -out netconfig~

 

posted @   ascertain  阅读(22)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
历史上的今天:
2022-02-07 CSS: double coin
点击右上角即可分享
微信分享提示