solcrypt
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

solcrypt

simple library for e2e encryption/decryption with solana type keys.

quickstart

import {
    encryptMessage,
    decryptMessage,
    encodeText,
    decodeText,
} from "solcrypt";
import { Keypair } from "@solana/web3.js";

const aliceKeys = Keypair.generate();
const bobKeys = Keypair.generate();

const msg = encodeText("gm");

const encrypted = encryptMessage(msg, bobKeys.publicKey, aliceKeys);
const decrypted = decryptMessage(encrypted, aliceKeys.publicKey, bobKeys);

const decoded = decodeText(decrypted);

console.log(decoded);

See the documentation for further details.

Readme

Keywords

none

Package Sidebar

Install

npm i solcrypt

Weekly Downloads

0

Version

0.2.0

License

MIT

Unpacked Size

76.5 kB

Total Files

9

Last publish

Collaborators

  • extrahash