keybase / triplesec

Triple Security for the browser and Node.js
https://keybase.io/triplesec
MIT License
399 stars 48 forks source link

Uncaught TypeError: b.readUInt32BE is not a function #67

Closed chmac closed 5 years ago

chmac commented 5 years ago

In my create-react-app project I'm seeing the following error:

triplesec.js:6497 Uncaught TypeError: b.readUInt32BE is not a function
    at Function.WordArray.from_buffer (triplesec.js:6497)
    at triplesec.js:2393
    at Deferrals._call (triplesec.js:7827)
    at triplesec.js:7837
    at trampoline (triplesec.js:7804)
    at Deferrals._fulfill (triplesec.js:7835)
    at ret (triplesec.js:7767)
    at triplesec.js:2266
    at _while (triplesec.js:2236)
    at triplesec.js:2229
    at run (setImmediate.js:48)
    at runIfPresent (setImmediate.js:83)
    at onGlobalMessage (setImmediate.js:125)

I've tried both of these:

import { Encryptor, Decryptor } from "triplesec/browser/triplesec";

and

import { Encryptor, Decryptor } from "triplesec";

In both cases, I get the same error (albeit at different file positions).

Perhaps I'm loading triplesec in the wrong way for the browser?

chmac commented 5 years ago

My mistake. I didn't see the lower parts of this page so I missed the examples and I wasn't using triplesec.Buffer. Looks like I figured it out.

Thanks for this project btw, it's great to have a simple, secure encryption library in js.