by megawatthours · 9y ago · 0 comments
That is incorrect. Knowing the hash does not mean you know the contents of the file. You should generate encryption keys randomly, preferably using a secure random method such as that shipped with SJCL, rather than JavaScript's random API.
Random strings and numbers are also securely generated through a CSRPNG with window.crypto.getRandomValues().