cross-crypto-ts
Version:
Cifrado híbrido AES-GCM + RSA-OAEP con interoperabilidad entre TypeScript y Python, con diseño compatible para Rust.
66 lines • 1.64 kB
TypeScript
export type OaepHash = "sha1" | "sha256";
export type AAD = string | Uint8Array | Record<string, unknown>;
export type StreamContentMode = "binary" | "json" | "v8";
export type EncryptHybridOptions = {
oaepHash?: OaepHash;
aad?: AAD;
outputPath?: string;
contentMode?: StreamContentMode;
streamChunkSize?: number;
};
export type DecryptHybridOptions = {
oaepHash?: OaepHash;
aad?: AAD;
returnBytes?: boolean;
};
export type EncryptedPayload = JsonEncrypted | StreamEncrypted;
export interface RSAKeyPair {
publicKey: string;
privateKey: string;
}
export interface Ed25519KeyPair {
publicKey: string;
privateKey: string;
}
export type SignaturePayload = {
alg: "Ed25519";
keyId: string;
signedAt: number;
payloadHash: string;
signature: string;
};
export type JsonEncrypted = {
encryptedKey: string;
encryptedData: string;
nonce: string;
tag: string;
mode: "json" | "binary" | "v8";
aad?: "present" | "none";
oaepHash?: OaepHash;
};
export type StreamEncrypted = {
encryptedKey: string;
nonce: string;
tag: string;
encryptedPath: string;
mode: "stream";
contentMode?: StreamContentMode;
streamFormat?: "envelope";
aad?: "present" | "none";
oaepHash?: OaepHash;
};
export type EncryptFileOptions = {
outputEnc?: string;
zipOutput?: string;
attachMetadata?: boolean;
saveFile?: boolean;
oaepHash?: OaepHash;
aad?: AAD;
useStream?: boolean;
streamChunkSize?: number;
};
export type DecryptFileOptions = {
oaepHash?: OaepHash;
aad?: AAD;
};
//# sourceMappingURL=types.d.ts.map