Encrypting / decrypting without importing keys?

David Shaw dshaw at jabberwocky.com
Wed Oct 6 20:17:34 CEST 2004


On Wed, Oct 06, 2004 at 01:32:37PM -0400, Eric B. wrote:

> Thanks!  That was just what I needed.  However, have a followup
> question though.  I now need to programatically convert the ascii
> key to a binary key.  Doing a quick export of a key in binary format
> and in armoured format, I noticed that I can base64 encode the
> binary key and get an almost exact match to the armoured format.
> However, there seem to be five characters on a newline (=oge7) that
> appear in the armoured key which are not my base64 conversion of the
> binary key.  I can only assume them to be some form of a CRC check,
> but am not sure.  Is there armoured version of the key always
> followed by a CRC check?  If so, is it a CRC32 check?  CRC24? etc?
> How can I tell when/where the key ends and the CRC checks starts?
> Does a armoured key always end with a specific character?  Is there
> a doc which specifies the format of the armoured key somewhere?

It's a CRC24, and you can tell it is there because it's always the
last line, and it begins with an '=' sign.  However, the CRC24
checksum is optional according to the standard (though both GnuPG and
PGP always include it).

RFC-2440 defines the format for OpenPGP, including the various details
of armoring (which as you noticed is essentially base64).

David



More information about the Gnupg-users mailing list