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

Task: Key resolution in Rust #6956

Open
5 of 6 tasks
charlag opened this issue May 17, 2024 · 0 comments · May be fixed by #7069
Open
5 of 6 tasks

Task: Key resolution in Rust #6956

charlag opened this issue May 17, 2024 · 0 comments · May be fixed by #7069

Comments

@charlag
Copy link
Contributor

charlag commented May 17, 2024

In order to access encrypted fields of entities we need to be able to decrypt session keys of entities.

AC

  • SDK has internal ability to resolve (decrypt) session keys of entities
  • SDK caches group keys in memory

Tasks

  • Add CryptoFacade which can resolve session keys given entity type and entity data
  • Stub KeyLoaderFacade to be able to get group keys
  • Implement _ownerEncSessionKey case (symmetric encryption using group keys)
  • Implement resolving session key with bucket key (w/o authentication for now)
    • (this includes Tuta Crypt protocol)
  • Depends on Task: Implement KeyLoaderFacade #7071
outdated * SDK has a method to initialize encryption layer * it is initialized using access token + session encrypted password

Notes

  • Look as existing CryptoFacade. We might need to design something similar.
  • Try to avoid global state/invalid state. You should only get access to encryption layer after completing initialization.
 impl Sdk {

 // ..

 // not an actual signature but the idea is that you get a handle to it only after you init session
   async fn init_encryption(
       &self,
       base_sdk_layer: BaseSdk,
       access_token: &str,
       encrypted_password: Vec<u8>
   ) -> Result<EncryptionSdk, SessionError>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants