element-hq / element-hq/chatterbox
Use crypto.getRandomValues() instead of Math.random()
- Dominant language
- TypeScript
- Stars
- 181
- Forks
- 25
- PR merge metrics
- No merged PRs in 30d
Description
Using `Math.random()` here seems wrong given it's [not suited for cryptographic purposes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random)
https://github.com/vector-im/chatterbox/blob/3c8df045579bce9682bd03e44b0e86f6fbb6a8d6/src/random.ts#L17-L29
I haven't looked into it very deeply, but it seems to me this is actually used for stuff that should use cryptographically strong random values
https://github.com/vector-im/chatterbox/blob/3c8df045579bce9682bd03e44b0e86f6fbb6a8d6/src/viewmodels/AccountSetupViewModel.ts#L40-L62
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.