Permalink
Browse files
Explain why we don't use randomBytes on a comment
- Loading branch information...
Showing
with
3 additions
and
0 deletions.
-
+3
−0
src/main-process/atom-application.js
|
|
@@ -92,6 +92,9 @@ const encryptOptions = (options, secret) => { |
|
|
|
|
|
|
|
// Even if the following IV is not cryptographically secure, there's a really good chance |
|
|
|
// it's going to be unique between executions which is the requirement for GCM. |
|
|
|
// We're not using `crypto.randomBytes()` because in electron v2, that API is really slow |
|
|
|
// on Windows machines, which affects the startup time of Atom. |
|
|
|
// TodoElectronIssue: Once we upgrade to electron v3 we can use `crypto.randomBytes()` |
|
|
|
const initVectorHash = crypto.createHash('sha1') |
|
|
|
initVectorHash.update(Date.now() + '') |
|
|
|
initVectorHash.update(Math.random() + '') |
|
|
|
0 comments on commit
84915c4