Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working in chrome #17

Closed
kulwinders opened this issue Feb 15, 2016 · 4 comments
Closed

Not working in chrome #17

kulwinders opened this issue Feb 15, 2016 · 4 comments

Comments

@kulwinders
Copy link

I was trying to use this modul in my angular based web app but keeps on getting

Uncaught (in promise) RangeError:
Trying to access beyond buffer length(…)
checkOffset @ bundle.js:7543
Buffer.readUInt32LE @ bundle.js:7566
Chacha20 @ bundle.js:
8225Cipher @ bundle.js:8089
createCipher @ bundle.js:8189
encrypt @ bundle.js:22238
incoming @ bundle.js:
21795handlers.bulkDocs @ bundle.js:21844

@gr2m
Copy link
Collaborator

gr2m commented Feb 19, 2016

@kulwinders can you provide more code of yours? Do you try to save attachments?

@gr2m
Copy link
Collaborator

gr2m commented Feb 19, 2016

nevermind, I run into the same issue here: #13 (comment)

@gr2m
Copy link
Collaborator

gr2m commented Feb 19, 2016

I don’t know much about crypto, but the problem comes from this line:

chacha.createCipher(key, nonce);

var nonce = crypto.randomBytes(12) is an empty array in Chrome, while it’s a buffer with .length === 12 in node.

Any ideas?

gr2m added a commit to gr2m/crypto-pouch that referenced this issue Feb 19, 2016
updated dependencies

fixes calvinmetcalf#17
@gr2m
Copy link
Collaborator

gr2m commented Feb 19, 2016

will be fixed with #18 – problem was outdated browserify version

gr2m added a commit to gr2m/crypto-pouch that referenced this issue Mar 16, 2016
updated dependencies

fixes calvinmetcalf#17
@garbados garbados closed this as completed Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants