ed25519_enc
Version:
A Rust and Node.js library that facilitates secure encryption and decryption by converting Ed25519 keys to X25519 keys. It utilizes elliptic-curve Diffie-Hellman (ECDH) to derive a shared secret, which is then used for symmetric encryption with AES-256-GC
11 lines (10 loc) • 752 B
text/typescript
declare module "./load.cjs" {
function to_x25519_priv(ed25519_priv: Uint8Array): Uint8Array;
function to_x25519_pub(ed25519_pub: Uint8Array): Uint8Array;
function encrypt(sender_priv: Uint8Array, receiver_pub: Uint8Array, data: Uint8Array): Uint8Array;
function decrypt(receiver_priv: Uint8Array, sender_pub: Uint8Array, data: Uint8Array): Uint8Array;
}
export declare function to_x25519_priv(ed25519_priv: Uint8Array): Uint8Array;
export declare function to_x25519_pub(ed25519_pub: Uint8Array): Uint8Array;
export declare function encrypt(sender_priv: Uint8Array, receiver_pub: Uint8Array, data: Uint8Array): Uint8Array;
export declare function decrypt(receiver_priv: Uint8Array, sender_pub: Uint8Array, data: Uint8Array): Uint8Array;