/**
 * remote/crypto — end-to-end encryption for relayed remote-control.
 *
 * When a session is relayed (T2), the relay forwards frames between the PC
 * and the phone but MUST NOT be able to read them — it is a zero-knowledge
 * rendezvous point. This module gives the two endpoints a shared symmetric
 * key they derive WITHOUT the relay ever seeing it:
 *
 *   1. Each side generates an ephemeral X25519 keypair (per session).
 *   2. Public keys are exchanged through the relay (public — safe to relay).
 *   3. Each side does X25519 ECDH → the same shared secret.
 *   4. HKDF-SHA256, salted by the sessionId, → a 32-byte AES-256-GCM key.
 *   5. Every frame is sealed with AES-256-GCM (random IV + auth tag).
 *
 * The relay sees only ciphertext. Forward-secret per session (ephemeral keys).
 * Zero new dependencies — Node's built-in `crypto` covers X25519, HKDF, GCM.
 *
 * @public @since 2.12.0 — preste remote-control T2
 */
import { type KeyObject } from "node:crypto";
/** An ephemeral X25519 keypair for one relayed session. */
export interface SessionKeyPair {
    privateKey: KeyObject;
    /** DER (SPKI) public key, base64 — safe to put in a QR / send via the relay. */
    publicKeyB64: string;
}
/**
 * Generate an ephemeral X25519 keypair. Call once per relayed session, on
 * each endpoint. The private key never leaves the process.
 */
export declare function generateSessionKeyPair(): SessionKeyPair;
/** Re-import a base64 DER (SPKI) X25519 public key sent by the peer. */
export declare function importPublicKey(publicKeyB64: string): KeyObject;
/** Re-import a base64 DER (PKCS8) X25519 private key (test/persistence use). */
export declare function importPrivateKey(privateKeyB64: string): KeyObject;
/**
 * Derive the shared AES-256-GCM key from this side's private key and the
 * peer's public key. Both endpoints, given matching keys + the same
 * `sessionId`, derive the IDENTICAL 32-byte key. The relay cannot — it never
 * holds a private key.
 */
export declare function deriveSharedKey(myPrivate: KeyObject, peerPublicKeyB64: string, sessionId: string): Buffer;
/**
 * Seal a plaintext string into a relay frame.
 *
 * Frame layout (base64 of): `IV(12) || ciphertext || authTag(16)`.
 * A fresh random IV per call — never reused under the same key.
 */
export declare function seal(key: Buffer, plaintext: string): string;
/**
 * Open a relay frame back to plaintext.
 *
 * @throws when the frame is malformed OR the auth tag does not verify — a
 *         tampered or relay-injected frame is rejected, never returned.
 */
export declare function open(key: Buffer, frameB64: string): string;
//# sourceMappingURL=crypto.d.ts.map