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

QUESTION: Doubt about Rxdb web crypto #6732

Open
danilobassi8 opened this issue Jan 5, 2025 · 3 comments
Open

QUESTION: Doubt about Rxdb web crypto #6732

danilobassi8 opened this issue Jan 5, 2025 · 3 comments

Comments

@danilobassi8
Copy link

Hi, we are developing a high security app with Ionic, and I was exploring solutions for our local-offline first database storage when I found this library.
I really liked it and suggested using it in our company, but our team had some doubts about the crypto storage.
Our app will utilize encryption, and we want to use encryption-web-crypto since crypto-js has some known vulnerabilities that we would like to avoid.

Is there a white paper on how the encryption is implemented?
We'll like to audit the code somehow, to see if its provide the security level we need. We understand that this specific sub-library is private to be able to monetize it, but it might affect the core of our app.

Thanks in advance.

@pubkey
Copy link
Owner

pubkey commented Jan 6, 2025

The encryption of encryption-web-crypto is using the browsers encryption API. This is implemented by the browser vendor, like the chromium team. Like somehwere here: https://chromium.googlesource.com/chromium/src/+/refs/heads/main/crypto/

So you could audit the code of the browsers themself, but this is not RxDB specific.

@danilobassi8
Copy link
Author

We understood. But even if you're using browser libs you could be using it wrong. eg:

window.myKey = await window.crypto.subtle.generateKey(
  {
    name: 'AES-GCM',
    length: 256,
  },
  true, // extractable
  ['encrypt', 'decrypt'],
);

// ... and then use window.myKey to all other crypto operations.
// key will be saved in RAM and exposed in the window element. (wont be garbage collected)

This is an absurd example, but it's a demonstration of what are we trying to check.
If we buy the licence, will we be able to inspect the code, or is it minimized / "uglified"?

Sorry if this channel is not the best place to be discussing this, we can continue wherever you want.

Thanks in advance!

@pubkey
Copy link
Owner

pubkey commented Jan 6, 2025

Ah, I missunderstood your first question.
Yes the code of the premium plugins is delivered minified by default.
There is the additional option to purchase source code access for +60% in price with which you could review the code.
If you fill out the premium buy-now form, I can send you the price and you can preview the license agreement.

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

No branches or pull requests

2 participants