convert .asc to .gpg (and eventually vice-versa)

Jerome Baum jerome at jeromebaum.com
Mon Oct 10 01:42:21 CEST 2011


On 2011-10-10 00:36, Jbar wrote:
>  Hi, It is maybe a dumb question, but I don't have found an easy way to convert a signed message from .asc to a .gpg ?

>  Should I uuencode .gpg message before to send it through the text-only channel, or is there a (easy) way to convert .asc to .gpg 
> (and also .gpg to .asc) ?

$ echo foo | gpg -aer jerome - | gpg --list-only --list-packets
gpg: jerome: skipped: public key already present
:pubkey enc packet: version 3, algo 1, keyid 0000000000000000
        data: [2046 bits]
:encrypted data packet:
        length: 63
        mdc_method: 2

$ echo foo | gpg -aer jerome - | sed -e '1d;$d' | openssl base64 -d |
gpg --list-only --list-packets

gpg: jerome: skipped: public key already present
:pubkey enc packet: version 3, algo 1, keyid 0000000000000000
        data: [2048 bits]
:encrypted data packet:
        length: 63
        mdc_method: 2

So you should be fine if you just remove the first and last lines
("-----...") and base64-decode.

-- 
PGP: A0E4 B2D4 94E6 20EE 85BA E45B 63E4 2BD8 C58C 753A
PGP: 2C23 EBFF DF1A 840D 2351 F5F5 F25B A03F 2152 36DA



More information about the Gnupg-devel mailing list