How to bypass pinentry (phrase screen) when decrypting a file using gpgme

I am trying to decrypt a file from a server where I have the required public key of this server. The keychain has password protection, so when I try to decrypt a file, it asks me for a passphrase.

Is there a way around this passphrase by passing the password when trying to decrypt the file.

I use gpg-agentwhere the passphrase is cached for 600 seconds by default, and for some reason I can’t install max-cache-ttl(this did not work for me, I don’t know y) and is available only for this session.

Now I want to cache the passphrase for which I use gpg-preset-passphrase. I installed it in .gnupg / gpg-agent.conf as gpg-preset-passphrase --preset hex. I do not know what I am missing in this.

Can someone please let me know what I am missing in this

thanks

+2
source share
1 answer

I can't get around the phrase or pinentry screen, but I used gpg-agentparameters such as default-cache-ttlto set the cache time. Thus, on the second attempt, pinentry is about to retrieve the cached passphrase and will reset the timer to defaul-cache-ttl.

There is another option max-cache-ttl, even after a successful search for the cached passphrase and reset to default-cache-ttl, this option does not change its timer and ends the cached passphrase after the set timeout.

: 10 (.. 36000 ), 5 , reset , 10 . max 10 , , 10 .

, , - gpg-agent. , , , , gpg- . script bashrc, .

+3

Source: https://habr.com/ru/post/1525241/


All Articles