Debian文件加密与解密方法
一、常用工具与场景
二、常用方法速查
sudo apt-get install gnupggpg --output file.gpg --symmetric --cipher-algo AES256 filegpg --output file --decrypt file.gpggpg --output file.gpg --encrypt --recipient alice@example.com filegpg --output file --decrypt file.gpgtar czf - dir/ | gpg --output dir.tar.gz.gpg --encrypt --recipient alice@example.comgpg --output dir.tar.gz --decrypt dir.tar.gz.gpg && tar xzf dir.tar.gzopenssl enc -aes-256-cbc -salt -pbkdf2 -in file -out file.enc -pass pass:YourPassopenssl enc -d -aes-256-cbc -pbkdf2 -in file.enc -out file -pass pass:YourPassopenssl genpkey -algorithm RSA -out key.pem -pkeyopt rsa_keygen_bits:2048openssl rsa -pubout -in key.pem -out pubkey.pemopenssl pkeyutl -encrypt -pubin -inkey pubkey.pem -in file -out file.encopenssl pkeyutl -decrypt -inkey key.pem -in file.enc -out filesudo apt-get install p7zip-full7z a -pYourPass -mhe=on archive.7z file_or_dir/7z x -pYourPass archive.7z -ooutput_dirveracrypt --create /path/vol -e aes --hash sha-512 --size 10Gveracrypt /path/vol /mnt/enc -p YourPassveracrypt -d /mnt/encsudo apt-get install cryptsetupsudo cryptsetup luksFormat /dev/sdXnsudo cryptsetup open /dev/sdXn encsudo mkfs.ext4 /dev/mapper/enc && sudo mount /dev/mapper/enc /mnt/encsudo umount /mnt/enc && sudo cryptsetup close encsudo apt-get install encfsencfs ~/enc ~/decfusermount -u ~/decsudo apt-get install ecryptfs-utilssudo mount -t ecryptfs ~/enc ~/dec(按提示选择算法与密钥方式)三、如何选择
四、安全与操作建议