Skip to content
Permalink
Browse files

Explain why we don't use randomBytes on a comment

  • Loading branch information...
rafeca committed May 2, 2019
1 parent 966f002 commit 84915c40d1332978818212cea0cbb7f1b409142d
Showing with 3 additions and 0 deletions.
  1. +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

Please sign in to comment.
You can’t perform that action at this time.