How can I encrypt a folder using gpg?

Discussion in 'Mac Apps and Mac App Store' started by 2012Tony2012, May 31, 2014.

  1. 2012Tony2012 macrumors 6502a

    2012Tony2012

    Joined:
    Dec 2, 2012
    #1
    I've installed GPGTools and created a public and secret key.

    But how do I encrypt a folder using Terminal?

    I have tried:

    gpg -e filename foldername

    But that doesn't work.

    Also tried going into the folder I want to encrypt and typing:

    gpg -e * filename

    But that doesn't work either :(

    What is the proper command to encrypt a whole folder please?
     
  2. 2012Tony2012 thread starter macrumors 6502a

    2012Tony2012

    Joined:
    Dec 2, 2012
  3. SandboxGeneral Moderator emeritus

    SandboxGeneral

    Joined:
    Sep 8, 2010
    Location:
    Detroit
    #4
    Just curious, why do you want to do it that way?
     
  4. 2012Tony2012 thread starter macrumors 6502a

    2012Tony2012

    Joined:
    Dec 2, 2012
    #5
    Please stay on topic as my explanation will go of topic, I have my reasons. PGPtools also zips the files when encrypting etc, and I have many other reasons why I want to use the Terminal command.

    So please, stay on topic, do you know the Terminal command to encrypt a folder?

    Anyone?
     
  5. SandboxGeneral Moderator emeritus

    SandboxGeneral

    Joined:
    Sep 8, 2010
    Location:
    Detroit
    #6
    Nah, I guess not.
     
  6. 2012Tony2012 thread starter macrumors 6502a

    2012Tony2012

    Joined:
    Dec 2, 2012
    #7
    It's amazing... I googled and googled, and nobody knows how to encrypt a folder using gpg using CLI. That surprises me :eek:
     
  7. SandboxGeneral Moderator emeritus

    SandboxGeneral

    Joined:
    Sep 8, 2010
    Location:
    Detroit
    #8
    Did you try contacting GPGTools support directly? If anyone would know how to do it, it'd be them.
     
  8. 2012Tony2012 thread starter macrumors 6502a

    2012Tony2012

    Joined:
    Dec 2, 2012
    #9
    I would use GPGtools to encrypt, but the process takes a lot longer than Terminal would, GPGtools annyingly also zips up every folder before encrypting as well:(

    I know how to decrypt a file:

    gpg -d -o file.zip file.gpg

    But I cannot gpg to encrypt a folder:( Whatever command I tries it fails:( I can encrypt a single file no problems, I just type: gpg -e filename

    But how on earth do I tell gpg to encrypt an entire folder?

    I keep getting error like this:

    gpg: Videos/: read error: Is a directory
    gpg: Videos/: encryption failed: Is a directory
     
  9. Peace macrumors Core

    Peace

    Joined:
    Apr 1, 2005
    Location:
    Space--The ONLY Frontier
    #10
    See the Mods reply..

    Go to their forums. They are fairly robust and you would probably get a better and quicker answer there.
     
  10. endafarrell macrumors newbie

    Joined:
    Sep 29, 2017
    #11
    tar cf - FolderName/ | gpg --encrypt --armor --recipient endafarrell@email.com | gzip --best > FolderName.tar.asc.gz
     
  11. Mikael H macrumors 6502

    Joined:
    Sep 3, 2014
    #12
    Encrypted content should by definition have a pretty high level of entropy, meaning compressing it isn't likely to help a whole lot. I'd recommend either compressing the initial data or not bothering with compression.
     
  12. endafarrell macrumors newbie

    Joined:
    Sep 29, 2017
    #13
    @Mikael H A small dir of JPGs was 12MB before gzipping, 9MB after. It's generally recommended to test your circumstances, see what works out given the data and options used. I suspect (but haven't tested) that the "--armor" option is contributing to this.
     
  13. Mikael H macrumors 6502

    Joined:
    Sep 3, 2014
    #14
    That was interesting. Yes, real-life testing is the best way to get definite answers, but not always practical. I'm glad I was wrong in your case. :)
     

Share This Page