Skip to content

Instantly share code, notes, and snippets.

@Zeemzo
Last active November 22, 2022 12:19
Show Gist options
  • Save Zeemzo/a8ccc6b316c590998dbd7a13bd499a19 to your computer and use it in GitHub Desktop.
Save Zeemzo/a8ccc6b316c590998dbd7a13bd499a19 to your computer and use it in GitHub Desktop.
Niftron-SDK Asymmetric Encryption
import { NiftronConfig, NIFTRON, NiftronKeypair } from "niftron-sdk";
-------------------- Niftron-SDK Configuration --------------------------
-------------------- Niftron-SDK Create Keypairs ------------------------
// Alice's End
// Message to be sent
const message = "Hello Bob!";
// create a pocket of encrypted data from Alice to Bob
const encryptedPocket = asymmetricEncryption.encrypt(
message,
keypairBob.publicKey(),
keypairAlice.secret()
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment