Skip to content

Instantly share code, notes, and snippets.

@vikramacharya
Created September 10, 2022 16:37
Show Gist options
  • Save vikramacharya/eef1dc2a935e7c9e1f7f9f212c6834be to your computer and use it in GitHub Desktop.
Save vikramacharya/eef1dc2a935e7c9e1f7f9f212c6834be to your computer and use it in GitHub Desktop.
export const createKeyPair = async () => {
let {publicKey , privateKey} = sodium.crypto_sign_keypair();
const publicKey_base64 = sodium.to_base64(publicKey, base64_variants.ORIGINAL);
const privateKey_base64 = sodium.to_base64(privateKey, base64_variants.ORIGINAL);
return { publicKey : publicKey_base64, privateKey : privateKey_base64 };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment