Replies: 2 comments
-
const _sodium = require('libsodium-wrappers');
(async () => {
await _sodium.ready;
const sodium = _sodium;
const kp = sodium.crypto_sign_keypair();
let st = sodium.crypto_generichash_init(null, 64);
sodium.crypto_generichash_update(st, sodium.from_string("Hello "));
sodium.crypto_generichash_update(st, sodium.from_string("world!"));
let h = sodium.crypto_generichash_final(st, 64);
const sig = sodium.crypto_sign_detached(h, kp.privateKey);
console.log(sodium.to_hex(sig));
})(); |
Beta Was this translation helpful? Give feedback.
0 replies
-
I've never used libsodium with Python, but it should be similar. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The docs say:
Beta Was this translation helpful? Give feedback.
All reactions