gpg decrypts files without asking for password











up vote
1
down vote

favorite












I run gpg -c file. It asks for a password (twice) and creates an encrypted file. So far so good.



When I run gpg file.gpg to decrypt the file it decrypts it without asking for the password ! needless to say, this "encryption" is totally worthless.



The gpg encryption, in gnome as well as in the command line, was working just fine for a while and simply broke at one moment and I don't know what I did or what happened.



How to fix it ?










share|improve this question


























    up vote
    1
    down vote

    favorite












    I run gpg -c file. It asks for a password (twice) and creates an encrypted file. So far so good.



    When I run gpg file.gpg to decrypt the file it decrypts it without asking for the password ! needless to say, this "encryption" is totally worthless.



    The gpg encryption, in gnome as well as in the command line, was working just fine for a while and simply broke at one moment and I don't know what I did or what happened.



    How to fix it ?










    share|improve this question
























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I run gpg -c file. It asks for a password (twice) and creates an encrypted file. So far so good.



      When I run gpg file.gpg to decrypt the file it decrypts it without asking for the password ! needless to say, this "encryption" is totally worthless.



      The gpg encryption, in gnome as well as in the command line, was working just fine for a while and simply broke at one moment and I don't know what I did or what happened.



      How to fix it ?










      share|improve this question













      I run gpg -c file. It asks for a password (twice) and creates an encrypted file. So far so good.



      When I run gpg file.gpg to decrypt the file it decrypts it without asking for the password ! needless to say, this "encryption" is totally worthless.



      The gpg encryption, in gnome as well as in the command line, was working just fine for a while and simply broke at one moment and I don't know what I did or what happened.



      How to fix it ?







      encryption gnupg






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 17 at 22:40









      JothamB

      6515




      6515






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          3
          down vote



          accepted










          The phrase is cached by the GPG agent.



          To clear the cache simply run



          gpg-connect-agent reloadagent /bye


          The encryption is not worthless, as the cache will be cleared upon logout, and will obviously not be transmitted with the file. Gpg is primarily meant to protect data in transit, and not from the logged-in user that encrypted it.






          share|improve this answer




























            up vote
            0
            down vote













            The GPG agent caches keys, see the manual page of gpg(1):



            --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.


            So to disable caching for a single invocation, use something like:



            gpg -c --no-symkey-cache your-file.txt


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



            no-symkey-cache





            share|improve this answer





















              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "89"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














               

              draft saved


              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1093848%2fgpg-decrypts-files-without-asking-for-password%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              3
              down vote



              accepted










              The phrase is cached by the GPG agent.



              To clear the cache simply run



              gpg-connect-agent reloadagent /bye


              The encryption is not worthless, as the cache will be cleared upon logout, and will obviously not be transmitted with the file. Gpg is primarily meant to protect data in transit, and not from the logged-in user that encrypted it.






              share|improve this answer

























                up vote
                3
                down vote



                accepted










                The phrase is cached by the GPG agent.



                To clear the cache simply run



                gpg-connect-agent reloadagent /bye


                The encryption is not worthless, as the cache will be cleared upon logout, and will obviously not be transmitted with the file. Gpg is primarily meant to protect data in transit, and not from the logged-in user that encrypted it.






                share|improve this answer























                  up vote
                  3
                  down vote



                  accepted







                  up vote
                  3
                  down vote



                  accepted






                  The phrase is cached by the GPG agent.



                  To clear the cache simply run



                  gpg-connect-agent reloadagent /bye


                  The encryption is not worthless, as the cache will be cleared upon logout, and will obviously not be transmitted with the file. Gpg is primarily meant to protect data in transit, and not from the logged-in user that encrypted it.






                  share|improve this answer












                  The phrase is cached by the GPG agent.



                  To clear the cache simply run



                  gpg-connect-agent reloadagent /bye


                  The encryption is not worthless, as the cache will be cleared upon logout, and will obviously not be transmitted with the file. Gpg is primarily meant to protect data in transit, and not from the logged-in user that encrypted it.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 17 at 22:45









                  vidarlo

                  8,00042341




                  8,00042341
























                      up vote
                      0
                      down vote













                      The GPG agent caches keys, see the manual page of gpg(1):



                      --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.


                      So to disable caching for a single invocation, use something like:



                      gpg -c --no-symkey-cache your-file.txt


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



                      no-symkey-cache





                      share|improve this answer

























                        up vote
                        0
                        down vote













                        The GPG agent caches keys, see the manual page of gpg(1):



                        --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.


                        So to disable caching for a single invocation, use something like:



                        gpg -c --no-symkey-cache your-file.txt


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



                        no-symkey-cache





                        share|improve this answer























                          up vote
                          0
                          down vote










                          up vote
                          0
                          down vote









                          The GPG agent caches keys, see the manual page of gpg(1):



                          --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.


                          So to disable caching for a single invocation, use something like:



                          gpg -c --no-symkey-cache your-file.txt


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



                          no-symkey-cache





                          share|improve this answer












                          The GPG agent caches keys, see the manual page of gpg(1):



                          --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.


                          So to disable caching for a single invocation, use something like:



                          gpg -c --no-symkey-cache your-file.txt


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



                          no-symkey-cache






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 2 days ago









                          Lekensteyn

                          119k47262353




                          119k47262353






























                               

                              draft saved


                              draft discarded



















































                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1093848%2fgpg-decrypts-files-without-asking-for-password%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Mouse cursor on multiple screens with different PPI

                              Agildo Ribeiro

                              Sometime when accessing a menu: “Ubuntu 16.04 has experienced an internal error”