Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert a (binary) .key PGP file to an ASCII-armored file?

Tags:

pgp

Is there a way to convert a (binary) .key file to an ASCII-armored .asc file?

There is a previous post which seems to suggest the file extension don't matter, the file content is the same: What is the difference b/w .pkr and .key file with respect to PGP?

like image 883
Bruce Avatar asked Mar 20 '14 20:03

Bruce


People also ask

What is PGP ASCII Armor?

ASCII armor is a binary-to-textual encoding converter. ASCII armor is a feature of a type of encryption called pretty good privacy (PGP). ASCII armor involves encasing encrypted messaging in ASCII so that they can be sent in a standard messaging format such as email.

How do I use ASCII armor?

To use ASCII armor when encrypting and signing when using OpenPGP, Go to Tools/Options/OpenPGP and then check the option labelled "Use ASCII armor in encryption and signing."


1 Answers

You can use GnuPG for this. From man gpg:

   --enarmor
   --dearmor
          Pack or unpack an arbitrary input into/from an OpenPGP ASCII armor.
          This is a GnuPG extension to OpenPGP and in general not very useful.

--enarmor reads from stdin and outputs the armored version to stdout, --dearmor works the other way round. For ASCII armoring a binary keyring, use gpg --enarmor <file.key >file.asc.

Although the two files are different, they share the same OpenPGP packets and can be converted in both directions. The ASCII-armored version was created for usage in e-mail and other plain ASCII protocols.

like image 147
Jens Erat Avatar answered Oct 07 '22 16:10

Jens Erat