Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HPKE key generation tool #1116

Merged
merged 1 commit into from Mar 21, 2023
Merged

Add HPKE key generation tool #1116

merged 1 commit into from Mar 21, 2023

Conversation

divergentdave
Copy link
Contributor

This adds a command-line tool to generate HPKE keypairs, closing #801. Sample output:

# HPKE configuration, Janus format
id: 255
kem_id: X25519HkdfSha256
kdf_id: HkdfSha256
aead_id: Aes128Gcm
public_key: vaiPHYKo6c_HZvqjMgfcFLgWmvo45nbJ_5G4ShFBQnc
---
# HPKE private key, in base64url
EC9SQqZky66zQ5dl1aWu-5xZ34MVfB2RdoSCFGkHlGo
---
# HPKE keypair, Janus format
config:
  id: 255
  kem_id: X25519HkdfSha256
  kdf_id: HkdfSha256
  aead_id: Aes128Gcm
  public_key: vaiPHYKo6c_HZvqjMgfcFLgWmvo45nbJ_5G4ShFBQnc
private_key: EC9SQqZky66zQ5dl1aWu-5xZ34MVfB2RdoSCFGkHlGo
---
# HPKE configuration, DAP encoded, in base64url
_wAgAAEAAQAgvaiPHYKo6c_HZvqjMgfcFLgWmvo45nbJ_5G4ShFBQnc

Fun fact: since the various ID fields and the public key's length prefix are nine bytes all together, a multiple of three, the base64url-encoded public key appears verbatim in the base64url-encoded HpkeConfig message.

@divergentdave divergentdave requested a review from a team as a code owner March 20, 2023 20:54
@divergentdave divergentdave merged commit 3b9e89e into main Mar 21, 2023
6 checks passed
@divergentdave divergentdave deleted the david/keygen-tool branch March 21, 2023 16:28
@divergentdave divergentdave mentioned this pull request Apr 6, 2023
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.

None yet

2 participants