<html><head></head><body><div class="yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div dir="ltr" data-setdir="false">Hi all,</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false"><div><div>I wish to encrypt a file with a passphrase, possibly copy the file elsewhere, and decrypt using the same passphrase. </div><div><br></div><div>If I encrypt a file (with a passphrase) it can then be decypted without entering a passphrase:</div><div>> echo "test" > test.txt</div><div>> gpg -c test.txt</div><div>> gpg -d test.txt.gpg </div><div>gpg: AES256.CFB encrypted data</div><div>gpg: encrypted with 1 passphrase</div><div>test</div><div><br></div><div>I assume it does not prompt me for a passphrase because it is cached.</div><div><br></div><div>If I clear the password cache, and then try to decrypt, the decryption fails (it does not prompt for a password):</div><div>> gpg-connect-agent reloadagent /bye</div><div>OK</div><div>> gpg -d test.txt.gpg</div><div>gpg: AES256.CFB encrypted data</div><div>gpg: problem with the agent: End of file</div><div>gpg: encrypted with 1 passphrase</div><div>gpg: decryption failed: Bad session key</div><div><br></div><div>Rebooting the machine does not fix the problem i.e. if I reboot and try to decrypt the file, it fails with the same error (Bad session key). In this case however it does prompt me for the password. After entering the password it fails.</div><div><br></div><div>I am using a fresh install of Fedora 35 and gpg2 version 2.3.2.</div></div><div><br></div><div dir="ltr" data-setdir="false">Why is it failing after I clear the cache?</div><br></div></div></body></html>