mac技巧之加密解密文件

mac技巧之加密解密文件

加密 解密 文件

terminal:

桌面有一份文件 ScreenShotOriginal.png
加密

openssl enc -aes-256-cbc -e -in /Users/xuzhihua/Desktop/ScreenShotOriginal.png  -out /Users/xuzhihua/Desktop/ScreenShotEncrypt.png
// -e encrypt 使用 -aes-256-cbc 加密方式
// 需要输入你想要使用的加密密码

此时会在桌面创建一个 ScreenShotEncrypt.png ,此时可以 ScreenShotOriginal.png 删除
解密

openssl enc -aes-256-cbc -d -in /Users/xuzhihua/Desktop/ScreenShotEncrypt.png  -out /Users/xuzhihua/Desktop/ScreenShotDecrypt.png
// -d decrypt 使用 -aes-256-cbc 加密方式
// 输入加密的密码

此时会在桌面创建一个 ScreenShotDecrypt.png