[RCD] Enigma hybrid decryption

A.L.E.C alec at alec.pl
Tue Aug 30 19:52:59 CEST 2016


On 08/30/2016 03:53 PM, Kyle Francis wrote:
> So I'm mostly finished with the implementation of the hybrid decryption
> model.  So far I have the following working:
> 
> enigma.js calls a mailvelope API I added for decrypting session key out
> of a PGP message
>   - decrypted session key and PGP message get posted (over https) back
> to the enigma plugin
> enigma.php catches posted data and decrypts PGP message with session key

You post the message body? I thought you'd post only the session-key. We
can get the body from IMAP, so I wouldn't post it.

>   - modified Crypt_GPG to additionally utilize GPG's
> "--override-session-key"

This calls for a PR to Crypt_GPG library.

> So I can write the decrypted email to a file on the server, but I'd like
> to replace the body of the email and reload.  When doing this while
> decrypting S/MIME it was simple since the replacing occurred before the
> message was completely loaded and rendered out as html.
> 
> Is there any way to replace the body (and subsequently parse the body
> structure) after all the plugin hooks have run?  I tried calling
> exec_hook for message_part_body, but as far as I can tell I would need
> to pass the rcube_message object as an argument to do this but I don't
> have access to it.

I think it should go through the message parser. So, load the message as
before with all enigma's hooks parsing the message but where decryption
is supposed to be executed use the session-key instead of key/password.
I suppose you'd have to store the session-key in Roundcube session for
some time, as we normally do with private keys passwords.

-- 
Aleksander 'A.L.E.C' Machniak
Kolab Groupware Developer        [http://kolab.org]
Roundcube Webmail Developer  [http://roundcube.net]
---------------------------------------------------
PGP: 19359DC1 @@ GG: 2275252 @@ WWW: http://alec.pl


More information about the dev mailing list