minimal pseudo code for encrypting message to multiple recipients

Tim Prepscius timprepscius at
Thu Jul 25 18:32:05 CEST 2013

Sorry for starting a new message, somehow I only get the digest and
not the reply to my posted message.


I'm actually looking for pseudo code for a minimal implementation of pgp-mime.
Not using gpgme.

This is going to be part of a web client:  java -> gwt -> javascript.
No C code.

So.. I have a feeling this is an impossible request.
And that perhaps a full implementation is the *only* implementation.

I believe that bouncy castle has pgp support.  So I will probably be
able to use that.
I was hoping to find something like:

A minimal pgp-mime.

1. Canonicalize message.
2. Write a "encrypted/pgp-mime" mime-part.
3. Within mime-part write b64(encrypt(canon-message)).

Where encrypt is "rsa(aes-256-key) + aes-256(message) +
sha-256(previously written bytes)"

4.  Add mime-part attachment in format:

Some indicator of encryption version used.  And my public key.


I'm looking for a simplest of simple implementations which could then
be expanded on.
Perhaps this is impossible.


More information about the Gnupg-devel mailing list