[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnupg-devel
Subject:    Re: minimal pseudo code for encrypting message to multiple recipients
From:       Tim Prepscius <timprepscius () gmail ! com>
Date:       2013-07-25 21:37:05
Message-ID: CAAJ3AvVukb0yQgy-CMxqaoD5-qbugRq0aZCbJ1_g9cVLBYJp-w () mail ! gmail ! com
[Download RAW message or body]

Thank you for this.

I'm looking at mimemaker.c now.

-tim

On 7/25/13, Werner Koch <wk@gnupg.org> wrote:
> On Thu, 25 Jul 2013 18:32, timprepscius@gmail.com said:
>
>> I'm actually looking for pseudo code for a minimal implementation of
>> pgp-mime.
>
> You may want to look at gnupg/tools/gpgparsemail.c for a parser.
> Building messages is actually more trivial; maybe gpgol/src/mimemaker.c
> is of some help.  Well, not pseudo code.  For pseudo code you should
> just read RFC-3156 which has a lot of good examples.
>
>> And that perhaps a full implementation is the *only* implementation.
>
> Creating PGP/MIME is really simple.
>
>> A minimal pgp-mime.
>>
>> 1. Canonicalize message.
>> 2. Write a "encrypted/pgp-mime" mime-part.
>> 3. Within mime-part write b64(encrypt(canon-message)).
>
> Depends on whether you want to sign or encrypt.  Encrypt is easy; really
> easy I mean.  It is just a fixed block.
>
>> Where encrypt is "rsa(aes-256-key) + aes-256(message) +
>> sha-256(previously written bytes)"
>
> Nope: That is more complicated, you need to read the OpenPGP standard.
> Don't even try to come up with your own encryption protocol.
>
>> Some indicator of encryption version used.  And my public key.
>
> Sending the public key is not common with OpenPGP - You send it out of
> band.  Only S/MIME resorts to this kludged due to the non-standardized
> way of looking up keys (Oh well, unless you use the global X.500
> directory ;-)
>
>
>
> Shalom-Salam,
>
>    Werner
>
>
> --
> Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.
>
>

_______________________________________________
Gnupg-devel mailing list
Gnupg-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic