Stream: general

Topic: Stable crypto library which can be converted to wasm


view this post on Zulip celine santosh (Mar 11 2025 at 14:38):

Can anyone give me suggestions on a stable crypto library that can be converted to wasm so that I can dynamically link into my framework I am building.

Thanks

view this post on Zulip Frank Denis (Mar 11 2025 at 19:26):

Libsodium supports WebAssembly since 2017, and is widely used in production, including in JavaScript applications.

view this post on Zulip Frank Denis (Mar 11 2025 at 19:27):

Check out https://github.com/jedisct1/libsodium.js

libsodium compiled to Webassembly and pure JavaScript, with convenient wrappers. - jedisct1/libsodium.js

view this post on Zulip Frank Denis (Mar 11 2025 at 19:27):

Also on NPM https://www.npmjs.com/package/libsodium-wrappers

The Sodium cryptographic library compiled to pure JavaScript (wrappers). Latest version: 0.7.15, last published: 7 months ago. Start using libsodium-wrappers in your project by running `npm i libsodium-wrappers`. There are 531 other projects in the npm registry using libsodium-wrappers.

view this post on Zulip Frank Denis (Mar 11 2025 at 19:30):

BoringSSL / OpenSSL have also been ported to WASI/WASIX but these are not well tested configurations.

view this post on Zulip Frank Denis (Mar 11 2025 at 19:31):

https://github.com/jedisct1/boringssl-wasm

BoringSSL for WebAssembly/WASI. Contribute to jedisct1/boringssl-wasm development by creating an account on GitHub.

view this post on Zulip Frank Denis (Mar 11 2025 at 19:31):

https://github.com/jedisct1/openssl-wasm

OpenSSL 3 compiled for WebAssembly/WASI (up-to-date, maintained) - jedisct1/openssl-wasm

view this post on Zulip Frank Denis (Mar 11 2025 at 19:33):

Even easier: if you're using Go or Zig, all the crypto functions from the standard library are going to work in WebAssembly without any changes.

view this post on Zulip Frank Denis (Mar 11 2025 at 19:33):

But don't expect any protection against side channels, and performance is not great, especially for symmetric crypto.

view this post on Zulip celine santosh (Mar 12 2025 at 16:32):

Thank you.


Last updated: Apr 09 2025 at 06:04 UTC