libsodium.js | libsodium compiled to Webassembly and pure JavaScript, with convenient wrappers | Cryptography library
kandi X-RAY | libsodium.js Summary
kandi X-RAY | libsodium.js Summary
The sodium crypto library compiled to WebAssembly and pure JavaScript using Emscripten, with automatically generated wrappers to make it easy to use in web applications. The complete library weighs 188 KB (minified, gzipped, includes pure JS + WebAssembly versions) and can run in a web browser as well as server-side.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of libsodium.js
libsodium.js Key Features
libsodium.js Examples and Code Snippets
FROM elixir:1.10.1-alpine AS dev_img
# Environment
ENV MIX_ENV prod
ENV PORT 4000
ENV SSL_PORT 4001
# Install required system dependencies
RUN apk update; \
apk upgrade --no-cache; \
apk add --no-cache libsodium libsodium-dev nodejs
Community Discussions
Trending Discussions on libsodium.js
QUESTION
I've spent an embarrasing number of hours trying to get Libsodium.js to work.
See my fiddle demo (and code pasted below too).
I keep getting Error: wrong secret key for the given ciphertext
.
What I would prefer is to replicate this PHP example of function simpleEncrypt($message, $key)
into Libsodium.js.
But as a starter, I'd be happy even getting the basic sample from the Libsodium.js repo to work.
Any hints?
Here is the code (also shown in the working fiddle):
...ANSWER
Answered 2018-Aug-12 at 21:59This is what I do in https://emberclear.io :
implementation: https://gitlab.com/NullVoxPopuli/emberclear/blob/master/packages/frontend/src/utils/nacl/utils.ts#L48
Snippet of implementation (in typescript):
QUESTION
I am trying to use the libsodium.js library in an extension and so far have only tested in Chrome (currently version 71).
It works perfectly so far in a standard web page context, but when I try to load it in an extension, I get an error. Whether it's loaded as a script, or if I define a page in the manifest with it as the only script and make the script async (literally identical to how it is in the browser page):
...ANSWER
Answered 2018-Dec-17 at 20:30The answer this issue is that extensions have a much more strict content-security policy. They will not allow eval or eval like functions to execute. Apparently, in the webassembly of this library, there is at least one function like this hindering the promise from success.
The solution can be found here:https://developer.chrome.com/extensions/sandboxingEval
It does work sending the message back and forth and the iframe does have access to the library/resulting code from the promise.
I hope this helps someone else too and if this needs editing or clarification, please let me know.
QUESTION
I'm extensively using libsodium.js in a Vue.JS application I'm building. Libsodium.js isn't usable right away, it does some async loading.
Because I use this library in pretty much every .vue component, I need to delay the actual component loading in Vue until libsodium is fully loaded.
I'm imagining something like this:
...ANSWER
Answered 2018-Mar-25 at 19:38Restructure your code so that the Vue isn't created until sodium is ready.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install libsodium.js
browsers includes a single-file script that can be included in web pages. It contains code for commonly used functions.
browsers-sumo is a superset of the previous script, that contains all functions, including rarely used ones and undocumented ones.
modules includes commonly used functions, and is designed to be loaded as a module. libsodium-wrappers is the module your application should load, which will in turn automatically load libsodium as a dependency.
modules-sumo contains sumo variants of the previous modules.
libsodium-wrappers
libsodium-wrappers-sumo
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page