Comments (3)
This is not only a problem for us. The web worker does not have access to the window.crypto
Problem description:
jedisct1/libsodium.js#46
http://stackoverflow.com/questions/13004375/running-window-crypto-getrandomvalues-from-inside-a-web-worker
bitwiseshiftleft/sjcl#91
https://lists.w3.org/Archives/Public/public-webcrypto-comments/2013Jul/0012.html
possible solutions:
https://github.com/snowblindroan/sjcl-webworker-instructive
https://github.com/ekodo/libsodium-worker-test
from lisk-elements.
This is still affected. Error:
No secure random number generator found app.js:25281
Which is related to
try {
var crypto = require("crypto"),
randomValueNodeJS = (function() {
var buf = crypto.randomBytes(4);
return (buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3]) >>> 0
});
randomValueNodeJS();
Module.getRandomValue = randomValueNodeJS
} catch (e) {
throw "No secure random number generator found"
}
I am looking into this
from lisk-elements.
The problem is that webworkers do not have access to the dom, where window.crypto is accessible. lisk-js uses the cryptographic functions from the window.crypto.getRandomValues function. There is currently no way to use window.crypto within a webworker or pass it to the webworker. As discussed here:
http://stackoverflow.com/questions/13004375/running-window-crypto-getrandomvalues-from-inside-a-web-worker
https://wpdev.uservoice.com/forums/257854-microsoft-edge-developer/suggestions/13904769-support-web-crypto-api-inside-a-web-worker
https://lists.w3.org/Archives/Public/public-webcrypto-comments/2013Jul/0011.html
The solution I could think of is using the lisk-js functions before the webworker, then pass in the necessary information to the webworker and let it do its job. Note that only cryptographic functions are not available in the webworker, but it makes whole lisk-js fail at this point.
We hope that webworker get an equivalent window.crypto soon (edited)
from lisk-elements.
Related Issues (20)
- PeerPool should not respond to get peers list
- Update existsInTransactionPool function parameters and use id instead of transaction object
- Multi-signature registration transaction without signatures should have status pending
- PeekUntil and DequeueUntil does not return transactions in the correct order
- Store blockchain specific properties in transaction instances
- getBytes function should take the first 8 bytes for recipientID if it exceeds uint8 size.
- The P2PPeerSelectionForSendRequest function should receive the current message/request packet as an argument
- Vote transaction should not throw an error if recipientPublicKey is not preset
- Non required properties for transactions should be allowed to be null/undefined
- TransactionError in case of exceeding votes for VoteTransaction has invalid parameters
- Socket protocol error when trying to make outbound connections HOT 1
- applyNodeInfo is not adding custom fields anymore
- Transaction validate incorrectly throws error from assetToBytes
- Deduct amount from sender account in case of vote transaction if it is non zero
- OutTransfer transaction should not fail if transaction with id provided in property "transactionId" already exists in the database
- Recipient account should be created in case it does not exist for OutTransfer transaction
- Recipient account should be created in case it does not exist for OutTransfer transaction HOT 1
- Fix the invalid filter for fetching dapp account in InTransfer Transaction
- Remove constraint of generation of outTransfer transaction from dapp owner accounts
- Remove constraint of generation of outTransfer transaction from dapp owner accounts HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lisk-elements.