Skip to content

remove ASCII armor from GPG asymmetric encryption - #890

Merged
m90 merged 1 commit into
offen:gpg-outputfrom
Michuelnik:issue/889-remove-gpg-ascii-armor
Oct 27, 2026
Merged

m90 merged 1 commit into
offen:gpg-outputfrom
Michuelnik:issue/889-remove-gpg-ascii-armor

Conversation

@Michuelnik

@Michuelnik Michuelnik commented Oct 26, 2026 •

Copy link
Copy Markdown

While symmetric GPG encryption produces binary output the asymmetric GPG encryption uses ASCII armored output that are roughly 30% larger than the binary output.

This patch omits the ASCII armoring part.

I've built the patch on my forked branch and used it on my production server successfully:

  • The tar.gz.gpg has roughly the size of the tar.gz
  • is binary encoded and
  • has been successfully decrypted and unpacked

No tests were added since nothing was added, the existing tests should cover the new behaviour in the same way it did before. I successfully ran your lint, integration and unit tests on my fork, too.
No docs were changed since I assume the previous internal behaviour has been just a minor bug.

@Michuelnik Michuelnik changed the title remove ASCII armor from GPG asymmetric encryption #889 remove ASCII armor from GPG asymmetric encryption Oct 26, 2026
@m90

m90 commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Thanks for working on this. Even if I'd say the current behavior is a bug, I'd still like to keep the option to produce armored output if needed (the bug is the inconsistent output, not the armored output itself. Also someone might have built a pipeline around the behavior by now). I'm fine with defaulting to binary output, but I wouldn't want to remove it entirely. Thanks.

@Michuelnik
Michuelnik force-pushed the issue/889-remove-gpg-ascii-armor branch from 2f68819 to 2ab4545 Compare October 27, 2026 12:42
@Michuelnik

Copy link
Copy Markdown
Author

I see what I can do. I will add a configuration option GPG_OUTPUT=ascii that switches between binary and ASCII output for asymmetric GPG. Allthough switching to binary as default might be a breaking change I will use this as proposed by you.
Adding the feature for symmetric GPG is beyond my capabilities of golang.

@Michuelnik
Michuelnik force-pushed the issue/889-remove-gpg-ascii-armor branch from 2ab4545 to 8dcf9e5 Compare October 27, 2026 12:54
@Michuelnik
Michuelnik marked this pull request as draft October 27, 2026 14:49
@m90

m90 commented Oct 27, 2026

Copy link
Copy Markdown
Member

Allthough switching to binary as default might be a breaking change I will use this as proposed by you.

It's just as breaking as changing the output of asymmetric encryption from armored to binary without adding an option, no?

Adding the feature for symmetric GPG is beyond my capabilities of golang.

I'll merge your work into a feature branch and will pick up from there, thank you.

@m90
m90 changed the base branch from main to gpg-output October 27, 2026 15:42
@m90
m90 marked this pull request as ready for review October 27, 2026 15:42
@m90
m90 merged commit b40f5c6 into offen:gpg-output Oct 27, 2026
0 of 3 checks passed
m90 added a commit that referenced this pull request Oct 27, 2026
* add option to ASCII armor asymmetric GPG output (#890)

* Use custom string type for storing gpg output format

* Use armored writer only when configured

* Fix linting errors

* Remove superfluous multi closer

---------

Co-authored-by: Michuelnik <1367372+Michuelnik@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants