How to convert gpg4win's ascii to binary?

0

gpg4win can save and read encrypted files in two forms:

  1. Binary with .gpg extension
  2. Base64/ascii with .asc extension

Is there a way to convert the Base64/ascii output to binary? I tried with Notepad++ option "Base64 Decode" but that doesn't work:

Note:
I am not trying to decrypt, just convert from ascii to binary.
I can successfully do the opposite, i.e. convert gpg4win's binary to ascii by using Notepad++ command "Base64 Encode". gpg4win can decrypt this converted version (of course it can also decrypt the original binary format).

Thanks.

get_going

Posted 2018-11-12T19:35:03.943

Reputation: 75

Answers

0

It appears that the Base64 (or ASCII armor) option produces two separate base64 outputs. The first is the base64 encoding of the ciphertext. After that is the base64 encoding of a checksum, and this line is preceded with an equal sign. This encoding is specified in the OpenPGP RFC. And of course, the base64 chunks are surrounded with the obvious header and footer lines, e.g. for my gpg program the output starts out with

-----BEGIN PGP MESSAGE-----
Comment: GPGTools - http://gpgtools.org

and ends with

-----END PGP MESSAGE-----

I don't have Notepad++ but you should just be able to delete the header and footer lines and the checksum line and then base64 decode what remains to have a viable binary OpenPGP-compliant file.

President James Moveon Polk

Posted 2018-11-12T19:35:03.943

Reputation: 187

How can I thank you my dear. You have answered my question :) I am so grateful to you, really, thank so much!! – get_going – 2018-11-13T01:29:20.410

Hi James Polk. I have some follow-ups questions please: https://superuser.com/questions/1374910/is-gpgwin-the-best-way-to-protect-text-file

– get_going – 2018-11-13T03:58:47.067

Hi James, can you help doing the reverse please? https://superuser.com/questions/1375379/how-to-convert-gpg4wins-binary-to-ascii-with-notepad

– get_going – 2018-11-14T16:39:55.897

1@get_going: If this answer is correct then please mark it as accepted. – President James Moveon Polk – 2018-11-14T17:56:37.593

I just did that. Sorry I am new so didn't know what to do, thanks for telling me. Can you help me do the reverse please? See link in my previous comment. – get_going – 2018-11-14T18:26:14.157