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

Encryption is vulnerable #114

Open
cypherbits opened this issue Aug 20, 2021 · 5 comments
Open

Encryption is vulnerable #114

cypherbits opened this issue Aug 20, 2021 · 5 comments
Assignees

Comments

@cypherbits
Copy link
Contributor

We changed some time ago the message encryption to use the new, safer and faster AES GCM with libsodium.

But we are reusing the IV/Nonce for the same Key. AES GCM is vulnerable in this cases.
Nonces should be generated for each new message and stored with the message for decryption (a new DB column).

Exploiting this is not that easy, so we should review our threat model and decide or not to change it or maybe just put a warning on the readme...

@ghost
Copy link

ghost commented Aug 20, 2021

Got any references to the lines in the files?

@cypherbits
Copy link
Contributor Author

@zach83 don't understand your question. Everything we encrypt on this chat is done wrong.

@ghost
Copy link

ghost commented Aug 26, 2021

Right, so could you show me where on the file everything is getting encrypted?

@DanWin
Copy link
Owner

DanWin commented Aug 28, 2021

That is correct, thanks for pointing it out. Also the encryption in AES GCM with libsodium is not always available. If I for example enable the encryption on a raspberry pi, it will result in a fatal error, because the CPU doesn't provide hardware accelerated AES, which libsodium considers mandatory for security reasons. (see https://www.php.net/manual/en/function.sodium-crypto-aead-aes256gcm-is-available.php)
I'd suggest to switch to the more secure ChaCha20-Poly1305, which is also provided by libsodium and always available. Along with that, we can introduce a per message IV.

@DanWin DanWin self-assigned this Aug 28, 2021
@cypherbits
Copy link
Contributor Author

Should we support both, make a config value? hardware accelerated AES is a lot faster.

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