这是我在 2017 年左右对 Mac 上的文件进行加密的命令。我不知道我的 Mac 当时是否运行 High Sierra,因为在更新方面我通常会迟到,直到我完全明白。必须这样做。
我在 2018 年能够解密这些文件,但由于某种原因我无法再这样做了。
tar cz folder_to_encrypt | openssl enc -aes-256-cbc -e > out.tar.gz.enc
Run Code Online (Sandbox Code Playgroud)
这就是我现在用来解密的,使用运行 Catalina 的同一台计算机
openssl enc -aes-256-cbc -d -in out.tar.gz.enc | tar xz
Run Code Online (Sandbox Code Playgroud)
我收到的错误消息是:
bad decrypt
4435975788:error:06FFF064:digital envelope routines:CRYPTO_internal:bad decrypt:/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/libressl/libressl-47.140.1/libressl-2.8/crypto/evp/evp_enc.c:521:
tar: Error opening archive: Unrecognized archive format
Run Code Online (Sandbox Code Playgroud)
我读过一些关于不同版本的 openssl 和摘要等的文章。我下载了旧版本的 LibreSSL 2.3.6;它仍然失败,但错误代码略有不同(06065064):
bad decrypt
4606180972:error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:/Users/joe/Downloads/temp-libressl/libressl-2.3.6/crypto/evp/evp_enc.c:529:
tar: Error opening archive: Unrecognized archive format
Run Code Online (Sandbox Code Playgroud)