#!/usr/bin/expect # GPG has no option to disable AEAD and force MDC if AEAD is enabled in your # Key preferences, and it is set so by default when you generate a key with # new gpg. # The only way to fix the issue is to edit key preferences to remove any # AEAD algorithms. # # See https://unix.stackexchange.com/questions/697579/gpg-failing-with-no-error-for-one-of-my-encrypted-files spawn gpg --edit-key test expect "gpg>" send -- "setpref SHA512 SHA384 SHA256 SHA224 SHA1 AES256 AES192 AES ZLIB BZIP2 ZIP Uncompressed\r" expect "Really update the preferences? (y/N)" send -- "y\r" expect "gpg>" send -- "save\r" expect eof