-
Notifications
You must be signed in to change notification settings - Fork 0
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
Support session packet decryption #1
Comments
I would like to implement support for Nitrokey Webcrypt inside OpenPGP.js as a POC, so the key management and private key operations could be realized on the USB stick, instead of the PC. See ticket's description for more information. In the past conversation there was a request for a session key decryption operation. Can you suggest how this could be done given OpenPGP.js current internals? The way its done in the OpenPGP card specification is, that only the shared secret is calculated from the given ECC session public key of the sender. This should be enough to continue with the process on the OpenPGP.js side. Then this would be a function of a public key and algorithm OID, which could be injected inside the current session key decryption process. Relevant excerpt: PS We plan to introduce RSA after we have ECC support working. |
Hey 👋 Just to confirm, the USB key only performs (in the case of ECC) the ECDH key derivation (i.e. the equivalent of this line of code), not the KDF and key unwrapping done afterwards, correct? (Or can it also do the latter? If so, it would simplify things, and you can ignore most of this comment :)) OpenPGP.js does not export those low-level operations, however, if you're making a fork you do of course have access to them. Or, you could simply replace the linked line with one that calls out to the USB key to do the key derivation. That would make it a bit difficult to merge back the functionality into OpenPGP.js, though, if we want to do so at some point. But, one way I could see that might be feasible would be to add a function / hook to the await openpgp.decrypt({ // or decryptSessionKeys
message,
decryptionKeys,
config: { deriveSharedKey }
});
async function deriveSharedKey(fingerprint, oid, publicEphemeral) {
// Call out to the USB key...
return sharedKey;
} Where And One slightly annoying thing (if my understanding above is correct) is that the KDF and AES-KW operations are specific to ECDH, RSA doesn't do them. So we'd need separate helper functions for RSA and ECC. But maybe that's livable / just the way it is. |
Indeed - what Daniel describes is a more specific proposal of what I hinted at here #8 |
Hey! Thank you for the pointers and sorry for being silent for the last weeks! I have published a potential plugin solution at openpgpjs#1567. Please take a look. |
Support session packet decryption through Nitrokey Webcrypt.
Previous discussions:
See below for the details:
The text was updated successfully, but these errors were encountered: