UNPKG

@signumjs/crypto

Version:

Cryptographic functions for building Signum Network apps.

31 lines (30 loc) 1.38 kB
/** * Original work Copyright (c) 2018 PoC-Consortium * Modified work Copyright (c) 2019 Burst Apps Team * Modified work Copyright (c) 2024 Signum Network */ import { EncryptedData } from './typings/encryptedData'; import { EncryptedMessage } from './typings/encryptedMessage'; /** * Encrypts arbitrary data for P2P message/data exchange using asymmetric encryption * * @see {@link decryptData} * @param plaintext Data to be encrypted * @param recipientPublicKeyHex The recipients public key in hexadecimal format * @param senderPrivateKeyHex The senders private (agreement) key hexadecimal format * @return The encrypted Data * * @category en/decryption */ export declare function encryptData(plaintext: Uint8Array, recipientPublicKeyHex: string, senderPrivateKeyHex: string): Promise<EncryptedData>; /** * Encrypts arbitrary message (UTF-8 compatible) for P2P message/data exchange using asymmetric encryption * @see {@link decryptMessage} * @param plaintext Message to be encrypted * @param recipientPublicKeyHex The recipients public key hexadecimal format * @param senderPrivateKeyHex The senders private (agreement) key hexadecimal format * @return The encrypted Message * * @category en/decryption */ export declare function encryptMessage(plaintext: string, recipientPublicKeyHex: string, senderPrivateKeyHex: string): Promise<EncryptedMessage>;