Rechercher dans ce blog

jeudi 2 février 2023

Clear GPG passphrase from session memory / no symkey caching

% gpg-connect-agent reloadagent /bye

 

gpg -c --no-symkey-cache your-file.txt
-symmetric
 -c
        Encrypt with a symmetric cipher using a passphrase. [..]  gpg
        caches the passphrase used for symmetric encryption so that a decrypt
        operation may not require that the user needs to enter the passphrase.
        The option --no-symkey-cache can be used to disable this feature.

 

To make this setting persistent, add the option (without --) in ~/.gnupg/gpg.conf:

no-symkey-cache