| Version 21 (modified by thomasb, 17 months ago) (diff) |
|---|
Encryption
on this page thoughts about the development of an encryption plugin will be shared.
Alec started the implementation of a GPG plugin some time ago, but didn't finish it yet.
Some basics are already impelemented, but it's not functional yet.
The code is located at https://svn.roundcube.net/trunk/plugins/enigma/
quick brainstorming: see RoundCube-Dev Thread for discussion on the mailinglist.
- add some abstraction layer to support several implementations of gnupg key management
- possible drivers:
- server side key storage (either use gnupg binary or the php pecl gnupg library)
- client side key storage (using FireGPG)
- maybe even other encryption systems, i.e. s/mime
- possible drivers:
- list of essential functions:
- encrypt(text, keys): encrypt text for public keys
- decrypt(text): decrypt text with appropriate private key
- sign(text, privatekey): sign text with private key
- verify(text): verify
- import_key(text): import keys
- list of additional useful functions:
- export_key(key): export public key
- signandencrypt(text, keys, privatekey): sign with private key and encrypt for public keys
- del_key(key): delete public key
- del_priv_key(privatekey): delete private key
- edit_priv_key(privatekey): edit private key
- list_keys(): list all public keys
- list_priv_keys(): list all private keys
- gen_priv_key(): generate new private key
- get_key(email/keyid): get a new public key
- list of insecure functions (should not be implemented):
- import_priv_key(privatekey): import private key
- export_priv_key(privatekey): export private key
- for mail layer:
- decrypt inline encrypted mails
- decrypt openpgp/mime encrypted mails
- verify inline signed mails
- verify opengpg/mime signed mails
- encrypt and/or sign outgoing mails with opengpg/mime standard
- encrypt and/or sign outgoing mails inline
- We need to handle attachements too:
- detect encrypted attachments
- option to decrypt encrypted attachments before download
- option to encrypt attachments before sending mail
- storage interface(?): Interface to keys implemented by drivers
- encrypt(text,keys)
- decrypt(text, passphrase_callback)
- sign(text,keys,passphrase_callback)
- verify(text)
- for server side storage:
- create gnupg home directories with pubring.gpg and secring.gpg for every single user
- pass $GNUGPGHOME to gnupg/gpgme library according to roundcube user
- requirement to give read+write access to webserver user to all gnupg home directories
- maybe maintain a mysql database with all keys, fingerprints etc to detect manipulated key data in the keyrings. objection: if attacker has webserver user privileges, s/he has access to the roundcube mysql password as well.
- maybe print md5/sha256 sums of keyring files in roundcube interface. urge user to write them down and compare. the code that creates theses sums doesn't need to be writeable to the webserver user.
- public keys retrieval - ldap, keyserver lookup, database
- additional useful user settings/options:
- default private key to sign mails
- default public key to encrypt mails for in addition to recipient keys (i.e. own key)
- default (sign y/n; encrypt y/n) for new mails
- default for replies to signed and/or encrypted mails
- default for replies to unsigned and unencrypted mails
- additional useful global settings/options:
- backend plugin(s)
- ldap servers and query method
- keyservers
- default public key to encrypt mails for in addition to recipient keys (i.e. escrow)
- To check
- We need a mime parser and a mime generator to works with OpenPGP/Mime. Is roundcube's class usable for that ?
- See plugin hooks message_part_encrypted and message_load plus rcube_message::get_part_content()
- Resources
- relevant RFCs:
- RFC1847 - Security Multiparts for MIME: Multipart/Signed and Multipart/Encrypted
- RFC2045 - Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies
- RFC2046 - Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types
- RFC2047 - Multipurpose Internet Mail Extensions (MIME) Part Three: Message Header Extensions for Non-ASCII Text
- RFC2387 - The MIME Multipart/Related Content-type
- RFC2440 - OpenPGP Message Format (revised in RFC4880)
- RFC3156 - MIME Security with OpenPGP
- RFC3851 - Secure/Multipurpose Internet Mail Extensions (S/MIME)
- RFC4880 - OpenPGP Message Format (updates RFC2440)
- RFC1847 - Security Multiparts for MIME: Multipart/Signed and Multipart/Encrypted
- FireGPG implementation:
- Enigmail's source
- Horde Crypt Framework:
- Horde IMP PGP/SMIME implementation:
- GPG4Browsers
- is a JavaScript? (prototype) implementation of the OpenPGP Message Format [RFC 4880]
- http://gpg4browsers.recurity.com/
- relevant RFCs:
please extend this design draft with your thoughts ...
to read the page with Bulgarian translation http://www.fatcow.com/edu/roundcube-epository-bg/
Attachments (10)
-
plain_text_inline_signed.eml
(879 bytes) -
added by mejo 4 years ago.
plain text mail - inline signed
-
plain_text_mime_signed.eml
(1.1 KB) -
added by mejo 4 years ago.
plain text mail - mime signed
-
plain_text_inline_encrypted.eml
(1.5 KB) -
added by mejo 4 years ago.
plain text mail - inline encrypted (decrypted message: "plain text inline encrypted"
-
plain_text_mime_encrypted.eml
(1.9 KB) -
added by mejo 4 years ago.
plain text mail - mime encrypted (decrypted message: "plain text mime encrypted")
-
plain_text_inline_encrypted+signed.eml
(1.7 KB) -
added by mejo 4 years ago.
plain text mail - inline encrypted and signed (decrypted message: "plain text inline encrypted and signed")
-
plain_text_mime_encrypted+signed.eml
(2.0 KB) -
added by mejo 4 years ago.
plain text mail - mime encrypted and signed (decrypted message: "plain text mime encrypted and signed")
-
plain_text+png_attachment_mime_signed.eml
(1.8 KB) -
added by mejo 4 years ago.
plain text mail - mime signed with png image as attachment
-
plain_text+png_attachment_mime_encrypted.eml
(2.5 KB) -
added by mejo 4 years ago.
plain text mail - mime signed with png image as attachment (decrypted message: "plain text and image/png attachment mime encrypted")
-
multipart_text+html_mime_signed.eml
(2.9 KB) -
added by mejo 4 years ago.
multipart mail with two layers and both text and html content - mime signed
-
multipart_text+html_mime_encrypted.eml
(2.7 KB) -
added by mejo 4 years ago.
multipart mail with two layers and both text and html content - mime encrypted (decrypted message: same asmultipart_text+html_mime_signed.eml)
Download all attachments as: .zip
