Encrypting existing tar.gz archive












0















I know of a method to encrypt a tar.gz archive while creating it (not sure if it's a recommend one):



tar -czvf /path/to/save/archive.tar.gz -C /path/to/archive . | 
openssl des3 -salt -k #PASSWORD# | dd of=archive


The problem is that I have some large existing archives that I'd like to encrypt also, but I'm not sure if that is possible without re-archiving everything?










share|improve this question
















bumped to the homepage by Community 11 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    0















    I know of a method to encrypt a tar.gz archive while creating it (not sure if it's a recommend one):



    tar -czvf /path/to/save/archive.tar.gz -C /path/to/archive . | 
    openssl des3 -salt -k #PASSWORD# | dd of=archive


    The problem is that I have some large existing archives that I'd like to encrypt also, but I'm not sure if that is possible without re-archiving everything?










    share|improve this question
















    bumped to the homepage by Community 11 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      0












      0








      0








      I know of a method to encrypt a tar.gz archive while creating it (not sure if it's a recommend one):



      tar -czvf /path/to/save/archive.tar.gz -C /path/to/archive . | 
      openssl des3 -salt -k #PASSWORD# | dd of=archive


      The problem is that I have some large existing archives that I'd like to encrypt also, but I'm not sure if that is possible without re-archiving everything?










      share|improve this question
















      I know of a method to encrypt a tar.gz archive while creating it (not sure if it's a recommend one):



      tar -czvf /path/to/save/archive.tar.gz -C /path/to/archive . | 
      openssl des3 -salt -k #PASSWORD# | dd of=archive


      The problem is that I have some large existing archives that I'd like to encrypt also, but I'm not sure if that is possible without re-archiving everything?







      tar openssl gzip






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Oct 24 '15 at 4:46







      Ned Schneebly

















      asked Oct 24 '15 at 4:40









      Ned SchneeblyNed Schneebly

      135




      135





      bumped to the homepage by Community 11 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 11 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          You can encrypt any existing file with the same encryption tool and options, using standard shell redirection. For example:



          openssl des3 -salt -k #PASSWORD# < oldfile.tar.gz > newfile.tar.gz


          if you want to replace the old file with the new encrypted version, then:



          openssl des3 -salt -k #PASSWORD# < oldfile.tar.gz > newfile.tar.gz && mv -f newfile.tar.gz oldfile.tar.gz





          share|improve this answer
























          • I might be trying to decrypt incorrectly, but when i use openssl des3 -d -k #PASSWORD# | tar -C tmp -xvf newfile.tar.gz there's an error: gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting now error reading input file

            – Ned Schneebly
            Oct 24 '15 at 5:07











          • newfile.tar.gz needs to be read by openssl, not an arg to tar. openssl des3 -d -k #PASSWORD# < newfile.tar.gz | tar xvfz - -C tmp

            – cas
            Oct 24 '15 at 6:41













          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "106"
          };
          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',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          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%2funix.stackexchange.com%2fquestions%2f238298%2fencrypting-existing-tar-gz-archive%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          You can encrypt any existing file with the same encryption tool and options, using standard shell redirection. For example:



          openssl des3 -salt -k #PASSWORD# < oldfile.tar.gz > newfile.tar.gz


          if you want to replace the old file with the new encrypted version, then:



          openssl des3 -salt -k #PASSWORD# < oldfile.tar.gz > newfile.tar.gz && mv -f newfile.tar.gz oldfile.tar.gz





          share|improve this answer
























          • I might be trying to decrypt incorrectly, but when i use openssl des3 -d -k #PASSWORD# | tar -C tmp -xvf newfile.tar.gz there's an error: gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting now error reading input file

            – Ned Schneebly
            Oct 24 '15 at 5:07











          • newfile.tar.gz needs to be read by openssl, not an arg to tar. openssl des3 -d -k #PASSWORD# < newfile.tar.gz | tar xvfz - -C tmp

            – cas
            Oct 24 '15 at 6:41


















          0














          You can encrypt any existing file with the same encryption tool and options, using standard shell redirection. For example:



          openssl des3 -salt -k #PASSWORD# < oldfile.tar.gz > newfile.tar.gz


          if you want to replace the old file with the new encrypted version, then:



          openssl des3 -salt -k #PASSWORD# < oldfile.tar.gz > newfile.tar.gz && mv -f newfile.tar.gz oldfile.tar.gz





          share|improve this answer
























          • I might be trying to decrypt incorrectly, but when i use openssl des3 -d -k #PASSWORD# | tar -C tmp -xvf newfile.tar.gz there's an error: gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting now error reading input file

            – Ned Schneebly
            Oct 24 '15 at 5:07











          • newfile.tar.gz needs to be read by openssl, not an arg to tar. openssl des3 -d -k #PASSWORD# < newfile.tar.gz | tar xvfz - -C tmp

            – cas
            Oct 24 '15 at 6:41
















          0












          0








          0







          You can encrypt any existing file with the same encryption tool and options, using standard shell redirection. For example:



          openssl des3 -salt -k #PASSWORD# < oldfile.tar.gz > newfile.tar.gz


          if you want to replace the old file with the new encrypted version, then:



          openssl des3 -salt -k #PASSWORD# < oldfile.tar.gz > newfile.tar.gz && mv -f newfile.tar.gz oldfile.tar.gz





          share|improve this answer













          You can encrypt any existing file with the same encryption tool and options, using standard shell redirection. For example:



          openssl des3 -salt -k #PASSWORD# < oldfile.tar.gz > newfile.tar.gz


          if you want to replace the old file with the new encrypted version, then:



          openssl des3 -salt -k #PASSWORD# < oldfile.tar.gz > newfile.tar.gz && mv -f newfile.tar.gz oldfile.tar.gz






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Oct 24 '15 at 4:54









          cascas

          39.1k454101




          39.1k454101













          • I might be trying to decrypt incorrectly, but when i use openssl des3 -d -k #PASSWORD# | tar -C tmp -xvf newfile.tar.gz there's an error: gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting now error reading input file

            – Ned Schneebly
            Oct 24 '15 at 5:07











          • newfile.tar.gz needs to be read by openssl, not an arg to tar. openssl des3 -d -k #PASSWORD# < newfile.tar.gz | tar xvfz - -C tmp

            – cas
            Oct 24 '15 at 6:41





















          • I might be trying to decrypt incorrectly, but when i use openssl des3 -d -k #PASSWORD# | tar -C tmp -xvf newfile.tar.gz there's an error: gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting now error reading input file

            – Ned Schneebly
            Oct 24 '15 at 5:07











          • newfile.tar.gz needs to be read by openssl, not an arg to tar. openssl des3 -d -k #PASSWORD# < newfile.tar.gz | tar xvfz - -C tmp

            – cas
            Oct 24 '15 at 6:41



















          I might be trying to decrypt incorrectly, but when i use openssl des3 -d -k #PASSWORD# | tar -C tmp -xvf newfile.tar.gz there's an error: gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting now error reading input file

          – Ned Schneebly
          Oct 24 '15 at 5:07





          I might be trying to decrypt incorrectly, but when i use openssl des3 -d -k #PASSWORD# | tar -C tmp -xvf newfile.tar.gz there's an error: gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting now error reading input file

          – Ned Schneebly
          Oct 24 '15 at 5:07













          newfile.tar.gz needs to be read by openssl, not an arg to tar. openssl des3 -d -k #PASSWORD# < newfile.tar.gz | tar xvfz - -C tmp

          – cas
          Oct 24 '15 at 6:41







          newfile.tar.gz needs to be read by openssl, not an arg to tar. openssl des3 -d -k #PASSWORD# < newfile.tar.gz | tar xvfz - -C tmp

          – cas
          Oct 24 '15 at 6:41




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f238298%2fencrypting-existing-tar-gz-archive%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

          Entries order in /etc/network/interfaces

          新発田市

          Grub takes very long (several minutes) to open Menu (in Multi-Boot-System)