Linux 分卷加密文件的解密方法
先判断加密与分卷类型
tar ... | openssl enc ... | split ...,分卷后缀常为 .des3 / .aes / .enc 等,且文件名可能带序号(如 .00、.01)。file yourfilels -1v yourfile.*(按版本号排序)md5sum -c yourfile.md5sum 或 sha256sum -c yourfile.sha256。按类型给出解密与解包命令
cat harbor.des3.* | openssl des3 -d -k 'YOUR_PASSWORD' -salt | tar xzf -
openssl des3 -d -k 'YOUR_PASSWORD' -salt -in harbor.des3 | tar xzf -
des3 替换为对应算法名,且不要遗漏 -salt 与 -k 参数。gpg -d yourfile.tar.gpg | tar xzf -
gpg -o yourfile.tar -d yourfile.tar.gpg
tar xzf yourfile.tar
7z x yourfile.7z.001
unzip yourfile.zip
或unzip yourfile.z*
zip -F yourfile.zip --out single.zip
unzip single.zip
-P 'PASSWORD' 提供(注意命令行历史泄露风险)。unrar x yourfile.part1.rar
unrar x -p'YOUR_PASSWORD' yourfile.part1.rar
常见问题与排查
ls -1v 检查序号,确保 .001/.01 等为首卷,且所有分卷齐全;必要时重新下载缺失分卷。bad decrypt;GPG/7z/unzip/unrar 会提示口令错误或校验失败。请确认算法、口令与创建时一致(注意大小写、空格)。cat z* > single.zip 再解压,容易破坏分卷索引;应使用 zip -F 修复合并或直接使用 unzip 自动识别分卷。gpg, openssl, p7zip-full/unrar, unzip 等工具后再执行对应命令。