UNPKG

@gorbchain-xyz/chaindecode

Version:

GorbchainSDK V1.3+ - Complete Solana development toolkit with advanced cryptography, messaging, and collaboration features. Build secure applications with blockchain, DeFi, and end-to-end encryption.

47 lines (46 loc) 1.56 kB
/** * Direct encryption between two parties * Uses public key cryptography for secure communication */ import { EncryptionResult, EncryptionOptions } from './types.js'; /** * Encrypt data for a specific recipient */ export declare function encryptDirect(data: string | Uint8Array, recipientPublicKey: string, senderPrivateKey: string | Uint8Array, options?: EncryptionOptions): Promise<EncryptionResult>; /** * Decrypt direct encrypted data */ export declare function decryptDirect(encryptionResult: EncryptionResult, recipientPrivateKey: string | Uint8Array): Promise<Uint8Array>; /** * Decrypt direct encrypted data and return as string */ export declare function decryptDirectString(encryptionResult: EncryptionResult, recipientPrivateKey: string | Uint8Array): Promise<string>; /** * Create a secure channel between two parties */ export declare class SecureChannel { private sharedSecret; private localPublicKey; private remotePublicKey; private messageCounter; constructor(localPrivateKey: string | Uint8Array, remotePublicKey: string); /** * Encrypt a message in the channel */ encryptMessage(message: string | Uint8Array): Promise<EncryptionResult>; /** * Decrypt a message in the channel */ decryptMessage(encryptionResult: EncryptionResult): Promise<{ message: Uint8Array; counter: number; }>; /** * Get channel info */ getChannelInfo(): { localPublicKey: string; remotePublicKey: string; messagesSent: number; }; }