Contents
- The same data purpose may have a different transmission form
- When is text appropriate and when is a binary file appropriate?
- The suffix is not a reliable description of the object
- Converting a public test file in GnuPG
- The package checksum is not a document signature
- Typical transmission errors
- Safe selection and result verification
- Frequently asked questions
The same data purpose may have a different transmission form
OpenPGP objects are made up of binary packets. ASCII Armor is a text wrapper that allows their encoded content to be transmitted, for example, over a text interface. It does not itself add any confidentiality or trusted signature. The public key in text form remains a public key, the private export remains sensitive even after being converted to readable lines.
You can recognize a text wrapper by its header and tail, such as BEGIN PGP PUBLIC KEY BLOCK. Between these are the encrypted content and any additional elements according to the profile. Do not confuse a wrapper with its own object type: a similar form can contain a key, a message, or a signature. When working, always first determine what the file represents.
When is text appropriate and when is a binary file appropriate?
ASCII Armor is useful for inserting public data into a text form, email, or documentation. It is more robust to environments that cannot preserve arbitrary binary bytes. This portability comes at the cost of larger size. When copying, you need to preserve the entire block and not let the editor add quotes or other characters to its contents.
The binary form is suitable for direct file manipulation and automation, as long as the transport does not change the bytes. It tends to be smaller and does not create the impression that every text interface is a suitable repository for private keys. However, the choice of wrapper alone does not determine algorithm support, packet versions, or the validity of the cryptographic bindings within.
The suffix is not a reliable description of the object
The asc extension usually indicates text Armor, while gpg or pgp may indicate binary OpenPGP. However, these are conventions and sometimes the naming does not match the content. A file with the sig extension can be binary or another type of signature. Do not choose to import or decrypt based on the name alone, especially if it comes from an unknown source.
Header display is a guideline check, not a security check. An attacker can create a nice-looking block of text. The parser must process the content and the verifier must process the appropriate signatures. Do not put your private key into an online converter before diagnostics just because you cannot open its binary form.
Converting a public test file in GnuPG
gpg --output verejny-klic.pgp --dearmor verejny-klic.asc
gpg --output verejny-klic-zpet.asc --enarmor verejny-klic.pgpThe first command removes the text wrapper. The second creates a generic text wrapper for the data; it is not a universal replacement for the standard public key export for every importer. For routine public certificate handover from a keyring, an explicit export with --armor and a precisely selected fingerprint is more appropriate. Verify beforehand that the output path does not contain an important file.
gpg --armor --output verejny-export.asc --export CELÝ_OVĚŘENÝ_OTISKReplace the placeholder text with the actual fingerprint. The command exports the public part; do not confuse it with --export-secret-keys. The conversion may change the text representation, and thus the hash of the entire asc file, without changing the meaning of the corresponding key material. However, always verify the completeness of the certificate independently.
The package checksum is not a document signature
Some forms of Armor may contain a checksum to detect transmission errors. Such a checksum is not an authentication signature and does not confirm the author. Moreover, the rules for its presence vary by profile and version; do not create your own requirement that every modern block must end with the same line as the old export.
If the publisher signed a particular asc file as plain binary data, changing it, including editing lines, can break this outer signature. This is a different situation than verifying the signature packets inside an OpenPGP certificate. Before normalizing the text, find out what object and layer you are actually inspecting.
Typical transmission errors
The copy may lose the beginning or end of a block, add email quotes, or contain several different objects glued together. The formatted editor may insert unexpected characters. If the import fails, go back to the original file download and verify completeness; do not attempt to manually complete unknown encoded lines.
For the signature, make sure you pass it alongside the corresponding data. Renaming the signature from asc to sig will not change its internal format, and converting it to binary will not create support for an unsupported algorithm. The problem may be with the profile or version of the program, not that the other application prefers a different extension.
Safe selection and result verification
- Determine the type of object before deciding on the packaging.
- Adapt public transmissions to the supported interface of the recipient.
- Only transfer private material in a trusted local environment.
- After the transfer, check the entire footprint and the necessary operations.
- Don't confuse the text wrapper checksum with proof of origin.
In CH-J Tools and on the keyserver, use the form actually supported by the given input. The inscription insert key does not mean that the form will accept any signature or encrypted message. The correct representation facilitates transmission, but trust is still ensured by verified identity and cryptographic control of the actual content.
Frequently asked questions
Does ASCII Armor encrypt content?
No. It is a text transfer wrapper.
Will renaming asc to gpg change the format?
No. The filename does not change its bytes or internal structure.
Is the Armor checksum proof of authorship?
No. You need a matching signature and trusted key to verify the origin.
Detailed documentation
IETF: OpenPGP and ASCII Armor →