Only part of directory is being encrypted

On windows 7, using the right-click, when I attempt to encrypt a directory only about half the contents are captured in the archive. There doesn’t seem to be a pattern of exclusion – it liked some PNG files but didn’t like others.

It occurs to me that the problem is actually the tar version packed with GPG4Win. When I try to unpack the tar using 7zip I get a message “There are no trailing zero-filled records.”

Is this a known problem with GPG4Win? Is there any way to specify a different tar agent? I notice that the tar agent is in a drop-down list, but I couldn’t find a way to configure or add agents to the list.

Thanks!
Mark

GPG4Win: Version 2.2.2
Kleopatra: Version 2.2.0-gitac229d2 (2014-08-11)

Hi Mark,
please update to the most recent version of Gpg4win
(which is 2.3.3 at time of writing.)

Several important defects in the packaging and unpackaging of directories
have been fixed since your version (2.2.2) has been published.

Best Regards,
Bernhard

I upgraded. But I seem to have exchanged one problem for another. Now when I try to encrypt the same directory, it stops at a particular file:

Input error: Error while running C:/Program Files (x86)/GNU/GnuPG/gpgtar.exe:
gpgtar: error storing file — file name of length 103 —
: Provided object is too large
gpgtar: creating tarball `[stdout]’ failed: Provided object is too large

When it says “too large”, does it mean the file size, or the file name? The file size is only about 686k. The file name is only about 103 characters long or 132 characters if you count the absolute path.

The directory is tar-able if I use the tar that comes with the 7zip program.

Thanks!
Mark

Hi Mark,

if you rename the file for testing, does it work?

Are you using Gpg4win 2.3.3 now?

Best,
Bernhard

Yes, I’ve upgraded to 2.3.3

Yes, changing the name makes a difference. It appears that it won’t accept anything over 98 characters. Checking online, I see that the new GNU tar has name length unlimited, but v7 limits names to 99 characters.

I use the file names to help me organize their contents. I wouldn’t want to decrypt every time just to peek inside. File names are the only multi-platform way I know to share meta information.

The tar in 7zip has no problems with the file name lengths.

I notice that the GPG interface has a drop-down list for archive. Does this mean that there is a way to tell GPG to use 7zip, for instance, to do the tar/zip before encryption? Doing it in 2 steps with 2 tools would be impractical on a regular basis.

Thank you,
Mark

Hi Mark,

thanks for testing the filename, I’ve created
https://bugs.gnupg.org/gnupg/issue2687 to track progress on the matter.

Yes, I think you can use your own archiver. It’s been a while since I’ve tried this myself. :slight_smile:

Best,
Bernhard

I found these instructions in an old readme. It said to put this in the configuration file:

[Archive Definition #0]
Name=TAR (via 7-ZIP)
id=7zip
extensions=tar
pack-command=7z a dummy -ttar -so

Unfortunately, this turns out to only change the name in the drop-down list. The program continues to use gpg-tar. I could not find any configuration instructions. I don’t suppose anyone knows how it’s actually supposed to work?

Thanks,
Mark

I found that it is actually documented in kleopatra’s Handbook:
https://docs.kde.org/trunk5/en/pim/kleopatra/admin-archive-definitions.html

I would have to check the 7zip documentation / command line help and try it out a bit to give you a complete example. So I hope with that documentation you can get it to work.

In your snippet you use Archive Definition #0 That can be problematic as this number is already used. Better use Archive Definition #8 or something.

Please let me know if you have it working I would then add this as another more practical example to the documentation.

Thank you for the link to the configuration documentation. Here’s what I came up with:

[Archive Definition #0]
Name=TAR (via 7-ZIP)
id=7z
extensions=7ziptar
pack-command=“C:\Program Files\7-Zip\7z.exe” a dummy -ttar -so
unpack-command=“C:\Program Files\7-Zip\7z.exe” x -si -ttar

I changed it to definition #0 (and changed the original to #1) to make it the default in the list.

Note that I made the extension 7ziptar. You could make it “tar”, but the gpgtar can’t properly unzip tars made by 7zip. A few years down the road you (well, me) might not remember that it was actually the 7zip tar. It appears that Kleopatra is smart enough that if you use a special extension it will choose the appropriate archiver from the drop-down list.

In a sense this untar works better than the original. The original PGP compatible untar made artifacts in the directory name. So if the original directory was “test”, the extracted directory would be “test.tar_1_” . Maybe this needs to be mentioned as a bug item?

Now I have to figure out if it makes sense to use GPG with 7zip this way, or if I should just use 7zip.

Thank you,
Mark