UNPKG

xypriss-security

Version:

Advanced High-Performance Security Framework. Military-grade encryption, post-quantum resilience, and fortified data structures.

120 lines 3.79 kB
/*************************************************************************** * XyPrissJS - Fast And Secure * * @author Nehonix * @license Nehonix OSL (NOSL) * * Copyright (c) 2025 Nehonix. All rights reserved. * * This License governs the use, modification, and distribution of software * provided by NEHONIX under its open source projects. * NEHONIX is committed to fostering collaborative innovation while strictly * protecting its intellectual property rights. * Violation of any term of this License will result in immediate termination of all granted rights * and may subject the violator to legal action. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, * AND NON-INFRINGEMENT. * IN NO EVENT SHALL NEHONIX BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, * OR CONSEQUENTIAL DAMAGES ARISING FROM THE USE OR INABILITY TO USE THE SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. * ***************************************************************************** */ /** * XyPrissJS Express Encryption Service * encryption/decryption service using XyPrissJS cryptographic utilities * * Features: * - AES-256-GCM encryption with authentication * - ChaCha20-Poly1305 fallback for quantum-safe encryption * - Proper key derivation using PBKDF2 * - Secure IV/nonce generation * - Constant-time operations * - Memory-safe operations with secure wiping */ /** * Encryption algorithm options */ export type EncryptionAlgorithm = "aes-256-gcm" | "chacha20-poly1305"; /** * Encryption options */ export interface EncryptionOptions { algorithm?: EncryptionAlgorithm; keyDerivationIterations?: number; additionalData?: string; quantumSafe?: boolean; } /** * Encrypted data package */ export interface EncryptedPackage { algorithm: EncryptionAlgorithm; iv: string; data: string; authTag: string; salt: string; timestamp: number; version: string; } /** * encryption service using XyPrissJS utilities */ export declare class EncryptionService { private static readonly VERSION; private static readonly DEFAULT_ITERATIONS; private static readonly KEY_LENGTH; private static readonly IV_LENGTH; private static readonly SALT_LENGTH; private static readonly AUTH_TAG_LENGTH; /** * Encrypt data using production-grade encryption */ static encrypt(data: any, key: string, options?: EncryptionOptions): Promise<string>; /** * Decrypt data using production-grade decryption */ static decrypt(encryptedData: string, key: string): Promise<any>; /** * Derive encryption key using PBKDF2 */ private static deriveKey; /** * Validate inputs for encryption */ private static validateInputs; /** * Validate encrypted package structure */ private static validatePackage; /** * Convert buffer to hex string */ private static bufferToHex; /** * Convert hex string to buffer */ private static hexToBuffer; /** * Secure memory wipe using XyPrissJS utilities */ private static secureWipe; /** * Generate a secure session key for temporary use */ static generateSessionKey(): string; /** * Verify the integrity of encrypted data without decrypting */ static verifyIntegrity(encryptedData: string): boolean; /** * Get encryption metadata without decrypting */ static getMetadata(encryptedData: string): { algorithm: EncryptionAlgorithm; timestamp: number; version: string; }; } //# sourceMappingURL=EncryptionService.d.ts.map