Last active
November 22, 2022 12:19
-
-
Save Zeemzo/a8ccc6b316c590998dbd7a13bd499a19 to your computer and use it in GitHub Desktop.
Niftron-SDK Asymmetric Encryption
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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