Appearance
Encryption using SDK
To encrypt a string, you can use the encrypt
function from the skc-trade-sdk
. Here is an example of how to do it:
javascript
import { encrypt } from "skc-trade-sdk";
const encryptedMessage = await encrypt(
"This is a secret message",
"0xCounterPartyPublicKey"
);
In this example, the encrypt
function takes two parameters:
plainText
: The string you want to encrypt.counterPartyPubKey
: The public key of the counterparty.
This will encrypt the plaintext message using the public key provided.