-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
Let's recall our current stack:
ferveo: Core cryptographic implementation (Rust -> WASM)nucypher-core: Protocol API and objects (Rust -> WASM)taco-web: Adopter-facing API (TypeScript)
The scope of this issue is to investigate to what extent we can build a minimal substitution for ferveo and nucypher-core using purely TypeScript primitives. Since browser interactions are currently tied to the creator/encryption and consumer/decryption request steps, let’s investigate what happens underneath and what do we need to replace.
Encryption (taco/src/tdec.ts/encryptMessage()):
nucypher_core::encryptForDkg(data: Uint8Array, public_key: DkgPublicKey, conditions: Conditions)ferveo_tdec::api::encrypt(message, aad, public_key, rng):- BLS12-381 arithmetic
- ChaCha20Poly1305 encryption
- Rust-side serialization
nucypher_core::AccessControlPolicynucypher_core::ThresholdMessageKit
Decryption (taco/src/tdec.ts/retrieveAndDecrypt()):
nucypher_core::ThresholdDecryptionRequest.encrypt()EncryptedThresholdDecryptionRequestencrypt_with_shared_secret- ChaCha20Poly1305 encryption
SessionStaticSecret.new()crate::secret_box::kdf(HKDF)
.derive_shared_secret()x25519_dalek::{PublicKey, SharedSecret, StaticSecret}
EncryptedThresholdDecryptionRequestencrypt_with_shared_secretdecrypt_with_shared_secret
ThresholdMessageKit- .
decryptWithSharedSecret()ferveo::api::decrypt_with_shared_secret- SecretBox
- Chacha20Poly1305
- .
ferveo::binding_wasm::combine_decryption_shares_simpleferveo::api::combine_shares_simple- BLS12-381 arithmetic
After this preliminary analysis, we can see that we currently depend on these external primitives:
- BLS12-381 arithmetic
- ChaCha20Poly1305 encryption
- HKDF
x25519_dalek- SecretBox
- Rust-side serialization
A cursory search I can see several 3rd party libraries that can help us with this process, but we need a more in-depth investigation.
- BLS12-381 and x25519 pure TS/JS implementation:
https://github.com/paulmillr/noble-curves/blob/94d00668f19ea38a6956cc0afe1051038b764fcb/README.md?plain=1#L46 - ChaCha20Poly1305 implementation:
https://github.com/paulmillr/noble-ciphers - HKDF: https://github.com/panva/hkdf
Metadata
Metadata
Assignees
Labels
No labels