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:

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).



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

Comment: GPGTools - http://gpgtools.org

and ends with


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.

| improve this answer | |
  • How can I thank you my dear. You have answered my question :) I am so grateful to you, really, thank so much!! – get_going Nov 13 '18 at 1:29
  • Hi James Polk. I have some follow-ups questions please: superuser.com/questions/1374910/… – get_going Nov 13 '18 at 3:58
  • Hi James, can you help doing the reverse please? superuser.com/questions/1375379/… – get_going Nov 14 '18 at 16:39
  • 1
    @get_going: If this answer is correct then please mark it as accepted. – President James K. Polk Nov 14 '18 at 17:56
  • 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 Nov 14 '18 at 18:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.