asmcrypto / asmcrypto.js

JavaScript Cryptographic Library with performance in mind.
MIT License
661 stars 182 forks source link

Do not crash when running in node.js #105

Closed swansontec closed 7 years ago

swansontec commented 8 years ago

The node.js environment has no concept of a document origin. Therefore, the secure-origin test crashes on an undefined variable. If we see this case, we can assume the origin is secure.

This is maybe a better way to solve vibornoff/asmcrypto.js#100

YuryStrozhevsky commented 7 years ago

Could you, please, pay attention on this PR? Seems it is needed for my project as well.

vibornoff commented 7 years ago

Could you please provide a suitable replacement for weak seeding function too? It uses global.location.href as a salt value at a seed hardening step.

YuryStrozhevsky commented 7 years ago

In fact you could approve the PR and plus introduce the same check into weak seeding function. Instead of location.href you could generate any fake string for the seed (just a proposal).