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~
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
2022-02-07 CSS: double coin