You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e20448c
Browse filesBrowse the repository at this point in the historyBrowse files
-[draft-ietf-jose-hpke-encrypt](https://datatracker.ietf.org/doc/draft-ietf-jose-hpke-encrypt/): use of HPKE ([RFC 9180](https://www.rfc-editor.org/rfc/rfc9180) / [draft-ietf-hpke-hpke](https://datatracker.ietf.org/doc/draft-ietf-hpke-hpke/)) with JWE, in both Key Management Modes —
Integrated Encryption (`HPKE-0`, `HPKE-1`, `HPKE-2`) and Key Encryption (`HPKE-0-KE`, `HPKE-1-KE`, `HPKE-2-KE`); HPKE `mode_base` only, `mode_psk` (`psk_id`) is not supported yet
14
14
-[draft-ietf-jose-hpke-pq-pqt](https://datatracker.ietf.org/doc/draft-ietf-jose-hpke-pq-pqt/): PQ/T hybrid HPKE — `HPKE-9` and `HPKE-9-KE`, based on the MLKEM768-X25519 KEM and SHAKE256 KDF from [draft-ietf-hpke-pq](https://datatracker.ietf.org/doc/draft-ietf-hpke-pq/); the KEM is identical to X-Wing ([draft-connolly-cfrg-xwing-kem](https://datatracker.ietf.org/doc/draft-connolly-cfrg-xwing-kem/))
15
15
-[RFC 9964 (AKP JWKs)](https://www.rfc-editor.org/rfc/rfc9964): parsing Algorithm Key Pair JWKs for the PQ/T hybrid algorithms
Copy file name to clipboardExpand all lines: src/main/java/org/cryptomator/jose/Alg.java
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,8 @@
21
21
/// A JWE algorithm, identified by its `alg` header value. It is split by direction into [EncryptionAlg] and [DecryptionAlg], and by JWE Key Management Mode
22
22
/// into key management (protecting a content encryption key, [RFC 7518 Section 4](https://www.rfc-editor.org/rfc/rfc7518#section-4)) and Integrated Encryption
23
23
/// ([draft-ietf-jose-hpke-encrypt Section 5](https://datatracker.ietf.org/doc/html/draft-ietf-jose-hpke-encrypt/#section-5), where HPKE encrypts the payload directly and there is no CEK).
24
+
///
25
+
/// All HPKE algorithms (`hpke0`…`hpke9`, `hpke0Ke`…`hpke9Ke`) run in HPKE `mode_base` only; `mode_psk` and the `psk_id` header parameter are not supported.
Copy file name to clipboardExpand all lines: src/main/java/org/cryptomator/jose/IntegratedEncryptionAlg.java
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,7 @@
4
4
5
5
/// HPKE Integrated Encryption as defined in [draft-ietf-jose-hpke-encrypt, Section 5](https://datatracker.ietf.org/doc/html/draft-ietf-jose-hpke-encrypt/#section-5):
6
6
/// HPKE encrypts the payload directly — there is no CEK, no `enc` or `ek` header parameter, the JWE IV and Authentication Tag are empty, and there is exactly one recipient.
7
+
/// Only HPKE `mode_base` is supported; `mode_psk` (`psk_id` header parameter) is not.
Copy file name to clipboardExpand all lines: src/main/java/org/cryptomator/jose/alg/HPKEIntegratedAlg.java
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,9 @@
14
14
/// HPKE Integrated Encryption as defined in [draft-ietf-jose-hpke-encrypt, Section 5](https://datatracker.ietf.org/doc/html/draft-ietf-jose-hpke-encrypt/#section-5):
15
15
/// HPKE encrypts the payload directly, the encapsulated secret travels in the JWE Encrypted Key field, and the JWE Protected Header
16
16
/// (as well as an optional JWE AAD) is bound to the ciphertext via the HPKE `aad` parameter.
17
+
///
18
+
/// Only HPKE `mode_base` is supported. The draft also allows `mode_psk`, signalled by the `psk_id` header parameter; a token carrying `psk_id` is not understood
19
+
/// (it is rejected when listed in `crit`, and otherwise fails to decrypt because the PSK never enters the key schedule).
Copy file name to clipboardExpand all lines: src/main/java/org/cryptomator/jose/alg/HPKEKeyEncryptionAlg.java
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,9 @@
16
16
17
17
/// HPKE Key Encryption as defined in [draft-ietf-jose-hpke-encrypt, Section 6](https://datatracker.ietf.org/doc/html/draft-ietf-jose-hpke-encrypt/#section-6):
18
18
/// HPKE seals the CEK, the encapsulated secret travels in the `ek` header parameter, and the content is encrypted with a regular [org.cryptomator.jose.Enc].
19
+
///
20
+
/// Only HPKE `mode_base` is supported. The draft also allows `mode_psk`, signalled by the `psk_id` header parameter; a token carrying `psk_id` is not understood
21
+
/// (it is rejected when listed in `crit`, and otherwise fails to decrypt because the PSK never enters the key schedule).
Copy file name to clipboardExpand all lines: src/main/java/org/cryptomator/jose/hpke/HPKE.java
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,8 @@
15
15
importjava.security.PublicKey;
16
16
17
17
/// An HPKE ciphersuite (KEM, KDF, AEAD) as defined in [draft-ietf-hpke-hpke](https://datatracker.ietf.org/doc/html/draft-ietf-hpke-hpke-03), offering the base mode
18
-
/// sender and recipient setup. The static factory methods provide the suites registered for JOSE in
18
+
/// sender and recipient setup. Only `mode_base` is implemented: `mode_psk` (a pre-shared key authenticating the sender, draft-ietf-hpke-hpke Section 5.1.2) as
19
+
/// well as `mode_auth` and `mode_auth_psk` are not supported, although the key schedule already accepts the PSK inputs. The static factory methods provide the suites registered for JOSE in
19
20
/// [draft-ietf-jose-hpke-encrypt](https://datatracker.ietf.org/doc/html/draft-ietf-jose-hpke-encrypt/) and
20
21
/// [draft-ietf-jose-hpke-pq-pqt](https://datatracker.ietf.org/doc/html/draft-ietf-jose-hpke-pq-pqt/); `baseName` is the JOSE `alg` name of the suite's
21
22
/// Integrated Encryption variant (the Key Encryption variant appends `-KE`).
@@ -132,8 +133,9 @@ public record Sender(byte[] enc, Context context) {
132
133
/// @param mode A one-byte value indicating the HPKE mode, defined in Table 1.
133
134
/// @param sharedSecret A KEM shared secret generated for this transaction.
134
135
/// @param info Application-supplied information (optional).
135
-
/// @param psk A pre-shared key (PSK) held by both the sender and the recipient (optional).
136
-
/// @param pskId An identifier for the PSK (optional).
136
+
/// @param psk A pre-shared key (PSK) held by both the sender and the recipient; must be empty, as only `mode_base` is supported
137
+
/// @param pskId An identifier for the PSK; must be empty, as only `mode_base` is supported
138
+
/// @throws UnsupportedOperationException for any mode other than `mode_base`
0 commit comments