Skip to content

Experimental: Symmetric Keys and Forwarding#141

Draft
wussler wants to merge 5 commits into
mainfrom
Proton
Draft

Experimental: Symmetric Keys and Forwarding#141
wussler wants to merge 5 commits into
mainfrom
Proton

Conversation

@wussler

@wussler wussler commented Jan 17, 2023

Copy link
Copy Markdown
Contributor

Forwarding

An offline OpenPGP user might want to automatically forward part or all of their email messages to third parties. Given that messages are encrypted, this requires transforming them into ciphertexts decryptable by the intended forwarded parties, while maintaining confidentiality and authentication. This can be achieved using Proxy transformations on the Curve25519 elliptic curve field with minimal changes to the OpenPGP protocol, in particular no change is required on the sender side. In this document we implement the forwarding scheme described in OpenPGP Email Forwarding Via Diverted Elliptic Curve Diffie-Hellman Key Exchanges.

Symmetric keys

It is sometimes useful to encrypt data under some symmetric key. While this was possible to do using passphrase-derived keys, there was no support for long-term storage of the keys that was used to encrypt the key packets.

To solve this, a new type of key is introduced. This key will hold a symmetric key, and will be used for both encryption and decryption of data. Specifically, as with asymmetric keys, the actual data will be encrypted using a session key, generated ad-hoc for these data. Then, instead of using a public key to encrypt the session key, the persistent symmetric key will be used instead, to produce a, so to say, Key Encrypted Key Packet.

Conversely, instead of using a private key to decrypt the session key, the same symmetric key will be used. Then, the decrypted session key can be used to decrypt the data packet, as usual.

As with the case of AEAD keys, it is sometimes useful to "sign" data with a persistent, symmetric key.

This key holds a symmetric key, which can be used for both signing and verifying the integrity of data. While not strictly needed, the signature process will first generate a digest of the data-to-be-signed, and then the key will be used to sign the digest, using an HMAC construction.

For technical reasons, related to this implementation of the openpgp protocol, the secret key material is also stored in the newly defined public key types. Future contributors must take note of this, and not export or serialize that key in a way that it will be publicly available.

Since symmetric keys do not have a public and private part, there is no point serializing the internal "public key" structures. Thus, symmetric keys are skipped when serializing the public part of a keyring.

Comment thread openpgp/forwarding.go Outdated
Comment thread openpgp/forwarding.go Outdated
Comment thread openpgp/forwarding.go
@wussler
wussler force-pushed the Proton branch 2 times, most recently from bf6b325 to 08c6691 Compare April 26, 2023 10:28
@lubux
lubux force-pushed the Proton branch 2 times, most recently from e48ac98 to 1310627 Compare January 18, 2024 14:34
@lubux
lubux force-pushed the Proton branch 2 times, most recently from 0b33f7b to 5cc763e Compare July 18, 2024 12:11
@twiss twiss mentioned this pull request Sep 25, 2024
@lubux
lubux force-pushed the Proton branch 3 times, most recently from e709df1 to 9c0359b Compare November 8, 2024 15:05
@twiss
twiss force-pushed the Proton branch 2 times, most recently from e5928a3 to 8a59df2 Compare November 12, 2024 16:12
@lubux
lubux force-pushed the Proton branch 2 times, most recently from 5d82987 to 2e09cd7 Compare November 26, 2024 15:51
Comment thread openpgp/symmetric/aead.go Fixed
Comment thread openpgp/symmetric/experimental_aead.go Fixed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants