subdavis / Tusk

🐘 🔒 KeePass-compatible browser extension for filling passwords.
https://subdavis.com/Tusk
Other
479 stars 74 forks source link

Failed to execute 'getRandomValues' on 'Crypto': The ArrayBufferView's byte length (1910365) exceeds the number of bytes of entropy available via this API (65536). #186

Closed JonAnder83 closed 6 years ago

JonAnder83 commented 6 years ago

This issue is a

Please describe the current behavior, and explain why it's bad.

Failed to execute 'getRandomValues' on 'Crypto': The ArrayBufferView's byte length (1910365) exceeds the number of bytes of entropy available via this API (65536).

Please describe how you think it should change.

I get this error trying to unlock my database.

Anything else?

Well, I recently changed my database´s settings and are as follow: Encryption algorithm: AES 256 bit. Key Derivation Function: Argon2, Transform Rounds: 29, Memory Usage: 64Mb, Parallelism: 8 threads.

It's hosted on Google drive. I open it with KeepassXC and Keepass on windows. Tusk fails to open on either windows and linux. It also does work on Android with Keepass2Android

Happy to help solve this :)

subdavis commented 6 years ago

Wow, that's a lot of bytes. I'll take a look and let you know if I have questions. Thanks!

zmilonas commented 6 years ago

Wow. I thought it's something with the kdbx4 support but i got my test kdbx4 database with the same settings as You open in Tusk although it took around 15 seconds to decrypt.

How many entries do you have? I have only two in the test database maybe that's why I can't reproduce.

JonAnder83 commented 6 years ago

Yeah, it was the version 4 format, I went back to version 3.x and it is working again. I have around a hundred entries in the database. Let me know if you need more info

JonAnder83 commented 6 years ago

How's it going? Need any testing?

subdavis commented 6 years ago

Progress is going to be slow on my end for a while. Lot of other stuff going on right now. Looks like the WASM argon2 module may need to be rewritten, which won't be a small task.

I'm not confident that an efficient argon2 implementation can be made for the web, but it may be a bit soon to make that call.

subdavis commented 6 years ago

Had the chance to dig into this a bit - it was a head scratcher, until I decided to add some large (>1MB) attachments to my keepass database and I was immediately able to reproduce.

Because of the way protected items are "salted" in memory, there's a bug in kdbxweb that comes from https://github.com/keeweb/kdbxweb/blob/a4d58631f2c98667e0de2f46915db2dd79bddd07/lib/crypto/protected-value.js#L45

I'll patch it over there and have Tusk fixed soonish. Great catch!

JonAnder83 commented 6 years ago

Glad I helped! :)