小脚本:迅速AES加密文件/目录
需要srm: ./bash/profile:
1 2 3 4 5 6 7 |
function enc() { tar zcvf - $1 | openssl aes-256-cbc -salt -out $1.aes && srm -mfzr $1 } function dec() { openssl aes-256-cbc -d -in $1.aes | tar zxvf - && rm -f $1.aes } |
参考: https://github.com/JElchison/encrypt-tool/blob/master/encrypt-tool.sh http://blog.extracheese.org/2010/05/the-tar-pipe.html https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/srm.1.html http://netsecurity.51cto.com/art/201301/378513.htm http://www.361way.com/openssl-encrypt-file/2692.html