Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

2012Tony2012

macrumors 6502a
Original poster
Dec 2, 2012
741
3
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?
 

2012Tony2012

macrumors 6502a
Original poster
Dec 2, 2012
741
3
Just curious, why do you want to do it that way?

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?
 

SandboxGeneral

Moderator emeritus
Sep 8, 2010
26,482
10,051
Detroit
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?

Nah, I guess not.
 

2012Tony2012

macrumors 6502a
Original poster
Dec 2, 2012
741
3
Did you try contacting GPGTools support directly? If anyone would know how to do it, it'd be them.

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
 

Peace

Cancelled
Apr 1, 2005
19,546
4,556
Space The Only Frontier
Did you try contacting GPGTools support directly? If anyone would know how to do it, it'd be them.

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?

See the Mods reply..

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

Mikael H

macrumors 6502a
Sep 3, 2014
864
538
tar cf - FolderName/ | gpg --encrypt --armor --recipient endafarrell@email.com | gzip --best > FolderName.tar.asc.gz

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.
 

endafarrell

macrumors newbie
Sep 29, 2017
2
1
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.

@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.
 
  • Like
Reactions: Mikael H

Mikael H

macrumors 6502a
Sep 3, 2014
864
538
@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.
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. :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.