@hyperfrontend/cryptography
Advanced tools
+448
-75
| 'use strict'; | ||
| new TextEncoder(); | ||
| const UTF8_DECODER = new TextDecoder('utf8'); | ||
| /** | ||
| * Safe copies of Array built-in static methods. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/array | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Array = globalThis.Array; | ||
| /** | ||
| * (Safe copy) Determines whether the passed value is an Array. | ||
| */ | ||
| const isArray = _Array.isArray; | ||
| /** | ||
| * (Safe copy) Creates an array from an array-like or iterable object. | ||
| */ | ||
| const from = _Array.from; | ||
| /** | ||
| * Safe copies of Error built-ins via factory functions. | ||
| * | ||
| * Since constructors cannot be safely captured via Object.assign, this module | ||
| * provides factory functions that use Reflect.construct internally. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/error | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Error = globalThis.Error; | ||
| const _Reflect$4 = globalThis.Reflect; | ||
| /** | ||
| * (Safe copy) Creates a new Error using the captured Error constructor. | ||
| * Use this instead of `new Error()`. | ||
| * | ||
| * @param message - Optional error message. | ||
| * @param options - Optional error options. | ||
| * @returns A new Error instance. | ||
| */ | ||
| const createError = (message, options) => _Reflect$4.construct(_Error, [message, options]); | ||
| /** | ||
| * Safe copies of TypedArray and ArrayBuffer built-ins via factory functions. | ||
| * | ||
| * Provides safe references to Uint8Array, Int8Array, ArrayBuffer, DataView, etc. | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/typed-arrays | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _ArrayBuffer = globalThis.ArrayBuffer; | ||
| const _SharedArrayBuffer = globalThis.SharedArrayBuffer; | ||
| const _Uint8Array = globalThis.Uint8Array; | ||
| const _Uint8ClampedArray = globalThis.Uint8ClampedArray; | ||
| const _Uint16Array = globalThis.Uint16Array; | ||
| const _Uint32Array = globalThis.Uint32Array; | ||
| const _Int8Array = globalThis.Int8Array; | ||
| const _Int16Array = globalThis.Int16Array; | ||
| const _Int32Array = globalThis.Int32Array; | ||
| const _Float32Array = globalThis.Float32Array; | ||
| const _Float64Array = globalThis.Float64Array; | ||
| const _BigInt64Array = globalThis.BigInt64Array; | ||
| const _BigUint64Array = globalThis.BigUint64Array; | ||
| const _Reflect$3 = globalThis.Reflect; | ||
| function createUint8Array(arg, byteOffset, length) { | ||
| if (typeof arg === 'number') { | ||
| return _Reflect$3.construct(_Uint8Array, [arg]); | ||
| } | ||
| if (arg instanceof _ArrayBuffer || arg instanceof _SharedArrayBuffer) { | ||
| return _Reflect$3.construct(_Uint8Array, [arg, byteOffset, length]); | ||
| } | ||
| return _Reflect$3.construct(_Uint8Array, [arg]); | ||
| } | ||
| /** | ||
| * (Safe copy) Creates a new Uint8Array from an array-like or iterable object. | ||
| */ | ||
| _Uint8Array.from.bind(_Uint8Array); | ||
| /** | ||
| * (Safe copy) Creates a new Uint8Array from a variable number of arguments. | ||
| */ | ||
| _Uint8Array.of.bind(_Uint8Array); | ||
| /** | ||
| * (Safe copy) Creates a new Uint8ClampedArray from an array-like or iterable object. | ||
| */ | ||
| _Uint8ClampedArray.from.bind(_Uint8ClampedArray); | ||
| /** | ||
| * (Safe copy) Creates a new Uint8ClampedArray from a variable number of arguments. | ||
| */ | ||
| _Uint8ClampedArray.of.bind(_Uint8ClampedArray); | ||
| /** | ||
| * (Safe copy) Creates a new Uint16Array from an array-like or iterable object. | ||
| */ | ||
| _Uint16Array.from.bind(_Uint16Array); | ||
| /** | ||
| * (Safe copy) Creates a new Uint16Array from a variable number of arguments. | ||
| */ | ||
| _Uint16Array.of.bind(_Uint16Array); | ||
| /** | ||
| * (Safe copy) Creates a new Uint32Array from an array-like or iterable object. | ||
| */ | ||
| _Uint32Array.from.bind(_Uint32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Uint32Array from a variable number of arguments. | ||
| */ | ||
| _Uint32Array.of.bind(_Uint32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int8Array from an array-like or iterable object. | ||
| */ | ||
| _Int8Array.from.bind(_Int8Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int8Array from a variable number of arguments. | ||
| */ | ||
| _Int8Array.of.bind(_Int8Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int16Array from an array-like or iterable object. | ||
| */ | ||
| _Int16Array.from.bind(_Int16Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int16Array from a variable number of arguments. | ||
| */ | ||
| _Int16Array.of.bind(_Int16Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int32Array from an array-like or iterable object. | ||
| */ | ||
| _Int32Array.from.bind(_Int32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int32Array from a variable number of arguments. | ||
| */ | ||
| _Int32Array.of.bind(_Int32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Float32Array from an array-like or iterable object. | ||
| */ | ||
| _Float32Array.from.bind(_Float32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Float32Array from a variable number of arguments. | ||
| */ | ||
| _Float32Array.of.bind(_Float32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Float64Array from an array-like or iterable object. | ||
| */ | ||
| _Float64Array.from.bind(_Float64Array); | ||
| /** | ||
| * (Safe copy) Creates a new Float64Array from a variable number of arguments. | ||
| */ | ||
| _Float64Array.of.bind(_Float64Array); | ||
| /** | ||
| * (Safe copy) Creates a new BigInt64Array from an array-like or iterable object. | ||
| */ | ||
| _BigInt64Array.from.bind(_BigInt64Array); | ||
| /** | ||
| * (Safe copy) Creates a new BigInt64Array from a variable number of arguments. | ||
| */ | ||
| _BigInt64Array.of.bind(_BigInt64Array); | ||
| /** | ||
| * (Safe copy) Creates a new BigUint64Array from an array-like or iterable object. | ||
| */ | ||
| _BigUint64Array.from.bind(_BigUint64Array); | ||
| /** | ||
| * (Safe copy) Creates a new BigUint64Array from a variable number of arguments. | ||
| */ | ||
| _BigUint64Array.of.bind(_BigUint64Array); | ||
| /** | ||
| * Safe copies of encoding built-ins via factory functions. | ||
| * | ||
| * Provides safe references to TextEncoder, TextDecoder, atob, and btoa. | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/encoding | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _TextEncoder = globalThis.TextEncoder; | ||
| const _TextDecoder = globalThis.TextDecoder; | ||
| const _Reflect$2 = globalThis.Reflect; | ||
| /** | ||
| * (Safe copy) Creates a new TextEncoder using the captured TextEncoder constructor. | ||
| * Use this instead of `new TextEncoder()`. | ||
| * | ||
| * @returns A new TextEncoder instance. | ||
| */ | ||
| const createTextEncoder = () => _Reflect$2.construct(_TextEncoder, []); | ||
| /** | ||
| * (Safe copy) Creates a new TextDecoder using the captured TextDecoder constructor. | ||
| * Use this instead of `new TextDecoder()`. | ||
| * | ||
| * @param label - The encoding label (e.g., 'utf-8', 'utf-16'). Defaults to 'utf-8'. | ||
| * @param options - Optional TextDecoderOptions. | ||
| * @returns A new TextDecoder instance. | ||
| */ | ||
| const createTextDecoder = (label, options) => _Reflect$2.construct(_TextDecoder, [label, options]); | ||
| createTextEncoder(); | ||
| const UTF8_DECODER = createTextDecoder('utf8'); | ||
| ({ | ||
| SIMPLE: { | ||
| ARRAY: createUint8Array([104, 101, 108, 108, 111]), | ||
| }, | ||
| NON_ASCII: { | ||
| ARRAY: createUint8Array([ | ||
| 227, | ||
| 129, | ||
| 147, // こ | ||
| 227, | ||
| 130, | ||
| 147, // ん | ||
| 227, | ||
| 129, | ||
| 171, // に | ||
| 227, | ||
| 129, | ||
| 161, // ち | ||
| 227, | ||
| 129, | ||
| 175, // は | ||
| ]), | ||
| }, | ||
| EMPTY: { | ||
| ARRAY: createUint8Array([]), | ||
| }, | ||
| }); | ||
| /** | ||
| * Converts an ArrayBuffer to a UTF-8 encoded string. | ||
@@ -23,3 +245,3 @@ * | ||
| function utf8StringToUint8Array(text) { | ||
| return new TextEncoder().encode(text); | ||
| return createTextEncoder().encode(text); | ||
| } | ||
@@ -39,3 +261,3 @@ | ||
| try { | ||
| return Array.from(new Uint8Array(await subtle.digest(algorithm, utf8StringToUint8Array(data)))) | ||
| return from(createUint8Array(await subtle.digest(algorithm, utf8StringToUint8Array(data)))) | ||
| .map((b) => b.toString(16).padStart(2, '0')) | ||
@@ -45,3 +267,3 @@ .join(''); | ||
| catch { | ||
| throw new Error('Error creating hash'); | ||
| throw createError('Error creating hash'); | ||
| } | ||
@@ -51,14 +273,20 @@ } | ||
| /** | ||
| * Generates cryptographically secure random values using Web Crypto API (browser implementation). | ||
| * Safe copies of Object built-in methods. | ||
| * | ||
| * @param byteLength - The number of random bytes to generate | ||
| * @returns A Uint8Array containing the random bytes | ||
| * @throws {Error} When byteLength is not provided or is zero | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/object | ||
| */ | ||
| function getRandomValues(byteLength) { | ||
| if (!byteLength) { | ||
| throw new Error('Cannot generate random values without a byte length.'); | ||
| } | ||
| return globalThis.crypto.getRandomValues(new Uint8Array(byteLength)); | ||
| } | ||
| // Capture references at module initialization time | ||
| const _Object = globalThis.Object; | ||
| /** | ||
| * (Safe copy) Prevents modification of existing property attributes and values, | ||
| * and prevents the addition of new properties. | ||
| */ | ||
| const freeze = _Object.freeze; | ||
| /** | ||
| * (Safe copy) Creates an object that has the specified prototype or that has null prototype. | ||
| */ | ||
| const create = _Object.create; | ||
@@ -80,3 +308,3 @@ const registeredClasses = []; | ||
| if (nativeDataType === 'object') { | ||
| if (Array.isArray(target)) | ||
| if (isArray(target)) | ||
| return 'array'; | ||
@@ -91,5 +319,72 @@ for (const registeredClass of registeredClasses) { | ||
| const encryptionConfig = { | ||
| /** | ||
| * Safe copies of Map built-in via factory function. | ||
| * | ||
| * Since constructors cannot be safely captured via Object.assign, this module | ||
| * provides a factory function that uses Reflect.construct internally. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/map | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Map = globalThis.Map; | ||
| const _Reflect$1 = globalThis.Reflect; | ||
| /** | ||
| * (Safe copy) Creates a new Map using the captured Map constructor. | ||
| * Use this instead of `new Map()`. | ||
| * | ||
| * @param iterable - Optional iterable of key-value pairs. | ||
| * @returns A new Map instance. | ||
| */ | ||
| const createMap = (iterable) => _Reflect$1.construct(_Map, iterable ? [iterable] : []); | ||
| /** | ||
| * Safe copies of Date built-in via factory function and static methods. | ||
| * | ||
| * Since constructors cannot be safely captured via Object.assign, this module | ||
| * provides a factory function that uses Reflect.construct internally. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/date | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Date = globalThis.Date; | ||
| const _Reflect = globalThis.Reflect; | ||
| function createDate(...args) { | ||
| return _Reflect.construct(_Date, args); | ||
| } | ||
| /** | ||
| * Safe copies of Math built-in methods. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/math | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Math = globalThis.Math; | ||
| /** | ||
| * (Safe copy) Returns the largest integer less than or equal to a number. | ||
| */ | ||
| const floor = _Math.floor; | ||
| // ============================================================================ | ||
| // Trigonometry | ||
| // ============================================================================ | ||
| /** | ||
| * (Safe copy) Returns the sine of a number. | ||
| */ | ||
| const sin = _Math.sin; | ||
| /** | ||
| * Frozen encryption configuration to prevent runtime tampering. | ||
| * Using AES-GCM as the default algorithm for authenticated encryption. | ||
| */ | ||
| const encryptionConfig = freeze({ | ||
| name: 'AES-GCM', | ||
| }; | ||
| }); | ||
@@ -107,9 +402,9 @@ /** | ||
| if (getType(password) !== 'string') { | ||
| throw new Error('Cannot generate key without a password type string'); | ||
| throw createError('Cannot generate key without a password type string'); | ||
| } | ||
| if (password.length === 0) { | ||
| throw new Error('Cannot generate key with an empty string as password'); | ||
| throw createError('Cannot generate key with an empty string as password'); | ||
| } | ||
| if (!salt) { | ||
| throw new Error('Cannot generate key without a salt'); | ||
| throw createError('Cannot generate key without a salt'); | ||
| } | ||
@@ -132,2 +427,44 @@ const keyMaterial = await subtle.importKey('raw', utf8StringToUint8Array(password), { name: 'PBKDF2' }, false, [ | ||
| /** | ||
| * Creates a decryption function that decrypts AES-GCM encrypted messages using password-derived keys. | ||
| * Extracts salt and IV from the encrypted data to derive the correct decryption key. | ||
| * | ||
| * @param arrayBufferToUtf8String - Function to convert byte arrays to UTF-8 strings | ||
| * @param generateKey - Function to derive decryption keys from passwords | ||
| * @param subtle - The SubtleCrypto interface for cryptographic operations | ||
| * @returns A function that decrypts encrypted messages with passwords | ||
| */ | ||
| function createDecrypt(arrayBufferToUtf8String, generateKey, subtle) { | ||
| return async function decrypt(encrypted, password) { | ||
| if (!encrypted || !encrypted.length) { | ||
| throw createError('Cannot decrypt without a message'); | ||
| } | ||
| if (!password) { | ||
| throw createError('Cannot decrypt without a password'); | ||
| } | ||
| const salt = encrypted.slice(0, 16); | ||
| const iv = encrypted.slice(16, 28); | ||
| const data = encrypted.slice(28); | ||
| const key = await generateKey(password, salt); | ||
| const decryptedContent = await subtle.decrypt({ ...encryptionConfig, iv }, key, data); | ||
| return arrayBufferToUtf8String(decryptedContent); | ||
| }; | ||
| } | ||
| const decrypt = createDecrypt(arrayBufferToUtf8String, generateKey, subtle); | ||
| /** | ||
| * Generates cryptographically secure random values using Web Crypto API (browser implementation). | ||
| * | ||
| * @param byteLength - The number of random bytes to generate | ||
| * @returns A Uint8Array containing the random bytes | ||
| * @throws {Error} When byteLength is not provided or is zero | ||
| */ | ||
| function getRandomValues(byteLength) { | ||
| if (!byteLength) { | ||
| throw createError('Cannot generate random values without a byte length.'); | ||
| } | ||
| return globalThis.crypto.getRandomValues(createUint8Array(byteLength)); | ||
| } | ||
| /** | ||
| * Creates an encryption function that encrypts messages using AES-GCM with password-derived keys. | ||
@@ -145,6 +482,6 @@ * Generates random salt and initialization vector (IV) for each encryption operation. | ||
| if (!message) { | ||
| throw new Error('Cannot encrypt an empty message.'); | ||
| throw createError('Cannot encrypt an empty message.'); | ||
| } | ||
| if (!password) { | ||
| throw new Error('Cannot encrypt without a password.'); | ||
| throw createError('Cannot encrypt without a password.'); | ||
| } | ||
@@ -155,4 +492,4 @@ const salt = getRandomValues(16); | ||
| const encryptedContent = await subtle.encrypt({ ...encryptionConfig, iv: iv }, key, utf8StringToUint8Array(message)); | ||
| const buffer = new Uint8Array(encryptedContent); | ||
| const result = new Uint8Array(salt.byteLength + iv.byteLength + buffer.byteLength); | ||
| const buffer = createUint8Array(encryptedContent); | ||
| const result = createUint8Array(salt.byteLength + iv.byteLength + buffer.byteLength); | ||
| result.set(salt, 0); | ||
@@ -168,30 +505,2 @@ result.set(iv, salt.byteLength); | ||
| /** | ||
| * Creates a decryption function that decrypts AES-GCM encrypted messages using password-derived keys. | ||
| * Extracts salt and IV from the encrypted data to derive the correct decryption key. | ||
| * | ||
| * @param arrayBufferToUtf8String - Function to convert byte arrays to UTF-8 strings | ||
| * @param generateKey - Function to derive decryption keys from passwords | ||
| * @param subtle - The SubtleCrypto interface for cryptographic operations | ||
| * @returns A function that decrypts encrypted messages with passwords | ||
| */ | ||
| function createDecrypt(arrayBufferToUtf8String, generateKey, subtle) { | ||
| return async function decrypt(encrypted, password) { | ||
| if (!encrypted || !encrypted.length) { | ||
| throw new Error('Cannot decrypt without a message'); | ||
| } | ||
| if (!password) { | ||
| throw new Error('Cannot decrypt without a password'); | ||
| } | ||
| const salt = encrypted.slice(0, 16); | ||
| const iv = encrypted.slice(16, 28); | ||
| const data = encrypted.slice(28); | ||
| const key = await generateKey(password, salt); | ||
| const decryptedContent = await subtle.decrypt({ ...encryptionConfig, iv }, key, data); | ||
| return arrayBufferToUtf8String(decryptedContent); | ||
| }; | ||
| } | ||
| const decrypt = createDecrypt(arrayBufferToUtf8String, generateKey, subtle); | ||
| /** | ||
| * Creates a vault factory function that produces encrypted storage instances. | ||
@@ -207,3 +516,3 @@ * Vaults provide secure, password-protected storage for sensitive data with optional single-use mode. | ||
| return function createVault(singleUse = false) { | ||
| let password = Array.from(getRandomValues(16)) | ||
| let password = from(getRandomValues(16)) | ||
| .map((b) => b.toString(16).padStart(2, '0')) | ||
@@ -213,3 +522,3 @@ .join(''); | ||
| let isVaultClosed = false; | ||
| let storage = new Map(); | ||
| let storage = createMap(); | ||
| /** | ||
@@ -225,9 +534,9 @@ * Writes an encrypted value to the vault with the specified label. | ||
| if (isVaultClosed) { | ||
| throw new Error('Vault is closed.'); | ||
| throw createError('Vault is closed.'); | ||
| } | ||
| if (!label) { | ||
| throw new Error('Label is required.'); | ||
| throw createError('Label is required.'); | ||
| } | ||
| if (!value) { | ||
| throw new Error('Value is required.'); | ||
| throw createError('Value is required.'); | ||
| } | ||
@@ -248,9 +557,9 @@ const encryptedValue = await encrypt(value, password); | ||
| if (isVaultClosed) { | ||
| throw new Error('Vault is closed.'); | ||
| throw createError('Vault is closed.'); | ||
| } | ||
| if (!label) { | ||
| throw new Error('Label is required.'); | ||
| throw createError('Label is required.'); | ||
| } | ||
| if (!password) { | ||
| throw new Error('Password is required.'); | ||
| throw createError('Password is required.'); | ||
| } | ||
@@ -276,3 +585,3 @@ const encryptedValue = storage.get(label); | ||
| if (isVaultClosed) { | ||
| throw new Error('Vault is closed.'); | ||
| throw createError('Vault is closed.'); | ||
| } | ||
@@ -295,3 +604,3 @@ if (isPasswordAccessed) { | ||
| } | ||
| const vault = Object.create(null, { | ||
| const vault = create(null, { | ||
| write: { | ||
@@ -322,3 +631,4 @@ value: write, | ||
| }); | ||
| return vault; | ||
| // Freeze to prevent addition of new properties | ||
| return freeze(vault); | ||
| }; | ||
@@ -336,4 +646,4 @@ } | ||
| function randomPseudo(seed) { | ||
| const x = Math.sin(seed) * 10000; | ||
| return x - Math.floor(x); | ||
| const x = sin(seed) * 10000; | ||
| return x - floor(x); | ||
| } | ||
@@ -352,2 +662,20 @@ | ||
| /** | ||
| * Safe copies of Number built-in methods and constants. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/number | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _isNaN = globalThis.isNaN; | ||
| // ============================================================================ | ||
| // Global Type Checking (legacy, less strict) | ||
| // ============================================================================ | ||
| /** | ||
| * (Safe copy) Global isNaN function (coerces to number first, less strict than Number.isNaN). | ||
| */ | ||
| const globalIsNaN = _isNaN; | ||
| /** | ||
| * Normalizes a given time to the nearest base time window. | ||
@@ -360,15 +688,59 @@ * | ||
| function normalizeToBaseTimeWindow(time, baseTimeWindow) { | ||
| if (!time || !(time instanceof Date) || isNaN(time.getTime())) { | ||
| throw new Error('Invalid time input'); | ||
| if (!time || !(time instanceof Date) || globalIsNaN(time.getTime())) { | ||
| throw createError('Invalid time input'); | ||
| } | ||
| if (baseTimeWindow <= 0) { | ||
| throw new Error('Base time window must be positive'); | ||
| throw createError('Base time window must be positive'); | ||
| } | ||
| const timeInMs = time.getTime(); | ||
| const windowInMs = baseTimeWindow * 60 * 1000; | ||
| const normalizedTimeInMs = Math.floor(timeInMs / windowInMs) * windowInMs; | ||
| return new Date(normalizedTimeInMs); | ||
| const normalizedTimeInMs = floor(timeInMs / windowInMs) * windowInMs; | ||
| return createDate(normalizedTimeInMs); | ||
| } | ||
| /** | ||
| * Safe copies of Promise built-in methods via factory functions. | ||
| * | ||
| * Since constructors cannot be safely captured via Object.assign, this module | ||
| * provides factory functions that use Reflect.construct internally. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/promise | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Promise = globalThis.Promise; | ||
| /** | ||
| * (Safe copy) Returns a Promise that resolves with the given value. | ||
| */ | ||
| _Promise.resolve.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Returns a Promise that rejects with the given reason. | ||
| */ | ||
| _Promise.reject.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Returns a Promise that resolves when all promises resolve. | ||
| */ | ||
| _Promise.all.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Returns a Promise that resolves/rejects with the first settled promise. | ||
| */ | ||
| _Promise.race.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Returns a Promise that resolves when all promises settle. | ||
| */ | ||
| _Promise.allSettled.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Returns a Promise that resolves with the first fulfilled promise. | ||
| */ | ||
| _Promise.any.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Creates a Promise along with its resolve and reject functions. | ||
| * Note: Available only in ES2024+ environments. | ||
| */ | ||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| _Promise.withResolvers?.bind(_Promise); | ||
| /** | ||
| * Creates a time-based one-time password (TOTP) generator function. | ||
@@ -383,5 +755,5 @@ * Generates passwords that change based on time windows, supporting previous/current/next window offsets. | ||
| if (getType(windowOffset) !== 'number' || windowOffset < -1 || 1 < windowOffset) { | ||
| throw new Error('Window offset must be -1, 0, or 1.'); | ||
| throw createError('Window offset must be -1, 0, or 1.'); | ||
| } | ||
| const offsetTime = new Date(currentUtcTime.getTime() + windowOffset * baseTimeWindow * 60000); | ||
| const offsetTime = createDate(currentUtcTime.getTime() + windowOffset * baseTimeWindow * 60000); | ||
| return await createHash(randomPseudoTimeBased(normalizeToBaseTimeWindow(offsetTime, baseTimeWindow)).toString()); | ||
@@ -404,3 +776,3 @@ }; | ||
| * Creates a factory function that generates time-based password generators for multiple time windows. | ||
| * Returns an object with methods to generate passwords for current, previous, and next time windows. | ||
| * Returns a frozen object with methods to generate passwords for current, previous, and next time windows. | ||
| * | ||
@@ -415,3 +787,4 @@ * @param getTimeBasedPassword - Function to generate a single time-based password with window offset | ||
| const next = () => getTimeBasedPassword(currentUtcTime, baseTimeWindow, 1); | ||
| return { current, previous, next }; | ||
| // Freeze to prevent runtime modification of password generator methods | ||
| return freeze({ current, previous, next }); | ||
| }; | ||
@@ -418,0 +791,0 @@ } |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.cjs.js","sources":["../../../../../../../../libs/utils/string/src/lib/shared-consts.ts","../../../../../../../../libs/utils/string/src/lib/array-buffer-to-utf8-string/array-buffer-to-utf8-string.ts","../../../../../../../../libs/utils/string/src/lib/utf8-string-to-uint8-array/browser/utf8-string-to-uint8-array.ts","../../../../../../../../libs/cryptography/src/lib/subtle/browser.ts","../../../../../../../../libs/cryptography/src/lib/create-hash/browser.ts","../../../../../../../../libs/cryptography/src/lib/get-random-values/browser.ts","../../../../../../../../libs/utils/data/src/shared/consts.ts","../../../../../../../../libs/utils/data/src/get-type.ts","../../../../../../../../libs/cryptography/src/lib/encryption-config.ts","../../../../../../../../libs/cryptography/src/lib/generate-key/create-key-generator.ts","../../../../../../../../libs/cryptography/src/lib/generate-key/browser.ts","../../../../../../../../libs/cryptography/src/lib/encrypt/create-encrypt.ts","../../../../../../../../libs/cryptography/src/lib/encrypt/browser.ts","../../../../../../../../libs/cryptography/src/lib/decrypt/create-decrypt.ts","../../../../../../../../libs/cryptography/src/lib/decrypt/browser.ts","../../../../../../../../libs/cryptography/src/lib/create-vault/create-value-creator.ts","../../../../../../../../libs/cryptography/src/lib/create-vault/browser.ts","../../../../../../../../libs/utils/random-generator/src/random-pseudo.ts","../../../../../../../../libs/utils/random-generator/src/random-pseudo-time-based.ts","../../../../../../../../libs/utils/time/src/normalize-to-base-time-window.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-password/create-get-time-based-password.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-password/browser.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/create-get-time-based-passwords.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/browser.ts","../../../../../../../../libs/cryptography/src/lib/is-sha-256-hash.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":[],"mappings":";;AAAuB,IAAI,WAAW;AAC/B,MAAM,YAAY,GAAG,IAAI,WAAW,CAAC,MAAM,CAAC;;ACCnD;;;;;AAKG;AACG,SAAU,uBAAuB,CAAC,UAAuB,EAAA;AAC7D,IAAA,OAAO,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC;AACxC;;ACVA;;;;;AAKG;AACG,SAAU,sBAAsB,CAAC,IAAY,EAAA;IACjD,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC;AACvC;;MCRa,MAAM,GAAiB,UAAU,CAAC,MAAM,CAAC;;ACItD;;;;;;;AAOG;AACI,eAAe,UAAU,CAAC,IAAY,EAAE,YAA2B,SAAS,EAAA;AACjF,IAAA,IAAI;QACF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,SAAS,EAAgB,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC;AACzG,aAAA,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;aAC1C,IAAI,CAAC,EAAE,CAAC;IACb;AAAE,IAAA,MAAM;AACN,QAAA,M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AAE,CAAC,CAAC;AAC1E,QAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE;AACpC,IAAA,CAAC;AACH;;ACfA;;;;;;;AAOG;MACU,qBAAqB,GAAG,wBAAwB,CAAC,oBAAoB;;ACTlF;;;;;;AAMG;AACG,SAAU,YAAY,CAAC,IAAa,EAAA;AACxC,IAAA,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,QAAQ,GAAG,iBAAiB,CAAC,IAAI,CAAS,IAAI,CAAC,GAAG,KAAK;AAClF;;;;;;;;;;;;;;"} | ||
| {"version":3,"file":"index.cjs.js","sources":["../../../../../../../../libs/utils/immutable-api/src/built-in-copy/array/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/error/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/typed-arrays/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/encoding/index.ts","../../../../../../../../libs/utils/string/src/lib/shared-consts.ts","../../../../../../../../libs/utils/string/src/lib/array-buffer-to-utf8-string/array-buffer-to-utf8-string.ts","../../../../../../../../libs/utils/string/src/lib/utf8-string-to-uint8-array/browser/utf8-string-to-uint8-array.ts","../../../../../../../../libs/cryptography/src/lib/subtle/browser.ts","../../../../../../../../libs/cryptography/src/lib/create-hash/browser.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/object/index.ts","../../../../../../../../libs/utils/data/src/shared/consts.ts","../../../../../../../../libs/utils/data/src/get-type.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/map/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/date/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/math/index.ts","../../../../../../../../libs/cryptography/src/lib/encryption-config.ts","../../../../../../../../libs/cryptography/src/lib/generate-key/create-key-generator.ts","../../../../../../../../libs/cryptography/src/lib/generate-key/browser.ts","../../../../../../../../libs/cryptography/src/lib/decrypt/create-decrypt.ts","../../../../../../../../libs/cryptography/src/lib/decrypt/browser.ts","../../../../../../../../libs/cryptography/src/lib/get-random-values/browser.ts","../../../../../../../../libs/cryptography/src/lib/encrypt/create-encrypt.ts","../../../../../../../../libs/cryptography/src/lib/encrypt/browser.ts","../../../../../../../../libs/cryptography/src/lib/create-vault/create-value-creator.ts","../../../../../../../../libs/cryptography/src/lib/create-vault/browser.ts","../../../../../../../../libs/utils/random-generator/src/random-pseudo.ts","../../../../../../../../libs/utils/random-generator/src/random-pseudo-time-based.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/number/index.ts","../../../../../../../../libs/utils/time/src/normalize-to-base-time-window.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/promise/index.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-password/create-get-time-based-password.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-password/browser.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/create-get-time-based-passwords.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/browser.ts","../../../../../../../../libs/cryptography/src/lib/is-sha-256-hash.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["_Reflect"],"mappings":";;AAAA;;;;;;;AAOG;AAEH;AACA,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK;AAG/B;;AAEG;AACI,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO;AAErC;;AAEG;AACI,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI;;ACrB/B;;;;;;;;;;AAUG;AAEH;AACA,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK;AAQ/B,MAAMA,UAAQ,GAAG,UAAU,CAAC,OAAO;AAGnC;;;;;;;AAOG;AACI,MAAM,WAAW,GAAG,CAAC,OAAgB,EAAE,OAAsB,KAAmBA,UAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;;AChCrI;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AY,GAAG,cAAc,GAAG,KAAK,CAAC;AAE/F,QAAA,OAAO,MAAM,UAAU,CAAC,qBAAqB,CAAC,yBAAyB,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;AAClH,IAAA,CAAC;AACH;;ACtBA;;;;;;;;AAQG;MACU,oBAAoB,GAAG,0BAA0B,CAAC,UAAU;;ACTzE;;;;;;AAMG;AACG,SAAU,wBAAwB,CACtC,oBAAkH,EAAA;AAElH,IAAA,OAAO,SAAS,qBAAqB,CAAC,cAAc,EAAE,cAAc,EAAA;AAClE,QAAA,MAAM,OAAO,GAAG,MAAM,oBAAoB,CAAC,cAAc,EAAE,cAAc,EAAE,CAAC,CAAC;AAC7E,QAAA,MAAM,QAAQ,GAAG,MAAM,oBAAoB,CAAC,cAAc,EAAE,cAAc,EAAE,EAAE,CAAC;AAC/E,QAAA,MAAM,IAAI,GAAG,MAAM,oBAAoB,CAAC,cAAc,EAAE,cAAc,EAAE,CAAC,CAAC;;QAE1E,OAAO,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC5C,IAAA,CAAC;AACH;;ACjBA;;;;;;;AAOG;MACU,qBAAqB,GAAG,wBAAwB,CAAC,oBAAoB;;ACTlF;;;;;;AAMG;AACG,SAAU,YAAY,CAAC,IAAa,EAAA;AACxC,IAAA,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,QAAQ,GAAG,iBAAiB,CAAC,IAAI,CAAS,IAAI,CAAC,GAAG,KAAK;AAClF;;;;;;;;;;;;;;"} |
+448
-75
@@ -1,5 +0,227 @@ | ||
| new TextEncoder(); | ||
| const UTF8_DECODER = new TextDecoder('utf8'); | ||
| /** | ||
| * Safe copies of Array built-in static methods. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/array | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Array = globalThis.Array; | ||
| /** | ||
| * (Safe copy) Determines whether the passed value is an Array. | ||
| */ | ||
| const isArray = _Array.isArray; | ||
| /** | ||
| * (Safe copy) Creates an array from an array-like or iterable object. | ||
| */ | ||
| const from = _Array.from; | ||
| /** | ||
| * Safe copies of Error built-ins via factory functions. | ||
| * | ||
| * Since constructors cannot be safely captured via Object.assign, this module | ||
| * provides factory functions that use Reflect.construct internally. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/error | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Error = globalThis.Error; | ||
| const _Reflect$4 = globalThis.Reflect; | ||
| /** | ||
| * (Safe copy) Creates a new Error using the captured Error constructor. | ||
| * Use this instead of `new Error()`. | ||
| * | ||
| * @param message - Optional error message. | ||
| * @param options - Optional error options. | ||
| * @returns A new Error instance. | ||
| */ | ||
| const createError = (message, options) => _Reflect$4.construct(_Error, [message, options]); | ||
| /** | ||
| * Safe copies of TypedArray and ArrayBuffer built-ins via factory functions. | ||
| * | ||
| * Provides safe references to Uint8Array, Int8Array, ArrayBuffer, DataView, etc. | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/typed-arrays | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _ArrayBuffer = globalThis.ArrayBuffer; | ||
| const _SharedArrayBuffer = globalThis.SharedArrayBuffer; | ||
| const _Uint8Array = globalThis.Uint8Array; | ||
| const _Uint8ClampedArray = globalThis.Uint8ClampedArray; | ||
| const _Uint16Array = globalThis.Uint16Array; | ||
| const _Uint32Array = globalThis.Uint32Array; | ||
| const _Int8Array = globalThis.Int8Array; | ||
| const _Int16Array = globalThis.Int16Array; | ||
| const _Int32Array = globalThis.Int32Array; | ||
| const _Float32Array = globalThis.Float32Array; | ||
| const _Float64Array = globalThis.Float64Array; | ||
| const _BigInt64Array = globalThis.BigInt64Array; | ||
| const _BigUint64Array = globalThis.BigUint64Array; | ||
| const _Reflect$3 = globalThis.Reflect; | ||
| function createUint8Array(arg, byteOffset, length) { | ||
| if (typeof arg === 'number') { | ||
| return _Reflect$3.construct(_Uint8Array, [arg]); | ||
| } | ||
| if (arg instanceof _ArrayBuffer || arg instanceof _SharedArrayBuffer) { | ||
| return _Reflect$3.construct(_Uint8Array, [arg, byteOffset, length]); | ||
| } | ||
| return _Reflect$3.construct(_Uint8Array, [arg]); | ||
| } | ||
| /** | ||
| * (Safe copy) Creates a new Uint8Array from an array-like or iterable object. | ||
| */ | ||
| _Uint8Array.from.bind(_Uint8Array); | ||
| /** | ||
| * (Safe copy) Creates a new Uint8Array from a variable number of arguments. | ||
| */ | ||
| _Uint8Array.of.bind(_Uint8Array); | ||
| /** | ||
| * (Safe copy) Creates a new Uint8ClampedArray from an array-like or iterable object. | ||
| */ | ||
| _Uint8ClampedArray.from.bind(_Uint8ClampedArray); | ||
| /** | ||
| * (Safe copy) Creates a new Uint8ClampedArray from a variable number of arguments. | ||
| */ | ||
| _Uint8ClampedArray.of.bind(_Uint8ClampedArray); | ||
| /** | ||
| * (Safe copy) Creates a new Uint16Array from an array-like or iterable object. | ||
| */ | ||
| _Uint16Array.from.bind(_Uint16Array); | ||
| /** | ||
| * (Safe copy) Creates a new Uint16Array from a variable number of arguments. | ||
| */ | ||
| _Uint16Array.of.bind(_Uint16Array); | ||
| /** | ||
| * (Safe copy) Creates a new Uint32Array from an array-like or iterable object. | ||
| */ | ||
| _Uint32Array.from.bind(_Uint32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Uint32Array from a variable number of arguments. | ||
| */ | ||
| _Uint32Array.of.bind(_Uint32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int8Array from an array-like or iterable object. | ||
| */ | ||
| _Int8Array.from.bind(_Int8Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int8Array from a variable number of arguments. | ||
| */ | ||
| _Int8Array.of.bind(_Int8Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int16Array from an array-like or iterable object. | ||
| */ | ||
| _Int16Array.from.bind(_Int16Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int16Array from a variable number of arguments. | ||
| */ | ||
| _Int16Array.of.bind(_Int16Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int32Array from an array-like or iterable object. | ||
| */ | ||
| _Int32Array.from.bind(_Int32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int32Array from a variable number of arguments. | ||
| */ | ||
| _Int32Array.of.bind(_Int32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Float32Array from an array-like or iterable object. | ||
| */ | ||
| _Float32Array.from.bind(_Float32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Float32Array from a variable number of arguments. | ||
| */ | ||
| _Float32Array.of.bind(_Float32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Float64Array from an array-like or iterable object. | ||
| */ | ||
| _Float64Array.from.bind(_Float64Array); | ||
| /** | ||
| * (Safe copy) Creates a new Float64Array from a variable number of arguments. | ||
| */ | ||
| _Float64Array.of.bind(_Float64Array); | ||
| /** | ||
| * (Safe copy) Creates a new BigInt64Array from an array-like or iterable object. | ||
| */ | ||
| _BigInt64Array.from.bind(_BigInt64Array); | ||
| /** | ||
| * (Safe copy) Creates a new BigInt64Array from a variable number of arguments. | ||
| */ | ||
| _BigInt64Array.of.bind(_BigInt64Array); | ||
| /** | ||
| * (Safe copy) Creates a new BigUint64Array from an array-like or iterable object. | ||
| */ | ||
| _BigUint64Array.from.bind(_BigUint64Array); | ||
| /** | ||
| * (Safe copy) Creates a new BigUint64Array from a variable number of arguments. | ||
| */ | ||
| _BigUint64Array.of.bind(_BigUint64Array); | ||
| /** | ||
| * Safe copies of encoding built-ins via factory functions. | ||
| * | ||
| * Provides safe references to TextEncoder, TextDecoder, atob, and btoa. | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/encoding | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _TextEncoder = globalThis.TextEncoder; | ||
| const _TextDecoder = globalThis.TextDecoder; | ||
| const _Reflect$2 = globalThis.Reflect; | ||
| /** | ||
| * (Safe copy) Creates a new TextEncoder using the captured TextEncoder constructor. | ||
| * Use this instead of `new TextEncoder()`. | ||
| * | ||
| * @returns A new TextEncoder instance. | ||
| */ | ||
| const createTextEncoder = () => _Reflect$2.construct(_TextEncoder, []); | ||
| /** | ||
| * (Safe copy) Creates a new TextDecoder using the captured TextDecoder constructor. | ||
| * Use this instead of `new TextDecoder()`. | ||
| * | ||
| * @param label - The encoding label (e.g., 'utf-8', 'utf-16'). Defaults to 'utf-8'. | ||
| * @param options - Optional TextDecoderOptions. | ||
| * @returns A new TextDecoder instance. | ||
| */ | ||
| const createTextDecoder = (label, options) => _Reflect$2.construct(_TextDecoder, [label, options]); | ||
| createTextEncoder(); | ||
| const UTF8_DECODER = createTextDecoder('utf8'); | ||
| ({ | ||
| SIMPLE: { | ||
| ARRAY: createUint8Array([104, 101, 108, 108, 111]), | ||
| }, | ||
| NON_ASCII: { | ||
| ARRAY: createUint8Array([ | ||
| 227, | ||
| 129, | ||
| 147, // こ | ||
| 227, | ||
| 130, | ||
| 147, // ん | ||
| 227, | ||
| 129, | ||
| 171, // に | ||
| 227, | ||
| 129, | ||
| 161, // ち | ||
| 227, | ||
| 129, | ||
| 175, // は | ||
| ]), | ||
| }, | ||
| EMPTY: { | ||
| ARRAY: createUint8Array([]), | ||
| }, | ||
| }); | ||
| /** | ||
| * Converts an ArrayBuffer to a UTF-8 encoded string. | ||
@@ -21,3 +243,3 @@ * | ||
| function utf8StringToUint8Array(text) { | ||
| return new TextEncoder().encode(text); | ||
| return createTextEncoder().encode(text); | ||
| } | ||
@@ -37,3 +259,3 @@ | ||
| try { | ||
| return Array.from(new Uint8Array(await subtle.digest(algorithm, utf8StringToUint8Array(data)))) | ||
| return from(createUint8Array(await subtle.digest(algorithm, utf8StringToUint8Array(data)))) | ||
| .map((b) => b.toString(16).padStart(2, '0')) | ||
@@ -43,3 +265,3 @@ .join(''); | ||
| catch { | ||
| throw new Error('Error creating hash'); | ||
| throw createError('Error creating hash'); | ||
| } | ||
@@ -49,14 +271,20 @@ } | ||
| /** | ||
| * Generates cryptographically secure random values using Web Crypto API (browser implementation). | ||
| * Safe copies of Object built-in methods. | ||
| * | ||
| * @param byteLength - The number of random bytes to generate | ||
| * @returns A Uint8Array containing the random bytes | ||
| * @throws {Error} When byteLength is not provided or is zero | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/object | ||
| */ | ||
| function getRandomValues(byteLength) { | ||
| if (!byteLength) { | ||
| throw new Error('Cannot generate random values without a byte length.'); | ||
| } | ||
| return globalThis.crypto.getRandomValues(new Uint8Array(byteLength)); | ||
| } | ||
| // Capture references at module initialization time | ||
| const _Object = globalThis.Object; | ||
| /** | ||
| * (Safe copy) Prevents modification of existing property attributes and values, | ||
| * and prevents the addition of new properties. | ||
| */ | ||
| const freeze = _Object.freeze; | ||
| /** | ||
| * (Safe copy) Creates an object that has the specified prototype or that has null prototype. | ||
| */ | ||
| const create = _Object.create; | ||
@@ -78,3 +306,3 @@ const registeredClasses = []; | ||
| if (nativeDataType === 'object') { | ||
| if (Array.isArray(target)) | ||
| if (isArray(target)) | ||
| return 'array'; | ||
@@ -89,5 +317,72 @@ for (const registeredClass of registeredClasses) { | ||
| const encryptionConfig = { | ||
| /** | ||
| * Safe copies of Map built-in via factory function. | ||
| * | ||
| * Since constructors cannot be safely captured via Object.assign, this module | ||
| * provides a factory function that uses Reflect.construct internally. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/map | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Map = globalThis.Map; | ||
| const _Reflect$1 = globalThis.Reflect; | ||
| /** | ||
| * (Safe copy) Creates a new Map using the captured Map constructor. | ||
| * Use this instead of `new Map()`. | ||
| * | ||
| * @param iterable - Optional iterable of key-value pairs. | ||
| * @returns A new Map instance. | ||
| */ | ||
| const createMap = (iterable) => _Reflect$1.construct(_Map, iterable ? [iterable] : []); | ||
| /** | ||
| * Safe copies of Date built-in via factory function and static methods. | ||
| * | ||
| * Since constructors cannot be safely captured via Object.assign, this module | ||
| * provides a factory function that uses Reflect.construct internally. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/date | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Date = globalThis.Date; | ||
| const _Reflect = globalThis.Reflect; | ||
| function createDate(...args) { | ||
| return _Reflect.construct(_Date, args); | ||
| } | ||
| /** | ||
| * Safe copies of Math built-in methods. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/math | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Math = globalThis.Math; | ||
| /** | ||
| * (Safe copy) Returns the largest integer less than or equal to a number. | ||
| */ | ||
| const floor = _Math.floor; | ||
| // ============================================================================ | ||
| // Trigonometry | ||
| // ============================================================================ | ||
| /** | ||
| * (Safe copy) Returns the sine of a number. | ||
| */ | ||
| const sin = _Math.sin; | ||
| /** | ||
| * Frozen encryption configuration to prevent runtime tampering. | ||
| * Using AES-GCM as the default algorithm for authenticated encryption. | ||
| */ | ||
| const encryptionConfig = freeze({ | ||
| name: 'AES-GCM', | ||
| }; | ||
| }); | ||
@@ -105,9 +400,9 @@ /** | ||
| if (getType(password) !== 'string') { | ||
| throw new Error('Cannot generate key without a password type string'); | ||
| throw createError('Cannot generate key without a password type string'); | ||
| } | ||
| if (password.length === 0) { | ||
| throw new Error('Cannot generate key with an empty string as password'); | ||
| throw createError('Cannot generate key with an empty string as password'); | ||
| } | ||
| if (!salt) { | ||
| throw new Error('Cannot generate key without a salt'); | ||
| throw createError('Cannot generate key without a salt'); | ||
| } | ||
@@ -130,2 +425,44 @@ const keyMaterial = await subtle.importKey('raw', utf8StringToUint8Array(password), { name: 'PBKDF2' }, false, [ | ||
| /** | ||
| * Creates a decryption function that decrypts AES-GCM encrypted messages using password-derived keys. | ||
| * Extracts salt and IV from the encrypted data to derive the correct decryption key. | ||
| * | ||
| * @param arrayBufferToUtf8String - Function to convert byte arrays to UTF-8 strings | ||
| * @param generateKey - Function to derive decryption keys from passwords | ||
| * @param subtle - The SubtleCrypto interface for cryptographic operations | ||
| * @returns A function that decrypts encrypted messages with passwords | ||
| */ | ||
| function createDecrypt(arrayBufferToUtf8String, generateKey, subtle) { | ||
| return async function decrypt(encrypted, password) { | ||
| if (!encrypted || !encrypted.length) { | ||
| throw createError('Cannot decrypt without a message'); | ||
| } | ||
| if (!password) { | ||
| throw createError('Cannot decrypt without a password'); | ||
| } | ||
| const salt = encrypted.slice(0, 16); | ||
| const iv = encrypted.slice(16, 28); | ||
| const data = encrypted.slice(28); | ||
| const key = await generateKey(password, salt); | ||
| const decryptedContent = await subtle.decrypt({ ...encryptionConfig, iv }, key, data); | ||
| return arrayBufferToUtf8String(decryptedContent); | ||
| }; | ||
| } | ||
| const decrypt = createDecrypt(arrayBufferToUtf8String, generateKey, subtle); | ||
| /** | ||
| * Generates cryptographically secure random values using Web Crypto API (browser implementation). | ||
| * | ||
| * @param byteLength - The number of random bytes to generate | ||
| * @returns A Uint8Array containing the random bytes | ||
| * @throws {Error} When byteLength is not provided or is zero | ||
| */ | ||
| function getRandomValues(byteLength) { | ||
| if (!byteLength) { | ||
| throw createError('Cannot generate random values without a byte length.'); | ||
| } | ||
| return globalThis.crypto.getRandomValues(createUint8Array(byteLength)); | ||
| } | ||
| /** | ||
| * Creates an encryption function that encrypts messages using AES-GCM with password-derived keys. | ||
@@ -143,6 +480,6 @@ * Generates random salt and initialization vector (IV) for each encryption operation. | ||
| if (!message) { | ||
| throw new Error('Cannot encrypt an empty message.'); | ||
| throw createError('Cannot encrypt an empty message.'); | ||
| } | ||
| if (!password) { | ||
| throw new Error('Cannot encrypt without a password.'); | ||
| throw createError('Cannot encrypt without a password.'); | ||
| } | ||
@@ -153,4 +490,4 @@ const salt = getRandomValues(16); | ||
| const encryptedContent = await subtle.encrypt({ ...encryptionConfig, iv: iv }, key, utf8StringToUint8Array(message)); | ||
| const buffer = new Uint8Array(encryptedContent); | ||
| const result = new Uint8Array(salt.byteLength + iv.byteLength + buffer.byteLength); | ||
| const buffer = createUint8Array(encryptedContent); | ||
| const result = createUint8Array(salt.byteLength + iv.byteLength + buffer.byteLength); | ||
| result.set(salt, 0); | ||
@@ -166,30 +503,2 @@ result.set(iv, salt.byteLength); | ||
| /** | ||
| * Creates a decryption function that decrypts AES-GCM encrypted messages using password-derived keys. | ||
| * Extracts salt and IV from the encrypted data to derive the correct decryption key. | ||
| * | ||
| * @param arrayBufferToUtf8String - Function to convert byte arrays to UTF-8 strings | ||
| * @param generateKey - Function to derive decryption keys from passwords | ||
| * @param subtle - The SubtleCrypto interface for cryptographic operations | ||
| * @returns A function that decrypts encrypted messages with passwords | ||
| */ | ||
| function createDecrypt(arrayBufferToUtf8String, generateKey, subtle) { | ||
| return async function decrypt(encrypted, password) { | ||
| if (!encrypted || !encrypted.length) { | ||
| throw new Error('Cannot decrypt without a message'); | ||
| } | ||
| if (!password) { | ||
| throw new Error('Cannot decrypt without a password'); | ||
| } | ||
| const salt = encrypted.slice(0, 16); | ||
| const iv = encrypted.slice(16, 28); | ||
| const data = encrypted.slice(28); | ||
| const key = await generateKey(password, salt); | ||
| const decryptedContent = await subtle.decrypt({ ...encryptionConfig, iv }, key, data); | ||
| return arrayBufferToUtf8String(decryptedContent); | ||
| }; | ||
| } | ||
| const decrypt = createDecrypt(arrayBufferToUtf8String, generateKey, subtle); | ||
| /** | ||
| * Creates a vault factory function that produces encrypted storage instances. | ||
@@ -205,3 +514,3 @@ * Vaults provide secure, password-protected storage for sensitive data with optional single-use mode. | ||
| return function createVault(singleUse = false) { | ||
| let password = Array.from(getRandomValues(16)) | ||
| let password = from(getRandomValues(16)) | ||
| .map((b) => b.toString(16).padStart(2, '0')) | ||
@@ -211,3 +520,3 @@ .join(''); | ||
| let isVaultClosed = false; | ||
| let storage = new Map(); | ||
| let storage = createMap(); | ||
| /** | ||
@@ -223,9 +532,9 @@ * Writes an encrypted value to the vault with the specified label. | ||
| if (isVaultClosed) { | ||
| throw new Error('Vault is closed.'); | ||
| throw createError('Vault is closed.'); | ||
| } | ||
| if (!label) { | ||
| throw new Error('Label is required.'); | ||
| throw createError('Label is required.'); | ||
| } | ||
| if (!value) { | ||
| throw new Error('Value is required.'); | ||
| throw createError('Value is required.'); | ||
| } | ||
@@ -246,9 +555,9 @@ const encryptedValue = await encrypt(value, password); | ||
| if (isVaultClosed) { | ||
| throw new Error('Vault is closed.'); | ||
| throw createError('Vault is closed.'); | ||
| } | ||
| if (!label) { | ||
| throw new Error('Label is required.'); | ||
| throw createError('Label is required.'); | ||
| } | ||
| if (!password) { | ||
| throw new Error('Password is required.'); | ||
| throw createError('Password is required.'); | ||
| } | ||
@@ -274,3 +583,3 @@ const encryptedValue = storage.get(label); | ||
| if (isVaultClosed) { | ||
| throw new Error('Vault is closed.'); | ||
| throw createError('Vault is closed.'); | ||
| } | ||
@@ -293,3 +602,3 @@ if (isPasswordAccessed) { | ||
| } | ||
| const vault = Object.create(null, { | ||
| const vault = create(null, { | ||
| write: { | ||
@@ -320,3 +629,4 @@ value: write, | ||
| }); | ||
| return vault; | ||
| // Freeze to prevent addition of new properties | ||
| return freeze(vault); | ||
| }; | ||
@@ -334,4 +644,4 @@ } | ||
| function randomPseudo(seed) { | ||
| const x = Math.sin(seed) * 10000; | ||
| return x - Math.floor(x); | ||
| const x = sin(seed) * 10000; | ||
| return x - floor(x); | ||
| } | ||
@@ -350,2 +660,20 @@ | ||
| /** | ||
| * Safe copies of Number built-in methods and constants. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/number | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _isNaN = globalThis.isNaN; | ||
| // ============================================================================ | ||
| // Global Type Checking (legacy, less strict) | ||
| // ============================================================================ | ||
| /** | ||
| * (Safe copy) Global isNaN function (coerces to number first, less strict than Number.isNaN). | ||
| */ | ||
| const globalIsNaN = _isNaN; | ||
| /** | ||
| * Normalizes a given time to the nearest base time window. | ||
@@ -358,15 +686,59 @@ * | ||
| function normalizeToBaseTimeWindow(time, baseTimeWindow) { | ||
| if (!time || !(time instanceof Date) || isNaN(time.getTime())) { | ||
| throw new Error('Invalid time input'); | ||
| if (!time || !(time instanceof Date) || globalIsNaN(time.getTime())) { | ||
| throw createError('Invalid time input'); | ||
| } | ||
| if (baseTimeWindow <= 0) { | ||
| throw new Error('Base time window must be positive'); | ||
| throw createError('Base time window must be positive'); | ||
| } | ||
| const timeInMs = time.getTime(); | ||
| const windowInMs = baseTimeWindow * 60 * 1000; | ||
| const normalizedTimeInMs = Math.floor(timeInMs / windowInMs) * windowInMs; | ||
| return new Date(normalizedTimeInMs); | ||
| const normalizedTimeInMs = floor(timeInMs / windowInMs) * windowInMs; | ||
| return createDate(normalizedTimeInMs); | ||
| } | ||
| /** | ||
| * Safe copies of Promise built-in methods via factory functions. | ||
| * | ||
| * Since constructors cannot be safely captured via Object.assign, this module | ||
| * provides factory functions that use Reflect.construct internally. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/promise | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Promise = globalThis.Promise; | ||
| /** | ||
| * (Safe copy) Returns a Promise that resolves with the given value. | ||
| */ | ||
| _Promise.resolve.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Returns a Promise that rejects with the given reason. | ||
| */ | ||
| _Promise.reject.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Returns a Promise that resolves when all promises resolve. | ||
| */ | ||
| _Promise.all.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Returns a Promise that resolves/rejects with the first settled promise. | ||
| */ | ||
| _Promise.race.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Returns a Promise that resolves when all promises settle. | ||
| */ | ||
| _Promise.allSettled.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Returns a Promise that resolves with the first fulfilled promise. | ||
| */ | ||
| _Promise.any.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Creates a Promise along with its resolve and reject functions. | ||
| * Note: Available only in ES2024+ environments. | ||
| */ | ||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| _Promise.withResolvers?.bind(_Promise); | ||
| /** | ||
| * Creates a time-based one-time password (TOTP) generator function. | ||
@@ -381,5 +753,5 @@ * Generates passwords that change based on time windows, supporting previous/current/next window offsets. | ||
| if (getType(windowOffset) !== 'number' || windowOffset < -1 || 1 < windowOffset) { | ||
| throw new Error('Window offset must be -1, 0, or 1.'); | ||
| throw createError('Window offset must be -1, 0, or 1.'); | ||
| } | ||
| const offsetTime = new Date(currentUtcTime.getTime() + windowOffset * baseTimeWindow * 60000); | ||
| const offsetTime = createDate(currentUtcTime.getTime() + windowOffset * baseTimeWindow * 60000); | ||
| return await createHash(randomPseudoTimeBased(normalizeToBaseTimeWindow(offsetTime, baseTimeWindow)).toString()); | ||
@@ -402,3 +774,3 @@ }; | ||
| * Creates a factory function that generates time-based password generators for multiple time windows. | ||
| * Returns an object with methods to generate passwords for current, previous, and next time windows. | ||
| * Returns a frozen object with methods to generate passwords for current, previous, and next time windows. | ||
| * | ||
@@ -413,3 +785,4 @@ * @param getTimeBasedPassword - Function to generate a single time-based password with window offset | ||
| const next = () => getTimeBasedPassword(currentUtcTime, baseTimeWindow, 1); | ||
| return { current, previous, next }; | ||
| // Freeze to prevent runtime modification of password generator methods | ||
| return freeze({ current, previous, next }); | ||
| }; | ||
@@ -416,0 +789,0 @@ } |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.esm.js","sources":["../../../../../../../../libs/utils/string/src/lib/shared-consts.ts","../../../../../../../../libs/utils/string/src/lib/array-buffer-to-utf8-string/array-buffer-to-utf8-string.ts","../../../../../../../../libs/utils/string/src/lib/utf8-string-to-uint8-array/browser/utf8-string-to-uint8-array.ts","../../../../../../../../libs/cryptography/src/lib/subtle/browser.ts","../../../../../../../../libs/cryptography/src/lib/create-hash/browser.ts","../../../../../../../../libs/cryptography/src/lib/get-random-values/browser.ts","../../../../../../../../libs/utils/data/src/shared/consts.ts","../../../../../../../../libs/utils/data/src/get-type.ts","../../../../../../../../libs/cryptography/src/lib/encryption-config.ts","../../../../../../../../libs/cryptography/src/lib/generate-key/create-key-generator.ts","../../../../../../../../libs/cryptography/src/lib/generate-key/browser.ts","../../../../../../../../libs/cryptography/src/lib/encrypt/create-encrypt.ts","../../../../../../../../libs/cryptography/src/lib/encrypt/browser.ts","../../../../../../../../libs/cryptography/src/lib/decrypt/create-decrypt.ts","../../../../../../../../libs/cryptography/src/lib/decrypt/browser.ts","../../../../../../../../libs/cryptography/src/lib/create-vault/create-value-creator.ts","../../../../../../../../libs/cryptography/src/lib/create-vault/browser.ts","../../../../../../../../libs/utils/random-generator/src/random-pseudo.ts","../../../../../../../../libs/utils/random-generator/src/random-pseudo-time-based.ts","../../../../../../../../libs/utils/time/src/normalize-to-base-time-window.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-password/create-get-time-based-password.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-password/browser.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/create-get-time-based-passwords.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/browser.ts","../../../../../../../../libs/cryptography/src/lib/is-sha-256-hash.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":[],"mappings":"AAAuB,IAAI,WAAW;AAC/B,MAAM,YAAY,GAAG,IAAI,WAAW,CAAC,MAAM,CAAC;;ACCnD;;;;;AAKG;AACG,SAAU,uBAAuB,CAAC,UAAuB,EAAA;AAC7D,IAAA,OAAO,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC;AACxC;;ACVA;;;;;AAKG;AACG,SAAU,sBAAsB,CAAC,IAAY,EAAA;IACjD,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC;AACvC;;MCRa,MAAM,GAAiB,UAAU,CAAC,MAAM,CAAC;;ACItD;;;;;;;AAOG;AACI,eAAe,UAAU,CAAC,IAAY,EAAE,YAA2B,SAAS,EAAA;AACjF,IAAA,IAAI;QACF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,SAAS,EAAgB,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC;AACzG,aAAA,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;aAC1C,IAAI,CAAC,EAAE,CAAC;IACb;AAAE,IAAA,MAAM;AACN,QAAA,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC;IACxC;AACF;;ACpBA;;;;;;AAMG;AACG,SAAU,eAAe,CAAC,UAAkB,EAAA;IAChD,IAAI,CAAC,UAAU,EAAE;AACf,QAAA,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC;IACzE;AACA,IAAA,OAAO,UAAU,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,UAAU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K,QAAQ,GAAG,iBAAiB,CAAC,IAAI,CAAS,IAAI,CAAC,GAAG,KAAK;AAClF;;;;"} | ||
| {"version":3,"file":"index.esm.js","sources":["../../../../../../../../libs/utils/immutable-api/src/built-in-copy/array/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/error/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/typed-arrays/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/encoding/index.ts","../../../../../../../../libs/utils/string/src/lib/shared-consts.ts","../../../../../../../../libs/utils/string/src/lib/array-buffer-to-utf8-string/array-buffer-to-utf8-string.ts","../../../../../../../../libs/utils/string/src/lib/utf8-string-to-uint8-array/browser/utf8-string-to-uint8-array.ts","../../../../../../../../libs/cryptography/src/lib/subtle/browser.ts","../../../../../../../../libs/cryptography/src/lib/create-hash/browser.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/object/index.ts","../../../../../../../../libs/utils/data/src/shared/consts.ts","../../../../../../../../libs/utils/data/src/get-type.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/map/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/date/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/math/index.ts","../../../../../../../../libs/cryptography/src/lib/encryption-config.ts","../../../../../../../../libs/cryptography/src/lib/generate-key/create-key-generator.ts","../../../../../../../../libs/cryptography/src/lib/generate-key/browser.ts","../../../../../../../../libs/cryptography/src/lib/decrypt/create-decrypt.ts","../../../../../../../../libs/cryptography/src/lib/decrypt/browser.ts","../../../../../../../../libs/cryptography/src/lib/get-random-values/browser.ts","../../../../../../../../libs/cryptography/src/lib/encrypt/create-encrypt.ts","../../../../../../../../libs/cryptography/src/lib/encrypt/browser.ts","../../../../../../../../libs/cryptography/src/lib/create-vault/create-value-creator.ts","../../../../../../../../libs/cryptography/src/lib/create-vault/browser.ts","../../../../../../../../libs/utils/random-generator/src/random-pseudo.ts","../../../../../../../../libs/utils/random-generator/src/random-pseudo-time-based.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/number/index.ts","../../../../../../../../libs/utils/time/src/normalize-to-base-time-window.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/promise/index.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-password/create-get-time-based-password.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-password/browser.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/create-get-time-based-passwords.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/browser.ts","../../../../../../../../libs/cryptography/src/lib/is-sha-256-hash.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["_Reflect"],"mappings":"AAAA;;;;;;;AAOG;AAEH;AACA,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK;AAG/B;;AAEG;AACI,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO;AAErC;;AAEG;AACI,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI;;ACrB/B;;;;;;;;;;AAUG;AAEH;AACA,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK;AAQ/B,MAAMA,UAAQ,GAAG,UAAU,CAAC,OAAO;AAGnC;;;;;;;AAOG;AACI,MAAM,WAAW,GAAG,CAAC,OAAgB,EAAE,OAAsB,KAAmBA,UAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;;AChCrI;;;;;;;;AAQG;AAEH;AACA,MAAM,YAAY,GAAG,UAAU,CAAC,WAAW;AAC3C,MAAM,kBAAkB,GAAG,UAAU,CAAC,iBAAiB;AAEvD,MAAM,WAAW,GAAG,UAAU,CAAC,UAAU;AACzC,MAAM,kBAAkB,GAAG,UAAU,CAAC,iBAAiB;AACvD,MAAM,YAAY,GAAG,UAAU,CAAC,WAAW;AAC3C,MAAM,YAAY,GAAG,UAAU,CAAC,W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CACtC,oBAAkH,EAAA;AAElH,IAAA,OAAO,SAAS,qBAAqB,CAAC,cAAc,EAAE,cAAc,EAAA;AAClE,QAAA,MAAM,OAAO,GAAG,MAAM,oBAAoB,CAAC,cAAc,EAAE,cAAc,EAAE,CAAC,CAAC;AAC7E,QAAA,MAAM,QAAQ,GAAG,MAAM,oBAAoB,CAAC,cAAc,EAAE,cAAc,EAAE,EAAE,CAAC;AAC/E,QAAA,MAAM,IAAI,GAAG,MAAM,oBAAoB,CAAC,cAAc,EAAE,cAAc,EAAE,CAAC,CAAC;;QAE1E,OAAO,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC5C,IAAA,CAAC;AACH;;ACjBA;;;;;;;AAOG;MACU,qBAAqB,GAAG,wBAAwB,CAAC,oBAAoB;;ACTlF;;;;;;AAMG;AACG,SAAU,YAAY,CAAC,IAAa,EAAA;AACxC,IAAA,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,QAAQ,GAAG,iBAAiB,CAAC,IAAI,CAAS,IAAI,CAAC,GAAG,KAAK;AAClF;;;;"} |
+448
-75
| var HyperfrontendCryptography = (function (exports) { | ||
| 'use strict'; | ||
| new TextEncoder(); | ||
| const UTF8_DECODER = new TextDecoder('utf8'); | ||
| /** | ||
| * Safe copies of Array built-in static methods. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/array | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Array = globalThis.Array; | ||
| /** | ||
| * (Safe copy) Determines whether the passed value is an Array. | ||
| */ | ||
| const isArray = _Array.isArray; | ||
| /** | ||
| * (Safe copy) Creates an array from an array-like or iterable object. | ||
| */ | ||
| const from = _Array.from; | ||
| /** | ||
| * Safe copies of Error built-ins via factory functions. | ||
| * | ||
| * Since constructors cannot be safely captured via Object.assign, this module | ||
| * provides factory functions that use Reflect.construct internally. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/error | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Error = globalThis.Error; | ||
| const _Reflect$4 = globalThis.Reflect; | ||
| /** | ||
| * (Safe copy) Creates a new Error using the captured Error constructor. | ||
| * Use this instead of `new Error()`. | ||
| * | ||
| * @param message - Optional error message. | ||
| * @param options - Optional error options. | ||
| * @returns A new Error instance. | ||
| */ | ||
| const createError = (message, options) => _Reflect$4.construct(_Error, [message, options]); | ||
| /** | ||
| * Safe copies of TypedArray and ArrayBuffer built-ins via factory functions. | ||
| * | ||
| * Provides safe references to Uint8Array, Int8Array, ArrayBuffer, DataView, etc. | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/typed-arrays | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _ArrayBuffer = globalThis.ArrayBuffer; | ||
| const _SharedArrayBuffer = globalThis.SharedArrayBuffer; | ||
| const _Uint8Array = globalThis.Uint8Array; | ||
| const _Uint8ClampedArray = globalThis.Uint8ClampedArray; | ||
| const _Uint16Array = globalThis.Uint16Array; | ||
| const _Uint32Array = globalThis.Uint32Array; | ||
| const _Int8Array = globalThis.Int8Array; | ||
| const _Int16Array = globalThis.Int16Array; | ||
| const _Int32Array = globalThis.Int32Array; | ||
| const _Float32Array = globalThis.Float32Array; | ||
| const _Float64Array = globalThis.Float64Array; | ||
| const _BigInt64Array = globalThis.BigInt64Array; | ||
| const _BigUint64Array = globalThis.BigUint64Array; | ||
| const _Reflect$3 = globalThis.Reflect; | ||
| function createUint8Array(arg, byteOffset, length) { | ||
| if (typeof arg === 'number') { | ||
| return _Reflect$3.construct(_Uint8Array, [arg]); | ||
| } | ||
| if (arg instanceof _ArrayBuffer || arg instanceof _SharedArrayBuffer) { | ||
| return _Reflect$3.construct(_Uint8Array, [arg, byteOffset, length]); | ||
| } | ||
| return _Reflect$3.construct(_Uint8Array, [arg]); | ||
| } | ||
| /** | ||
| * (Safe copy) Creates a new Uint8Array from an array-like or iterable object. | ||
| */ | ||
| _Uint8Array.from.bind(_Uint8Array); | ||
| /** | ||
| * (Safe copy) Creates a new Uint8Array from a variable number of arguments. | ||
| */ | ||
| _Uint8Array.of.bind(_Uint8Array); | ||
| /** | ||
| * (Safe copy) Creates a new Uint8ClampedArray from an array-like or iterable object. | ||
| */ | ||
| _Uint8ClampedArray.from.bind(_Uint8ClampedArray); | ||
| /** | ||
| * (Safe copy) Creates a new Uint8ClampedArray from a variable number of arguments. | ||
| */ | ||
| _Uint8ClampedArray.of.bind(_Uint8ClampedArray); | ||
| /** | ||
| * (Safe copy) Creates a new Uint16Array from an array-like or iterable object. | ||
| */ | ||
| _Uint16Array.from.bind(_Uint16Array); | ||
| /** | ||
| * (Safe copy) Creates a new Uint16Array from a variable number of arguments. | ||
| */ | ||
| _Uint16Array.of.bind(_Uint16Array); | ||
| /** | ||
| * (Safe copy) Creates a new Uint32Array from an array-like or iterable object. | ||
| */ | ||
| _Uint32Array.from.bind(_Uint32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Uint32Array from a variable number of arguments. | ||
| */ | ||
| _Uint32Array.of.bind(_Uint32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int8Array from an array-like or iterable object. | ||
| */ | ||
| _Int8Array.from.bind(_Int8Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int8Array from a variable number of arguments. | ||
| */ | ||
| _Int8Array.of.bind(_Int8Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int16Array from an array-like or iterable object. | ||
| */ | ||
| _Int16Array.from.bind(_Int16Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int16Array from a variable number of arguments. | ||
| */ | ||
| _Int16Array.of.bind(_Int16Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int32Array from an array-like or iterable object. | ||
| */ | ||
| _Int32Array.from.bind(_Int32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int32Array from a variable number of arguments. | ||
| */ | ||
| _Int32Array.of.bind(_Int32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Float32Array from an array-like or iterable object. | ||
| */ | ||
| _Float32Array.from.bind(_Float32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Float32Array from a variable number of arguments. | ||
| */ | ||
| _Float32Array.of.bind(_Float32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Float64Array from an array-like or iterable object. | ||
| */ | ||
| _Float64Array.from.bind(_Float64Array); | ||
| /** | ||
| * (Safe copy) Creates a new Float64Array from a variable number of arguments. | ||
| */ | ||
| _Float64Array.of.bind(_Float64Array); | ||
| /** | ||
| * (Safe copy) Creates a new BigInt64Array from an array-like or iterable object. | ||
| */ | ||
| _BigInt64Array.from.bind(_BigInt64Array); | ||
| /** | ||
| * (Safe copy) Creates a new BigInt64Array from a variable number of arguments. | ||
| */ | ||
| _BigInt64Array.of.bind(_BigInt64Array); | ||
| /** | ||
| * (Safe copy) Creates a new BigUint64Array from an array-like or iterable object. | ||
| */ | ||
| _BigUint64Array.from.bind(_BigUint64Array); | ||
| /** | ||
| * (Safe copy) Creates a new BigUint64Array from a variable number of arguments. | ||
| */ | ||
| _BigUint64Array.of.bind(_BigUint64Array); | ||
| /** | ||
| * Safe copies of encoding built-ins via factory functions. | ||
| * | ||
| * Provides safe references to TextEncoder, TextDecoder, atob, and btoa. | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/encoding | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _TextEncoder = globalThis.TextEncoder; | ||
| const _TextDecoder = globalThis.TextDecoder; | ||
| const _Reflect$2 = globalThis.Reflect; | ||
| /** | ||
| * (Safe copy) Creates a new TextEncoder using the captured TextEncoder constructor. | ||
| * Use this instead of `new TextEncoder()`. | ||
| * | ||
| * @returns A new TextEncoder instance. | ||
| */ | ||
| const createTextEncoder = () => _Reflect$2.construct(_TextEncoder, []); | ||
| /** | ||
| * (Safe copy) Creates a new TextDecoder using the captured TextDecoder constructor. | ||
| * Use this instead of `new TextDecoder()`. | ||
| * | ||
| * @param label - The encoding label (e.g., 'utf-8', 'utf-16'). Defaults to 'utf-8'. | ||
| * @param options - Optional TextDecoderOptions. | ||
| * @returns A new TextDecoder instance. | ||
| */ | ||
| const createTextDecoder = (label, options) => _Reflect$2.construct(_TextDecoder, [label, options]); | ||
| createTextEncoder(); | ||
| const UTF8_DECODER = createTextDecoder('utf8'); | ||
| ({ | ||
| SIMPLE: { | ||
| ARRAY: createUint8Array([104, 101, 108, 108, 111]), | ||
| }, | ||
| NON_ASCII: { | ||
| ARRAY: createUint8Array([ | ||
| 227, | ||
| 129, | ||
| 147, // こ | ||
| 227, | ||
| 130, | ||
| 147, // ん | ||
| 227, | ||
| 129, | ||
| 171, // に | ||
| 227, | ||
| 129, | ||
| 161, // ち | ||
| 227, | ||
| 129, | ||
| 175, // は | ||
| ]), | ||
| }, | ||
| EMPTY: { | ||
| ARRAY: createUint8Array([]), | ||
| }, | ||
| }); | ||
| /** | ||
| * Converts an ArrayBuffer to a UTF-8 encoded string. | ||
@@ -24,3 +246,3 @@ * | ||
| function utf8StringToUint8Array(text) { | ||
| return new TextEncoder().encode(text); | ||
| return createTextEncoder().encode(text); | ||
| } | ||
@@ -40,3 +262,3 @@ | ||
| try { | ||
| return Array.from(new Uint8Array(await subtle.digest(algorithm, utf8StringToUint8Array(data)))) | ||
| return from(createUint8Array(await subtle.digest(algorithm, utf8StringToUint8Array(data)))) | ||
| .map((b) => b.toString(16).padStart(2, '0')) | ||
@@ -46,3 +268,3 @@ .join(''); | ||
| catch { | ||
| throw new Error('Error creating hash'); | ||
| throw createError('Error creating hash'); | ||
| } | ||
@@ -52,14 +274,20 @@ } | ||
| /** | ||
| * Generates cryptographically secure random values using Web Crypto API (browser implementation). | ||
| * Safe copies of Object built-in methods. | ||
| * | ||
| * @param byteLength - The number of random bytes to generate | ||
| * @returns A Uint8Array containing the random bytes | ||
| * @throws {Error} When byteLength is not provided or is zero | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/object | ||
| */ | ||
| function getRandomValues(byteLength) { | ||
| if (!byteLength) { | ||
| throw new Error('Cannot generate random values without a byte length.'); | ||
| } | ||
| return globalThis.crypto.getRandomValues(new Uint8Array(byteLength)); | ||
| } | ||
| // Capture references at module initialization time | ||
| const _Object = globalThis.Object; | ||
| /** | ||
| * (Safe copy) Prevents modification of existing property attributes and values, | ||
| * and prevents the addition of new properties. | ||
| */ | ||
| const freeze = _Object.freeze; | ||
| /** | ||
| * (Safe copy) Creates an object that has the specified prototype or that has null prototype. | ||
| */ | ||
| const create = _Object.create; | ||
@@ -81,3 +309,3 @@ const registeredClasses = []; | ||
| if (nativeDataType === 'object') { | ||
| if (Array.isArray(target)) | ||
| if (isArray(target)) | ||
| return 'array'; | ||
@@ -92,5 +320,72 @@ for (const registeredClass of registeredClasses) { | ||
| const encryptionConfig = { | ||
| /** | ||
| * Safe copies of Map built-in via factory function. | ||
| * | ||
| * Since constructors cannot be safely captured via Object.assign, this module | ||
| * provides a factory function that uses Reflect.construct internally. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/map | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Map = globalThis.Map; | ||
| const _Reflect$1 = globalThis.Reflect; | ||
| /** | ||
| * (Safe copy) Creates a new Map using the captured Map constructor. | ||
| * Use this instead of `new Map()`. | ||
| * | ||
| * @param iterable - Optional iterable of key-value pairs. | ||
| * @returns A new Map instance. | ||
| */ | ||
| const createMap = (iterable) => _Reflect$1.construct(_Map, iterable ? [iterable] : []); | ||
| /** | ||
| * Safe copies of Date built-in via factory function and static methods. | ||
| * | ||
| * Since constructors cannot be safely captured via Object.assign, this module | ||
| * provides a factory function that uses Reflect.construct internally. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/date | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Date = globalThis.Date; | ||
| const _Reflect = globalThis.Reflect; | ||
| function createDate(...args) { | ||
| return _Reflect.construct(_Date, args); | ||
| } | ||
| /** | ||
| * Safe copies of Math built-in methods. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/math | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Math = globalThis.Math; | ||
| /** | ||
| * (Safe copy) Returns the largest integer less than or equal to a number. | ||
| */ | ||
| const floor = _Math.floor; | ||
| // ============================================================================ | ||
| // Trigonometry | ||
| // ============================================================================ | ||
| /** | ||
| * (Safe copy) Returns the sine of a number. | ||
| */ | ||
| const sin = _Math.sin; | ||
| /** | ||
| * Frozen encryption configuration to prevent runtime tampering. | ||
| * Using AES-GCM as the default algorithm for authenticated encryption. | ||
| */ | ||
| const encryptionConfig = freeze({ | ||
| name: 'AES-GCM', | ||
| }; | ||
| }); | ||
@@ -108,9 +403,9 @@ /** | ||
| if (getType(password) !== 'string') { | ||
| throw new Error('Cannot generate key without a password type string'); | ||
| throw createError('Cannot generate key without a password type string'); | ||
| } | ||
| if (password.length === 0) { | ||
| throw new Error('Cannot generate key with an empty string as password'); | ||
| throw createError('Cannot generate key with an empty string as password'); | ||
| } | ||
| if (!salt) { | ||
| throw new Error('Cannot generate key without a salt'); | ||
| throw createError('Cannot generate key without a salt'); | ||
| } | ||
@@ -133,2 +428,44 @@ const keyMaterial = await subtle.importKey('raw', utf8StringToUint8Array(password), { name: 'PBKDF2' }, false, [ | ||
| /** | ||
| * Creates a decryption function that decrypts AES-GCM encrypted messages using password-derived keys. | ||
| * Extracts salt and IV from the encrypted data to derive the correct decryption key. | ||
| * | ||
| * @param arrayBufferToUtf8String - Function to convert byte arrays to UTF-8 strings | ||
| * @param generateKey - Function to derive decryption keys from passwords | ||
| * @param subtle - The SubtleCrypto interface for cryptographic operations | ||
| * @returns A function that decrypts encrypted messages with passwords | ||
| */ | ||
| function createDecrypt(arrayBufferToUtf8String, generateKey, subtle) { | ||
| return async function decrypt(encrypted, password) { | ||
| if (!encrypted || !encrypted.length) { | ||
| throw createError('Cannot decrypt without a message'); | ||
| } | ||
| if (!password) { | ||
| throw createError('Cannot decrypt without a password'); | ||
| } | ||
| const salt = encrypted.slice(0, 16); | ||
| const iv = encrypted.slice(16, 28); | ||
| const data = encrypted.slice(28); | ||
| const key = await generateKey(password, salt); | ||
| const decryptedContent = await subtle.decrypt({ ...encryptionConfig, iv }, key, data); | ||
| return arrayBufferToUtf8String(decryptedContent); | ||
| }; | ||
| } | ||
| const decrypt = createDecrypt(arrayBufferToUtf8String, generateKey, subtle); | ||
| /** | ||
| * Generates cryptographically secure random values using Web Crypto API (browser implementation). | ||
| * | ||
| * @param byteLength - The number of random bytes to generate | ||
| * @returns A Uint8Array containing the random bytes | ||
| * @throws {Error} When byteLength is not provided or is zero | ||
| */ | ||
| function getRandomValues(byteLength) { | ||
| if (!byteLength) { | ||
| throw createError('Cannot generate random values without a byte length.'); | ||
| } | ||
| return globalThis.crypto.getRandomValues(createUint8Array(byteLength)); | ||
| } | ||
| /** | ||
| * Creates an encryption function that encrypts messages using AES-GCM with password-derived keys. | ||
@@ -146,6 +483,6 @@ * Generates random salt and initialization vector (IV) for each encryption operation. | ||
| if (!message) { | ||
| throw new Error('Cannot encrypt an empty message.'); | ||
| throw createError('Cannot encrypt an empty message.'); | ||
| } | ||
| if (!password) { | ||
| throw new Error('Cannot encrypt without a password.'); | ||
| throw createError('Cannot encrypt without a password.'); | ||
| } | ||
@@ -156,4 +493,4 @@ const salt = getRandomValues(16); | ||
| const encryptedContent = await subtle.encrypt({ ...encryptionConfig, iv: iv }, key, utf8StringToUint8Array(message)); | ||
| const buffer = new Uint8Array(encryptedContent); | ||
| const result = new Uint8Array(salt.byteLength + iv.byteLength + buffer.byteLength); | ||
| const buffer = createUint8Array(encryptedContent); | ||
| const result = createUint8Array(salt.byteLength + iv.byteLength + buffer.byteLength); | ||
| result.set(salt, 0); | ||
@@ -169,30 +506,2 @@ result.set(iv, salt.byteLength); | ||
| /** | ||
| * Creates a decryption function that decrypts AES-GCM encrypted messages using password-derived keys. | ||
| * Extracts salt and IV from the encrypted data to derive the correct decryption key. | ||
| * | ||
| * @param arrayBufferToUtf8String - Function to convert byte arrays to UTF-8 strings | ||
| * @param generateKey - Function to derive decryption keys from passwords | ||
| * @param subtle - The SubtleCrypto interface for cryptographic operations | ||
| * @returns A function that decrypts encrypted messages with passwords | ||
| */ | ||
| function createDecrypt(arrayBufferToUtf8String, generateKey, subtle) { | ||
| return async function decrypt(encrypted, password) { | ||
| if (!encrypted || !encrypted.length) { | ||
| throw new Error('Cannot decrypt without a message'); | ||
| } | ||
| if (!password) { | ||
| throw new Error('Cannot decrypt without a password'); | ||
| } | ||
| const salt = encrypted.slice(0, 16); | ||
| const iv = encrypted.slice(16, 28); | ||
| const data = encrypted.slice(28); | ||
| const key = await generateKey(password, salt); | ||
| const decryptedContent = await subtle.decrypt({ ...encryptionConfig, iv }, key, data); | ||
| return arrayBufferToUtf8String(decryptedContent); | ||
| }; | ||
| } | ||
| const decrypt = createDecrypt(arrayBufferToUtf8String, generateKey, subtle); | ||
| /** | ||
| * Creates a vault factory function that produces encrypted storage instances. | ||
@@ -208,3 +517,3 @@ * Vaults provide secure, password-protected storage for sensitive data with optional single-use mode. | ||
| return function createVault(singleUse = false) { | ||
| let password = Array.from(getRandomValues(16)) | ||
| let password = from(getRandomValues(16)) | ||
| .map((b) => b.toString(16).padStart(2, '0')) | ||
@@ -214,3 +523,3 @@ .join(''); | ||
| let isVaultClosed = false; | ||
| let storage = new Map(); | ||
| let storage = createMap(); | ||
| /** | ||
@@ -226,9 +535,9 @@ * Writes an encrypted value to the vault with the specified label. | ||
| if (isVaultClosed) { | ||
| throw new Error('Vault is closed.'); | ||
| throw createError('Vault is closed.'); | ||
| } | ||
| if (!label) { | ||
| throw new Error('Label is required.'); | ||
| throw createError('Label is required.'); | ||
| } | ||
| if (!value) { | ||
| throw new Error('Value is required.'); | ||
| throw createError('Value is required.'); | ||
| } | ||
@@ -249,9 +558,9 @@ const encryptedValue = await encrypt(value, password); | ||
| if (isVaultClosed) { | ||
| throw new Error('Vault is closed.'); | ||
| throw createError('Vault is closed.'); | ||
| } | ||
| if (!label) { | ||
| throw new Error('Label is required.'); | ||
| throw createError('Label is required.'); | ||
| } | ||
| if (!password) { | ||
| throw new Error('Password is required.'); | ||
| throw createError('Password is required.'); | ||
| } | ||
@@ -277,3 +586,3 @@ const encryptedValue = storage.get(label); | ||
| if (isVaultClosed) { | ||
| throw new Error('Vault is closed.'); | ||
| throw createError('Vault is closed.'); | ||
| } | ||
@@ -296,3 +605,3 @@ if (isPasswordAccessed) { | ||
| } | ||
| const vault = Object.create(null, { | ||
| const vault = create(null, { | ||
| write: { | ||
@@ -323,3 +632,4 @@ value: write, | ||
| }); | ||
| return vault; | ||
| // Freeze to prevent addition of new properties | ||
| return freeze(vault); | ||
| }; | ||
@@ -337,4 +647,4 @@ } | ||
| function randomPseudo(seed) { | ||
| const x = Math.sin(seed) * 10000; | ||
| return x - Math.floor(x); | ||
| const x = sin(seed) * 10000; | ||
| return x - floor(x); | ||
| } | ||
@@ -353,2 +663,20 @@ | ||
| /** | ||
| * Safe copies of Number built-in methods and constants. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/number | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _isNaN = globalThis.isNaN; | ||
| // ============================================================================ | ||
| // Global Type Checking (legacy, less strict) | ||
| // ============================================================================ | ||
| /** | ||
| * (Safe copy) Global isNaN function (coerces to number first, less strict than Number.isNaN). | ||
| */ | ||
| const globalIsNaN = _isNaN; | ||
| /** | ||
| * Normalizes a given time to the nearest base time window. | ||
@@ -361,15 +689,59 @@ * | ||
| function normalizeToBaseTimeWindow(time, baseTimeWindow) { | ||
| if (!time || !(time instanceof Date) || isNaN(time.getTime())) { | ||
| throw new Error('Invalid time input'); | ||
| if (!time || !(time instanceof Date) || globalIsNaN(time.getTime())) { | ||
| throw createError('Invalid time input'); | ||
| } | ||
| if (baseTimeWindow <= 0) { | ||
| throw new Error('Base time window must be positive'); | ||
| throw createError('Base time window must be positive'); | ||
| } | ||
| const timeInMs = time.getTime(); | ||
| const windowInMs = baseTimeWindow * 60 * 1000; | ||
| const normalizedTimeInMs = Math.floor(timeInMs / windowInMs) * windowInMs; | ||
| return new Date(normalizedTimeInMs); | ||
| const normalizedTimeInMs = floor(timeInMs / windowInMs) * windowInMs; | ||
| return createDate(normalizedTimeInMs); | ||
| } | ||
| /** | ||
| * Safe copies of Promise built-in methods via factory functions. | ||
| * | ||
| * Since constructors cannot be safely captured via Object.assign, this module | ||
| * provides factory functions that use Reflect.construct internally. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/promise | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Promise = globalThis.Promise; | ||
| /** | ||
| * (Safe copy) Returns a Promise that resolves with the given value. | ||
| */ | ||
| _Promise.resolve.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Returns a Promise that rejects with the given reason. | ||
| */ | ||
| _Promise.reject.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Returns a Promise that resolves when all promises resolve. | ||
| */ | ||
| _Promise.all.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Returns a Promise that resolves/rejects with the first settled promise. | ||
| */ | ||
| _Promise.race.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Returns a Promise that resolves when all promises settle. | ||
| */ | ||
| _Promise.allSettled.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Returns a Promise that resolves with the first fulfilled promise. | ||
| */ | ||
| _Promise.any.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Creates a Promise along with its resolve and reject functions. | ||
| * Note: Available only in ES2024+ environments. | ||
| */ | ||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| _Promise.withResolvers?.bind(_Promise); | ||
| /** | ||
| * Creates a time-based one-time password (TOTP) generator function. | ||
@@ -384,5 +756,5 @@ * Generates passwords that change based on time windows, supporting previous/current/next window offsets. | ||
| if (getType(windowOffset) !== 'number' || windowOffset < -1 || 1 < windowOffset) { | ||
| throw new Error('Window offset must be -1, 0, or 1.'); | ||
| throw createError('Window offset must be -1, 0, or 1.'); | ||
| } | ||
| const offsetTime = new Date(currentUtcTime.getTime() + windowOffset * baseTimeWindow * 60000); | ||
| const offsetTime = createDate(currentUtcTime.getTime() + windowOffset * baseTimeWindow * 60000); | ||
| return await createHash(randomPseudoTimeBased(normalizeToBaseTimeWindow(offsetTime, baseTimeWindow)).toString()); | ||
@@ -405,3 +777,3 @@ }; | ||
| * Creates a factory function that generates time-based password generators for multiple time windows. | ||
| * Returns an object with methods to generate passwords for current, previous, and next time windows. | ||
| * Returns a frozen object with methods to generate passwords for current, previous, and next time windows. | ||
| * | ||
@@ -416,3 +788,4 @@ * @param getTimeBasedPassword - Function to generate a single time-based password with window offset | ||
| const next = () => getTimeBasedPassword(currentUtcTime, baseTimeWindow, 1); | ||
| return { current, previous, next }; | ||
| // Freeze to prevent runtime modification of password generator methods | ||
| return freeze({ current, previous, next }); | ||
| }; | ||
@@ -419,0 +792,0 @@ } |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.iife.js","sources":["../../../../../../../../libs/utils/string/src/lib/shared-consts.ts","../../../../../../../../libs/utils/string/src/lib/array-buffer-to-utf8-string/array-buffer-to-utf8-string.ts","../../../../../../../../libs/utils/string/src/lib/utf8-string-to-uint8-array/browser/utf8-string-to-uint8-array.ts","../../../../../../../../libs/cryptography/src/lib/subtle/browser.ts","../../../../../../../../libs/cryptography/src/lib/create-hash/browser.ts","../../../../../../../../libs/cryptography/src/lib/get-random-values/browser.ts","../../../../../../../../libs/utils/data/src/shared/consts.ts","../../../../../../../../libs/utils/data/src/get-type.ts","../../../../../../../../libs/cryptography/src/lib/encryption-config.ts","../../../../../../../../libs/cryptography/src/lib/generate-key/create-key-generator.ts","../../../../../../../../libs/cryptography/src/lib/generate-key/browser.ts","../../../../../../../../libs/cryptography/src/lib/encrypt/create-encrypt.ts","../../../../../../../../libs/cryptography/src/lib/encrypt/browser.ts","../../../../../../../../libs/cryptography/src/lib/decrypt/create-decrypt.ts","../../../../../../../../libs/cryptography/src/lib/decrypt/browser.ts","../../../../../../../../libs/cryptography/src/lib/create-vault/create-value-creator.ts","../../../../../../../../libs/cryptography/src/lib/create-vault/browser.ts","../../../../../../../../libs/utils/random-generator/src/random-pseudo.ts","../../../../../../../../libs/utils/random-generator/src/random-pseudo-time-based.ts","../../../../../../../../libs/utils/time/src/normalize-to-base-time-window.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-password/create-get-time-based-password.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-password/browser.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/create-get-time-based-passwords.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/browser.ts","../../../../../../../../libs/cryptography/src/lib/is-sha-256-hash.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":[],"mappings":";;;IAAuB,IAAI,WAAW;IAC/B,MAAM,YAAY,GAAG,IAAI,WAAW,CAAC,MAAM,CAAC;;ICC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,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC;YACvD;IACA,QAAA,MAAM,UAAU,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,GAAG,YAAY,GAAG,cAAc,GAAG,KAAK,CAAC;IAE7F,QAAA,OAAO,MAAM,UAAU,CAAC,qBAAqB,CAAC,yBAAyB,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;IAClH,IAAA,CAAC;IACH;;ICpBA;;;;;;;;IAQG;UACU,oBAAoB,GAAG,0BAA0B,CAAC,UAAU;;ICVzE;;;;;;IAMG;IACG,SAAU,wBAAwB,CACtC,oBAAkH,EAAA;IAElH,IAAA,OAAO,SAAS,qBAAqB,CAAC,cAAc,EAAE,cAAc,EAAA;IAClE,QAAA,MAAM,OAAO,GAAG,MAAM,oBAAoB,CAAC,cAAc,EAAE,cAAc,EAAE,CAAC,CAAC;IAC7E,QAAA,MAAM,QAAQ,GAAG,MAAM,oBAAoB,CAAC,cAAc,EAAE,cAAc,EAAE,EAAE,CAAC;IAC/E,QAAA,MAAM,IAAI,GAAG,MAAM,oBAAoB,CAAC,cAAc,EAAE,cAAc,EAAE,CAAC,CAAC;IAC1E,QAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE;IACpC,IAAA,CAAC;IACH;;ICfA;;;;;;;IAOG;UACU,qBAAqB,GAAG,wBAAwB,CAAC,oBAAoB;;ICTlF;;;;;;IAMG;IACG,SAAU,YAAY,CAAC,IAAa,EAAA;IACxC,IAAA,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,QAAQ,GAAG,iBAAiB,CAAC,IAAI,CAAS,IAAI,CAAC,GAAG,KAAK;IAClF;;;;;;;;;;;;;;;;;;;;"} | ||
| {"version":3,"file":"index.iife.js","sources":["../../../../../../../../libs/utils/immutable-api/src/built-in-copy/array/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/error/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/typed-arrays/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/encoding/index.ts","../../../../../../../../libs/utils/string/src/lib/shared-consts.ts","../../../../../../../../libs/utils/string/src/lib/array-buffer-to-utf8-string/array-buffer-to-utf8-string.ts","../../../../../../../../libs/utils/string/src/lib/utf8-string-to-uint8-array/browser/utf8-string-to-uint8-array.ts","../../../../../../../../libs/cryptography/src/lib/subtle/browser.ts","../../../../../../../../libs/cryptography/src/lib/create-hash/browser.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/object/index.ts","../../../../../../../../libs/utils/data/src/shared/consts.ts","../../../../../../../../libs/utils/data/src/get-type.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/map/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/date/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/math/index.ts","../../../../../../../../libs/cryptography/src/lib/encryption-config.ts","../../../../../../../../libs/cryptography/src/lib/generate-key/create-key-generator.ts","../../../../../../../../libs/cryptography/src/lib/generate-key/browser.ts","../../../../../../../../libs/cryptography/src/lib/decrypt/create-decrypt.ts","../../../../../../../../libs/cryptography/src/lib/decrypt/browser.ts","../../../../../../../../libs/cryptography/src/lib/get-random-values/browser.ts","../../../../../../../../libs/cryptography/src/lib/encrypt/create-encrypt.ts","../../../../../../../../libs/cryptography/src/lib/encrypt/browser.ts","../../../../../../../../libs/cryptography/src/lib/create-vault/create-value-creator.ts","../../../../../../../../libs/cryptography/src/lib/create-vault/browser.ts","../../../../../../../../libs/utils/random-generator/src/random-pseudo.ts","../../../../../../../../libs/utils/random-generator/src/random-pseudo-time-based.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/number/index.ts","../../../../../../../../libs/utils/time/src/normalize-to-base-time-window.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/promise/index.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-password/create-get-time-based-password.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-password/browser.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/create-get-time-based-passwords.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/browser.ts","../../../../../../../../libs/cryptography/src/lib/is-sha-256-hash.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["_Reflect"],"mappings":";;;IAAA;;;;;;;IAOG;IAEH;IACA,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK;IAG/B;;IAEG;IACI,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO;IAErC;;IAEG;IACI,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI;;ICrB/B;;;;;;;;;;IAUG;IAEH;IACA,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK;IAQ/B,MAAMA,UAAQ,GAAG,UAAU,CAAC,OAAO;IAGnC;;;;;;;IAOG;IACI,MAAM,WAAW,GAAG,CAAC,OAAgB,EAAE,OAAsB,KAAmBA,UAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;;IChCrI;;;;;;;;IAQG;IAEH;IACA,MAAM,YAAY,GAAG,UAAU,CAAC,WAAW;IAC3C,MAAM,kBAAkB,GAAG,UAAU,CAAC,iBAAiB;IAEvD,MAAM,WAAW,GAAG,UAAU,CAAC,UAAU;IACzC,MAAM,kBAAkB,GAAG,UAAU,CAAC,iBAAiB;IACvD,MAAM,YAAY,GAAG,UAAU,CAAC,WAAW;IAC3C,MAAM,YAAY,GAAG,UAAU,CAAC,WAAW;IAC3C,MAAM,UAAU,GAAG,UAAU,CAAC,SAAS;IACvC,MAAM,WAAW,GAAG,UAAU,CAAC,UAAU;IACzC,MAAM,WAAW,GAAG,UAAU,CAAC,UAAU;IACzC,MAAM,aAAa,GAAG,UAAU,CAAC,YAAY;IAC7C,MAAM,aAAa,GAAG,UAAU,CAA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AAC,CAAC;IAC7E,QAAA,MAAM,QAAQ,GAAG,MAAM,oBAAoB,CAAC,cAAc,EAAE,cAAc,EAAE,EAAE,CAAC;IAC/E,QAAA,MAAM,IAAI,GAAG,MAAM,oBAAoB,CAAC,cAAc,EAAE,cAAc,EAAE,CAAC,CAAC;;YAE1E,OAAO,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC5C,IAAA,CAAC;IACH;;ICjBA;;;;;;;IAOG;UACU,qBAAqB,GAAG,wBAAwB,CAAC,oBAAoB;;ICTlF;;;;;;IAMG;IACG,SAAU,YAAY,CAAC,IAAa,EAAA;IACxC,IAAA,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,QAAQ,GAAG,iBAAiB,CAAC,IAAI,CAAS,IAAI,CAAC,GAAG,KAAK;IAClF;;;;;;;;;;;;;;;;;;;;"} |
@@ -1,2 +0,2 @@ | ||
| var HyperfrontendCryptography=function(t){"use strict";new TextEncoder;const e=new TextDecoder("utf8");function r(t){return(new TextEncoder).encode(t)}const n=globalThis.crypto.subtle;async function o(t,e="SHA-256"){try{return Array.from(new Uint8Array(await n.digest(e,r(t)))).map(t=>t.toString(16).padStart(2,"0")).join("")}catch{throw new Error("Error creating hash")}}function a(t){if(!t)throw new Error("Cannot generate random values without a byte length.");return globalThis.crypto.getRandomValues(new Uint8Array(t))}const i=[],s=t=>{if(null===t)return"null";const e=typeof t;if("object"===e){if(Array.isArray(t))return"array";for(const e of i)if(t instanceof e)return e.name}return e},u={name:"AES-GCM"};const c=function(t,e){return async function(r,n){if("string"!==s(r))throw new Error("Cannot generate key without a password type string");if(0===r.length)throw new Error("Cannot generate key with an empty string as password");if(!n)throw new Error("Cannot generate key without a salt");const o=await t.importKey("raw",e(r),{name:"PBKDF2"},!1,["deriveKey"]);return t.deriveKey({name:"PBKDF2",salt:n,iterations:1e5,hash:"SHA-256"},o,{...u,length:256},!1,["encrypt","decrypt"])}}(n,r);const w=function(t,e,r,n){return async function(o,a){if(!o)throw new Error("Cannot encrypt an empty message.");if(!a)throw new Error("Cannot encrypt without a password.");const i=e(16),s=e(12),c=await r(a,i),w=await n.encrypt({...u,iv:s},c,t(o)),f=new Uint8Array(w),l=new Uint8Array(i.byteLength+s.byteLength+f.byteLength);return l.set(i,0),l.set(s,i.byteLength),l.set(f,i.byteLength+s.byteLength),l}}(r,a,c,n);const f=function(t,e,r){return async function(n,o){if(!n||!n.length)throw new Error("Cannot decrypt without a message");if(!o)throw new Error("Cannot decrypt without a password");const a=n.slice(0,16),i=n.slice(16,28),s=n.slice(28),c=await e(o,a),w=await r.decrypt({...u,iv:i},c,s);return t(w)}}(function(t){return e.decode(t)},c,n);const l=function(t,e,r){return function(n=!1){let o=Array.from(t(16)).map(t=>t.toString(16).padStart(2,"0")).join(""),a=!1,i=!1,s=new Map;function u(){s.clear(),s=null,o=null,i=!0}return Object.create(null,{write:{value:async function(t,r){if(i)throw new Error("Vault is closed.");if(!t)throw new Error("Label is required.");if(!r)throw new Error("Value is required.");const n=await e(r,o);s.set(t,n)},enumerable:!1,writable:!1,configurable:!1},read:{value:async function(t,e){if(i)throw new Error("Vault is closed.");if(!t)throw new Error("Label is required.");if(!e)throw new Error("Password is required.");const o=s.get(t);if(!o)return null;const a=await r(o,e);return n&&u(),a},enumerable:!1,writable:!1,configurable:!1},getPassword:{value:function(){if(i)throw new Error("Vault is closed.");return a?null:(a=!0,o)},enumerable:!1,writable:!1,configurable:!1},close:{value:u,enumerable:!1,writable:!1,configurable:!1}})}}(a,w,f);function y(t){return function(t){const e=1e4*Math.sin(t);return e-Math.floor(e)}(t.getTime())}const h=function(t){return async function(e,r,n=0){if("number"!==s(n)||n<-1||1<n)throw new Error("Window offset must be -1, 0, or 1.");const o=new Date(e.getTime()+n*r*6e4);return await t(y(function(t,e){if(!t||!(t instanceof Date)||isNaN(t.getTime()))throw new Error("Invalid time input");if(e<=0)throw new Error("Base time window must be positive");const r=t.getTime(),n=60*e*1e3,o=Math.floor(r/n)*n;return new Date(o)}(o,r)).toString())}}(o);const g=function(t){return function(e,r){return{current:()=>t(e,r,0),previous:()=>t(e,r,-1),next:()=>t(e,r,1)}}}(h);return t.createHash=o,t.createVault=l,t.decrypt=f,t.encrypt=w,t.encryptionConfig=u,t.generateKey=c,t.getRandomValues=a,t.getTimeBasedPassword=h,t.getTimeBasedPasswords=g,t.isSHA256Hash=function(t){return"string"===s(t)&&/^[a-f0-9]{64}$/i.test(t)},t.subtle=n,t}({}); | ||
| var HyperfrontendCryptography=function(t){"use strict";const n=globalThis.Array,e=n.isArray,r=n.from,o=globalThis.Error,i=globalThis.Reflect,a=(t,n)=>i.construct(o,[t,n]),s=globalThis.ArrayBuffer,l=globalThis.SharedArrayBuffer,c=globalThis.Uint8Array,u=globalThis.Uint8ClampedArray,f=globalThis.Uint16Array,b=globalThis.Uint32Array,h=globalThis.Int8Array,g=globalThis.Int16Array,d=globalThis.Int32Array,y=globalThis.Float32Array,w=globalThis.Float64Array,m=globalThis.BigInt64Array,T=globalThis.BigUint64Array,p=globalThis.Reflect;function A(t,n,e){return"number"==typeof t?p.construct(c,[t]):t instanceof s||t instanceof l?p.construct(c,[t,n,e]):p.construct(c,[t])}c.from.bind(c),c.of.bind(c),u.from.bind(u),u.of.bind(u),f.from.bind(f),f.of.bind(f),b.from.bind(b),b.of.bind(b),h.from.bind(h),h.of.bind(h),g.from.bind(g),g.of.bind(g),d.from.bind(d),d.of.bind(d),y.from.bind(y),y.of.bind(y),w.from.bind(w),w.of.bind(w),m.from.bind(m),m.of.bind(m),T.from.bind(T),T.of.bind(T);const v=globalThis.TextEncoder,C=globalThis.TextDecoder,S=globalThis.Reflect,B=()=>S.construct(v,[]);B();const L=(R="utf8",S.construct(C,[R,P]));var R,P;function V(t){return B().encode(t)}A([104,101,108,108,111]),A([227,129,147,227,130,147,227,129,171,227,129,161,227,129,175]),A([]);const H=globalThis.crypto.subtle;async function K(t,n="SHA-256"){try{return r(A(await H.digest(n,V(t)))).map(t=>t.toString(16).padStart(2,"0")).join("")}catch{throw a("Error creating hash")}}const j=globalThis.Object,D=j.freeze,I=j.create,U=[],q=t=>{if(null===t)return"null";const n=typeof t;if("object"===n){if(e(t))return"array";for(const n of U)if(t instanceof n)return n.name}return n},E=globalThis.Map,F=globalThis.Reflect,k=globalThis.Date,x=globalThis.Reflect;function M(...t){return x.construct(k,t)}const N=globalThis.Math,z=N.floor,G=N.sin,O=D({name:"AES-GCM"});const W=function(t,n){return async function(e,r){if("string"!==q(e))throw a("Cannot generate key without a password type string");if(0===e.length)throw a("Cannot generate key with an empty string as password");if(!r)throw a("Cannot generate key without a salt");const o=await t.importKey("raw",n(e),{name:"PBKDF2"},!1,["deriveKey"]);return t.deriveKey({name:"PBKDF2",salt:r,iterations:1e5,hash:"SHA-256"},o,{...O,length:256},!1,["encrypt","decrypt"])}}(H,V);const $=function(t,n,e){return async function(r,o){if(!r||!r.length)throw a("Cannot decrypt without a message");if(!o)throw a("Cannot decrypt without a password");const i=r.slice(0,16),s=r.slice(16,28),l=r.slice(28),c=await n(o,i),u=await e.decrypt({...O,iv:s},c,l);return t(u)}}(function(t){return L.decode(t)},W,H);function J(t){if(!t)throw a("Cannot generate random values without a byte length.");return globalThis.crypto.getRandomValues(A(t))}const Q=function(t,n,e,r){return async function(o,i){if(!o)throw a("Cannot encrypt an empty message.");if(!i)throw a("Cannot encrypt without a password.");const s=n(16),l=n(12),c=await e(i,s),u=A(await r.encrypt({...O,iv:l},c,t(o))),f=A(s.byteLength+l.byteLength+u.byteLength);return f.set(s,0),f.set(l,s.byteLength),f.set(u,s.byteLength+l.byteLength),f}}(V,J,W,H);const X=function(t,n,e){return function(o=!1){let i=r(t(16)).map(t=>t.toString(16).padStart(2,"0")).join(""),s=!1,l=!1,c=F.construct(E,u?[u]:[]);var u;function f(){c.clear(),c=null,i=null,l=!0}const b=I(null,{write:{value:async function(t,e){if(l)throw a("Vault is closed.");if(!t)throw a("Label is required.");if(!e)throw a("Value is required.");const r=await n(e,i);c.set(t,r)},enumerable:!1,writable:!1,configurable:!1},read:{value:async function(t,n){if(l)throw a("Vault is closed.");if(!t)throw a("Label is required.");if(!n)throw a("Password is required.");const r=c.get(t);if(!r)return null;const i=await e(r,n);return o&&f(),i},enumerable:!1,writable:!1,configurable:!1},getPassword:{value:function(){if(l)throw a("Vault is closed.");return s?null:(s=!0,i)},enumerable:!1,writable:!1,configurable:!1},close:{value:f,enumerable:!1,writable:!1,configurable:!1}});return D(b)}}(J,Q,$);function Y(t){return function(t){const n=1e4*G(t);return n-z(n)}(t.getTime())}const Z=globalThis.isNaN;const _=globalThis.Promise;_.resolve.bind(_),_.reject.bind(_),_.all.bind(_),_.race.bind(_),_.allSettled.bind(_),_.any.bind(_),_.withResolvers?.bind(_);const tt=function(t){return async function(n,e,r=0){if("number"!==q(r)||r<-1||1<r)throw a("Window offset must be -1, 0, or 1.");const o=M(n.getTime()+r*e*6e4);return await t(Y(function(t,n){if(!t||!(t instanceof Date)||Z(t.getTime()))throw a("Invalid time input");if(n<=0)throw a("Base time window must be positive");const e=t.getTime(),r=60*n*1e3;return M(z(e/r)*r)}(o,e)).toString())}}(K);const nt=function(t){return function(n,e){return D({current:()=>t(n,e,0),previous:()=>t(n,e,-1),next:()=>t(n,e,1)})}}(tt);return t.createHash=K,t.createVault=X,t.decrypt=$,t.encrypt=Q,t.encryptionConfig=O,t.generateKey=W,t.getRandomValues=J,t.getTimeBasedPassword=tt,t.getTimeBasedPasswords=nt,t.isSHA256Hash=function(t){return"string"===q(t)&&/^[a-f0-9]{64}$/i.test(t)},t.subtle=H,t}({}); | ||
| //# sourceMappingURL=index.iife.min.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.iife.min.js","sources":["../../../../../../../../libs/utils/string/src/lib/shared-consts.ts","../../../../../../../../libs/utils/string/src/lib/utf8-string-to-uint8-array/browser/utf8-string-to-uint8-array.ts","../../../../../../../../libs/cryptography/src/lib/subtle/browser.ts","../../../../../../../../libs/cryptography/src/lib/create-hash/browser.ts","../../../../../../../../libs/cryptography/src/lib/get-random-values/browser.ts","../../../../../../../../libs/utils/data/src/shared/consts.ts","../../../../../../../../libs/utils/data/src/get-type.ts","../../../../../../../../libs/cryptography/src/lib/encryption-config.ts","../../../../../../../../libs/cryptography/src/lib/generate-key/browser.ts","../../../../../../../../libs/cryptography/src/lib/generate-key/create-key-generator.ts","../../../../../../../../libs/cryptography/src/lib/encrypt/browser.ts","../../../../../../../../libs/cryptography/src/lib/encrypt/create-encrypt.ts","../../../../../../../../libs/cryptography/src/lib/decrypt/browser.ts","../../../../../../../../libs/cryptography/src/lib/decrypt/create-decrypt.ts","../../../../../../../../libs/utils/string/src/lib/array-buffer-to-utf8-string/array-buffer-to-utf8-string.ts","../../../../../../../../libs/cryptography/src/lib/create-vault/browser.ts","../../../../../../../../libs/cryptography/src/lib/create-vault/create-value-creator.ts","../../../../../../../../libs/utils/random-generator/src/random-pseudo-time-based.ts","../../../../../../../../libs/utils/random-generator/src/random-pseudo.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-password/browser.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-password/create-get-time-based-password.ts","../../../../../../../../libs/utils/time/src/normalize-to-base-time-window.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/browser.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/create-get-time-based-passwords.ts","../../../../../../../../libs/cryptography/src/lib/is-sha-256-hash.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["TextEncoder","UTF8_DECODER","TextDecoder","utf8StringToUint8Array","text","encode","subtle","globalThis","crypto","async","createHash","data","algorithm","Array","from","Uint8Array","digest","map","b","toString","padStart","join","Error","getRandomValues","byteLength","registeredClasses","getType","target","nativeDataType","isArray","registeredClass","name","encryptionConfig","generateKey","password","salt","length","keyMaterial","importKey","deriveKey","iterations","hash","createKeyGenerator","encrypt","message","iv","key","encryptedContent","buffer","result","set","createEncrypt","decrypt","arrayBufferToUtf8String","encrypted","slice","decryptedContent","createDecrypt","uint8Array","decode","createVault","singleUse","isPasswordAccessed","isVaultClosed","storage","Map","close","clear","Object","create","write","value","label","encryptedValue","enumerable","writable","configurable","read","get","getPassword","createValueCreator","randomPseudoTimeBased","seedTime","seed","x","Math","sin","floor","randomPseudo","getTime","getTimeBasedPassword","currentUtcTime","baseTimeWindow","windowOffset","offsetTime","Date","time","isNaN","timeInMs","windowInMs","normalizedTimeInMs","normalizeToBaseTimeWindow","createGetTimeBasedPassword","getTimeBasedPasswords","current","previous","next","createTimeBasedPasswords","test"],"mappings":"uDAAuB,IAAIA,YACpB,MAAMC,EAAe,IAAIC,YAAY,QCKtC,SAAUC,EAAuBC,GACrC,OAAO,IAAIJ,aAAcK,OAAOD,EAClC,OCRaE,EAAuBC,WAAWC,OAAOF,OCY/CG,eAAeC,EAAWC,EAAcC,EAA2B,WACxE,IACE,OAAOC,MAAMC,KAAK,IAAIC,iBAAiBT,EAAOU,OAAOJ,EAAyBT,EAAuBQ,MAClGM,IAAKC,GAAMA,EAAEC,SAAS,IAAIC,SAAS,EAAG,MACtCC,KAAK,GACV,CAAE,MACA,MAAM,IAAIC,MAAM,sBAClB,CACF,CCbM,SAAUC,EAAgBC,GAC9B,IAAKA,EACH,MAAM,IAAIF,MAAM,wDAElB,OAAOf,WAAWC,OAAOe,gBAAgB,IAAIR,WAAWS,GAC1D,CCTO,MAAMC,EAAoC,GCQpCC,EAAwCC,IACnD,GAAe,OAAXA,EAAiB,MAAU,OAC/B,MAAMC,SAAwBD,EAC9B,GAAuB,WAAnBC,EAA6B,CAC/B,GAAIf,MAAMgB,QAAQF,GAAS,MAAU,QACrC,IAAK,MAAMG,KAAmBL,EAC5B,GAAIE,aAAkBG,EAAiB,OAAUA,EAAgBC,IAErE,CACA,OAAUH,GClBCI,EAA0B,CACrCD,KAAgC,WCC3B,MAAME,ECOP,SACJ3B,EACAH,GAEA,OAAOM,eAA2ByB,E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,CACF,CDPqCe,CAAyBjB,4LEFxD,SAAuBjD,GAC3B,MAAyB,WAAlBf,EAAQe,IAAqB,kBAAkBmE,KAAanE,EACrE"} | ||
| {"version":3,"file":"index.iife.min.js","sources":["../../../../../../../../libs/utils/immutable-api/src/built-in-copy/array/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/error/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/typed-arrays/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/encoding/index.ts","../../../../../../../../libs/utils/string/src/lib/shared-consts.ts","../../../../../../../../libs/utils/string/src/lib/utf8-string-to-uint8-array/browser/utf8-string-to-uint8-array.ts","../../../../../../../../libs/cryptography/src/lib/subtle/browser.ts","../../../../../../../../libs/cryptography/src/lib/create-hash/browser.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/object/index.ts","../../../../../../../../libs/utils/data/src/shared/consts.ts","../../../../../../../../libs/utils/data/src/get-type.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/map/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/date/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/math/index.ts","../../../../../../../../libs/cryptography/src/lib/encryption-config.ts","../../../../../../../../libs/cryptography/src/lib/generate-key/browser.ts","../../../../../../../../libs/cryptography/src/lib/generate-key/create-key-generator.ts","../../../../../../../../libs/cryptography/src/lib/decrypt/browser.ts","../../../../../../../../libs/cryptography/src/lib/decrypt/create-decrypt.ts","../../../../../../../../libs/utils/string/src/lib/array-buffer-to-utf8-string/array-buffer-to-utf8-string.ts","../../../../../../../../libs/cryptography/src/lib/get-random-values/browser.ts","../../../../../../../../libs/cryptography/src/lib/encrypt/browser.ts","../../../../../../../../libs/cryptography/src/lib/encrypt/create-encrypt.ts","../../../../../../../../libs/cryptography/src/lib/create-vault/browser.ts","../../../../../../../../libs/cryptography/src/lib/create-vault/create-value-creator.ts","../../../../../../../../libs/utils/random-generator/src/random-pseudo-time-based.ts","../../../../../../../../libs/utils/random-generator/src/random-pseudo.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/number/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/promise/index.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-password/browser.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-password/create-get-time-based-password.ts","../../../../../../../../libs/utils/time/src/normalize-to-base-time-window.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/browser.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/create-get-time-based-passwords.ts","../../../../../../../../libs/cryptography/src/lib/is-sha-256-hash.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["_Array","globalThis","Array","isArray","from","_Error","Error","_Reflect","Reflect","createError","message","options","construct","_ArrayBuffer","ArrayBuffer","_SharedArrayBuffer","SharedArrayBuffer","_Uint8Array","Uint8Array","_Uint8ClampedArray","Uint8ClampedArray","_Uint16Array","Uint16Array","_Uint32Array","Uint32Array","_Int8Array","Int8Array","_Int16Array","Int16Array","_Int32Array","Int32Array","_Float32Array","Float32Array","_Float64Array","Float64Array","_BigInt64Array","BigInt64Array","_BigUint64Array","BigUint64Array","createUint8Array","arg","byteOffset","length","bind","of","_TextEncoder","TextEncoder","_TextDecoder","TextDecoder","createTextEncoder","UTF8_DECODER","label","utf8StringToUint8Array","text","encode","subtle","crypto","async","createHash","data","algorithm","digest","map","b","toString","padStart","join","_Object","Object","freeze","create","registeredClasses","getType","target","nativeDataType","registeredClass","name","_Map","Map","_Date","Date","createDate","args","_Math","Math","floor","sin","encryptionConfig","generateKey","password","salt","keyMaterial","importKey","deriveKey","iterations","hash","createKeyGenerator","decrypt","arrayBufferToUtf8String","encrypted","slice","iv","key","decryptedContent","createDecrypt","uint8Array","decode","getRandomValues","byteLength","encrypt","buffer","result","set","createEncrypt","createVault","singleUse","isPasswordAccessed","isVaultClosed","storage","iterable","close","clear","vault","write","value","encryptedValue","enumerable","writable","configurable","read","get","getPassword","createValueCreator","randomPseudoTimeBased","seedTime","seed","x","randomPseudo","getTime","globalIsNaN","isNaN","_Promise","Promise","resolve","reject","all","race","allSettled","any","withResolvers","getTimeBasedPassword","currentUtcTime","baseTimeWindow","windowOffset","offsetTime","time","timeInMs","windowInMs","normalizeToBaseTimeWindow","createGetTimeBasedPassword","getTimeBasedPasswords","current","previous","next","createTimeBasedPasswords","test"],"mappings":"uDAUA,MAAMA,EAASC,WAAWC,MAMbC,EAAUH,EAAOG,QAKjBC,EAAOJ,EAAOI,KCRrBC,EAASJ,WAAWK,MAQpBC,EAAWN,WAAWO,QAWfC,EAAc,CAACC,EAAkBC,IAAyCJ,EAASK,UAAUP,EAAQ,CAACK,EAASC,ICrBtHE,EAAeZ,WAAWa,YAC1BC,EAAqBd,WAAWe,kBAEhCC,EAAchB,WAAWiB,WACzBC,EAAqBlB,WAAWmB,kBAChCC,EAAepB,WAAWqB,YAC1BC,EAAetB,WAAWuB,YAC1BC,EAAaxB,WAAWyB,UACxBC,EAAc1B,WAAW2B,WACzBC,EAAc5B,WAAW6B,WACzBC,EAAgB9B,WAAW+B,aAC3BC,EAAgBhC,WAAWiC,aAC3BC,EAAiBlC,WAAWmC,cAC5BC,EAAkBpC,WAAWqC,eAC7B/B,EAAWN,WAAWO,iBAsEZ+B,EACdC,EACAC,EACAC,GAEA,MAAmB,iBAARF,EACUjC,EAASK,UAAUK,EAAa,CAACuB,IAElDA,aAAe3B,GAAgB2B,aAAezB,EAC7BR,EAASK,UAAUK,EAAa,CAACuB,EAAKC,EAAYC,IAEpDnC,EAASK,UAAUK,EAAa,CAACuB,GACtD,CAKsDvB,EAAYb,KAAKuC,KAAK1B,GAK1BA,EAAY2B,GAAGD,KAAK1B,GAmBFE,EAAmBf,KAAKuC,KAAKxB,GAKjCA,EAAmByB,GAAGD,KAAKxB,GAkBnCE,EAAajB,KAAKuC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||
| /** | ||
| * Safe copies of Array built-in static methods. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/array | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Array = globalThis.Array; | ||
| /** | ||
| * (Safe copy) Determines whether the passed value is an Array. | ||
| */ | ||
| const isArray = _Array.isArray; | ||
| /** | ||
| * (Safe copy) Creates an array from an array-like or iterable object. | ||
| */ | ||
| const from = _Array.from; | ||
| /** | ||
| * Safe copies of Error built-ins via factory functions. | ||
| * | ||
| * Since constructors cannot be safely captured via Object.assign, this module | ||
| * provides factory functions that use Reflect.construct internally. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/error | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Error = globalThis.Error; | ||
| const _Reflect$4 = globalThis.Reflect; | ||
| /** | ||
| * (Safe copy) Creates a new Error using the captured Error constructor. | ||
| * Use this instead of `new Error()`. | ||
| * | ||
| * @param message - Optional error message. | ||
| * @param options - Optional error options. | ||
| * @returns A new Error instance. | ||
| */ | ||
| const createError = (message, options) => _Reflect$4.construct(_Error, [message, options]); | ||
| /** | ||
| * Safe copies of TypedArray and ArrayBuffer built-ins via factory functions. | ||
| * | ||
| * Provides safe references to Uint8Array, Int8Array, ArrayBuffer, DataView, etc. | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/typed-arrays | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _ArrayBuffer = globalThis.ArrayBuffer; | ||
| const _SharedArrayBuffer = globalThis.SharedArrayBuffer; | ||
| const _Uint8Array = globalThis.Uint8Array; | ||
| const _Uint8ClampedArray = globalThis.Uint8ClampedArray; | ||
| const _Uint16Array = globalThis.Uint16Array; | ||
| const _Uint32Array = globalThis.Uint32Array; | ||
| const _Int8Array = globalThis.Int8Array; | ||
| const _Int16Array = globalThis.Int16Array; | ||
| const _Int32Array = globalThis.Int32Array; | ||
| const _Float32Array = globalThis.Float32Array; | ||
| const _Float64Array = globalThis.Float64Array; | ||
| const _BigInt64Array = globalThis.BigInt64Array; | ||
| const _BigUint64Array = globalThis.BigUint64Array; | ||
| const _Reflect$3 = globalThis.Reflect; | ||
| function createUint8Array(arg, byteOffset, length) { | ||
| if (typeof arg === 'number') { | ||
| return _Reflect$3.construct(_Uint8Array, [arg]); | ||
| } | ||
| if (arg instanceof _ArrayBuffer || arg instanceof _SharedArrayBuffer) { | ||
| return _Reflect$3.construct(_Uint8Array, [arg, byteOffset, length]); | ||
| } | ||
| return _Reflect$3.construct(_Uint8Array, [arg]); | ||
| } | ||
| /** | ||
| * (Safe copy) Creates a new Uint8Array from an array-like or iterable object. | ||
| */ | ||
| _Uint8Array.from.bind(_Uint8Array); | ||
| /** | ||
| * (Safe copy) Creates a new Uint8Array from a variable number of arguments. | ||
| */ | ||
| _Uint8Array.of.bind(_Uint8Array); | ||
| /** | ||
| * (Safe copy) Creates a new Uint8ClampedArray from an array-like or iterable object. | ||
| */ | ||
| _Uint8ClampedArray.from.bind(_Uint8ClampedArray); | ||
| /** | ||
| * (Safe copy) Creates a new Uint8ClampedArray from a variable number of arguments. | ||
| */ | ||
| _Uint8ClampedArray.of.bind(_Uint8ClampedArray); | ||
| /** | ||
| * (Safe copy) Creates a new Uint16Array from an array-like or iterable object. | ||
| */ | ||
| _Uint16Array.from.bind(_Uint16Array); | ||
| /** | ||
| * (Safe copy) Creates a new Uint16Array from a variable number of arguments. | ||
| */ | ||
| _Uint16Array.of.bind(_Uint16Array); | ||
| /** | ||
| * (Safe copy) Creates a new Uint32Array from an array-like or iterable object. | ||
| */ | ||
| _Uint32Array.from.bind(_Uint32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Uint32Array from a variable number of arguments. | ||
| */ | ||
| _Uint32Array.of.bind(_Uint32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int8Array from an array-like or iterable object. | ||
| */ | ||
| _Int8Array.from.bind(_Int8Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int8Array from a variable number of arguments. | ||
| */ | ||
| _Int8Array.of.bind(_Int8Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int16Array from an array-like or iterable object. | ||
| */ | ||
| _Int16Array.from.bind(_Int16Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int16Array from a variable number of arguments. | ||
| */ | ||
| _Int16Array.of.bind(_Int16Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int32Array from an array-like or iterable object. | ||
| */ | ||
| _Int32Array.from.bind(_Int32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int32Array from a variable number of arguments. | ||
| */ | ||
| _Int32Array.of.bind(_Int32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Float32Array from an array-like or iterable object. | ||
| */ | ||
| _Float32Array.from.bind(_Float32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Float32Array from a variable number of arguments. | ||
| */ | ||
| _Float32Array.of.bind(_Float32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Float64Array from an array-like or iterable object. | ||
| */ | ||
| _Float64Array.from.bind(_Float64Array); | ||
| /** | ||
| * (Safe copy) Creates a new Float64Array from a variable number of arguments. | ||
| */ | ||
| _Float64Array.of.bind(_Float64Array); | ||
| /** | ||
| * (Safe copy) Creates a new BigInt64Array from an array-like or iterable object. | ||
| */ | ||
| _BigInt64Array.from.bind(_BigInt64Array); | ||
| /** | ||
| * (Safe copy) Creates a new BigInt64Array from a variable number of arguments. | ||
| */ | ||
| _BigInt64Array.of.bind(_BigInt64Array); | ||
| /** | ||
| * (Safe copy) Creates a new BigUint64Array from an array-like or iterable object. | ||
| */ | ||
| _BigUint64Array.from.bind(_BigUint64Array); | ||
| /** | ||
| * (Safe copy) Creates a new BigUint64Array from a variable number of arguments. | ||
| */ | ||
| _BigUint64Array.of.bind(_BigUint64Array); | ||
| /** | ||
| * Safe copies of encoding built-ins via factory functions. | ||
| * | ||
| * Provides safe references to TextEncoder, TextDecoder, atob, and btoa. | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/encoding | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _TextEncoder = globalThis.TextEncoder; | ||
| const _TextDecoder = globalThis.TextDecoder; | ||
| const _Reflect$2 = globalThis.Reflect; | ||
| /** | ||
| * (Safe copy) Creates a new TextEncoder using the captured TextEncoder constructor. | ||
| * Use this instead of `new TextEncoder()`. | ||
| * | ||
| * @returns A new TextEncoder instance. | ||
| */ | ||
| const createTextEncoder = () => _Reflect$2.construct(_TextEncoder, []); | ||
| /** | ||
| * (Safe copy) Creates a new TextDecoder using the captured TextDecoder constructor. | ||
| * Use this instead of `new TextDecoder()`. | ||
| * | ||
| * @param label - The encoding label (e.g., 'utf-8', 'utf-16'). Defaults to 'utf-8'. | ||
| * @param options - Optional TextDecoderOptions. | ||
| * @returns A new TextDecoder instance. | ||
| */ | ||
| const createTextDecoder = (label, options) => _Reflect$2.construct(_TextDecoder, [label, options]); | ||
| createTextEncoder(); | ||
| const UTF8_DECODER = createTextDecoder('utf8'); | ||
| ({ | ||
| SIMPLE: { | ||
| ARRAY: createUint8Array([104, 101, 108, 108, 111]), | ||
| }, | ||
| NON_ASCII: { | ||
| ARRAY: createUint8Array([ | ||
| 227, | ||
| 129, | ||
| 147, // こ | ||
| 227, | ||
| 130, | ||
| 147, // ん | ||
| 227, | ||
| 129, | ||
| 171, // に | ||
| 227, | ||
| 129, | ||
| 161, // ち | ||
| 227, | ||
| 129, | ||
| 175, // は | ||
| ]), | ||
| }, | ||
| EMPTY: { | ||
| ARRAY: createUint8Array([]), | ||
| }, | ||
| }); | ||
| /** | ||
| * Converts an ArrayBuffer to a UTF-8 encoded string. | ||
@@ -28,3 +250,3 @@ * | ||
| function utf8StringToUint8Array(text) { | ||
| return new TextEncoder().encode(text); | ||
| return createTextEncoder().encode(text); | ||
| } | ||
@@ -44,3 +266,3 @@ | ||
| try { | ||
| return Array.from(new Uint8Array(await subtle.digest(algorithm, utf8StringToUint8Array(data)))) | ||
| return from(createUint8Array(await subtle.digest(algorithm, utf8StringToUint8Array(data)))) | ||
| .map((b) => b.toString(16).padStart(2, '0')) | ||
@@ -50,3 +272,3 @@ .join(''); | ||
| catch { | ||
| throw new Error('Error creating hash'); | ||
| throw createError('Error creating hash'); | ||
| } | ||
@@ -56,14 +278,20 @@ } | ||
| /** | ||
| * Generates cryptographically secure random values using Web Crypto API (browser implementation). | ||
| * Safe copies of Object built-in methods. | ||
| * | ||
| * @param byteLength - The number of random bytes to generate | ||
| * @returns A Uint8Array containing the random bytes | ||
| * @throws {Error} When byteLength is not provided or is zero | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/object | ||
| */ | ||
| function getRandomValues(byteLength) { | ||
| if (!byteLength) { | ||
| throw new Error('Cannot generate random values without a byte length.'); | ||
| } | ||
| return globalThis.crypto.getRandomValues(new Uint8Array(byteLength)); | ||
| } | ||
| // Capture references at module initialization time | ||
| const _Object = globalThis.Object; | ||
| /** | ||
| * (Safe copy) Prevents modification of existing property attributes and values, | ||
| * and prevents the addition of new properties. | ||
| */ | ||
| const freeze = _Object.freeze; | ||
| /** | ||
| * (Safe copy) Creates an object that has the specified prototype or that has null prototype. | ||
| */ | ||
| const create = _Object.create; | ||
@@ -85,3 +313,3 @@ const registeredClasses = []; | ||
| if (nativeDataType === 'object') { | ||
| if (Array.isArray(target)) | ||
| if (isArray(target)) | ||
| return 'array'; | ||
@@ -96,5 +324,72 @@ for (const registeredClass of registeredClasses) { | ||
| const encryptionConfig = { | ||
| /** | ||
| * Safe copies of Map built-in via factory function. | ||
| * | ||
| * Since constructors cannot be safely captured via Object.assign, this module | ||
| * provides a factory function that uses Reflect.construct internally. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/map | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Map = globalThis.Map; | ||
| const _Reflect$1 = globalThis.Reflect; | ||
| /** | ||
| * (Safe copy) Creates a new Map using the captured Map constructor. | ||
| * Use this instead of `new Map()`. | ||
| * | ||
| * @param iterable - Optional iterable of key-value pairs. | ||
| * @returns A new Map instance. | ||
| */ | ||
| const createMap = (iterable) => _Reflect$1.construct(_Map, iterable ? [iterable] : []); | ||
| /** | ||
| * Safe copies of Date built-in via factory function and static methods. | ||
| * | ||
| * Since constructors cannot be safely captured via Object.assign, this module | ||
| * provides a factory function that uses Reflect.construct internally. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/date | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Date = globalThis.Date; | ||
| const _Reflect = globalThis.Reflect; | ||
| function createDate(...args) { | ||
| return _Reflect.construct(_Date, args); | ||
| } | ||
| /** | ||
| * Safe copies of Math built-in methods. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/math | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Math = globalThis.Math; | ||
| /** | ||
| * (Safe copy) Returns the largest integer less than or equal to a number. | ||
| */ | ||
| const floor = _Math.floor; | ||
| // ============================================================================ | ||
| // Trigonometry | ||
| // ============================================================================ | ||
| /** | ||
| * (Safe copy) Returns the sine of a number. | ||
| */ | ||
| const sin = _Math.sin; | ||
| /** | ||
| * Frozen encryption configuration to prevent runtime tampering. | ||
| * Using AES-GCM as the default algorithm for authenticated encryption. | ||
| */ | ||
| const encryptionConfig = freeze({ | ||
| name: 'AES-GCM', | ||
| }; | ||
| }); | ||
@@ -112,9 +407,9 @@ /** | ||
| if (getType(password) !== 'string') { | ||
| throw new Error('Cannot generate key without a password type string'); | ||
| throw createError('Cannot generate key without a password type string'); | ||
| } | ||
| if (password.length === 0) { | ||
| throw new Error('Cannot generate key with an empty string as password'); | ||
| throw createError('Cannot generate key with an empty string as password'); | ||
| } | ||
| if (!salt) { | ||
| throw new Error('Cannot generate key without a salt'); | ||
| throw createError('Cannot generate key without a salt'); | ||
| } | ||
@@ -137,2 +432,44 @@ const keyMaterial = await subtle.importKey('raw', utf8StringToUint8Array(password), { name: 'PBKDF2' }, false, [ | ||
| /** | ||
| * Creates a decryption function that decrypts AES-GCM encrypted messages using password-derived keys. | ||
| * Extracts salt and IV from the encrypted data to derive the correct decryption key. | ||
| * | ||
| * @param arrayBufferToUtf8String - Function to convert byte arrays to UTF-8 strings | ||
| * @param generateKey - Function to derive decryption keys from passwords | ||
| * @param subtle - The SubtleCrypto interface for cryptographic operations | ||
| * @returns A function that decrypts encrypted messages with passwords | ||
| */ | ||
| function createDecrypt(arrayBufferToUtf8String, generateKey, subtle) { | ||
| return async function decrypt(encrypted, password) { | ||
| if (!encrypted || !encrypted.length) { | ||
| throw createError('Cannot decrypt without a message'); | ||
| } | ||
| if (!password) { | ||
| throw createError('Cannot decrypt without a password'); | ||
| } | ||
| const salt = encrypted.slice(0, 16); | ||
| const iv = encrypted.slice(16, 28); | ||
| const data = encrypted.slice(28); | ||
| const key = await generateKey(password, salt); | ||
| const decryptedContent = await subtle.decrypt({ ...encryptionConfig, iv }, key, data); | ||
| return arrayBufferToUtf8String(decryptedContent); | ||
| }; | ||
| } | ||
| const decrypt = createDecrypt(arrayBufferToUtf8String, generateKey, subtle); | ||
| /** | ||
| * Generates cryptographically secure random values using Web Crypto API (browser implementation). | ||
| * | ||
| * @param byteLength - The number of random bytes to generate | ||
| * @returns A Uint8Array containing the random bytes | ||
| * @throws {Error} When byteLength is not provided or is zero | ||
| */ | ||
| function getRandomValues(byteLength) { | ||
| if (!byteLength) { | ||
| throw createError('Cannot generate random values without a byte length.'); | ||
| } | ||
| return globalThis.crypto.getRandomValues(createUint8Array(byteLength)); | ||
| } | ||
| /** | ||
| * Creates an encryption function that encrypts messages using AES-GCM with password-derived keys. | ||
@@ -150,6 +487,6 @@ * Generates random salt and initialization vector (IV) for each encryption operation. | ||
| if (!message) { | ||
| throw new Error('Cannot encrypt an empty message.'); | ||
| throw createError('Cannot encrypt an empty message.'); | ||
| } | ||
| if (!password) { | ||
| throw new Error('Cannot encrypt without a password.'); | ||
| throw createError('Cannot encrypt without a password.'); | ||
| } | ||
@@ -160,4 +497,4 @@ const salt = getRandomValues(16); | ||
| const encryptedContent = await subtle.encrypt({ ...encryptionConfig, iv: iv }, key, utf8StringToUint8Array(message)); | ||
| const buffer = new Uint8Array(encryptedContent); | ||
| const result = new Uint8Array(salt.byteLength + iv.byteLength + buffer.byteLength); | ||
| const buffer = createUint8Array(encryptedContent); | ||
| const result = createUint8Array(salt.byteLength + iv.byteLength + buffer.byteLength); | ||
| result.set(salt, 0); | ||
@@ -173,30 +510,2 @@ result.set(iv, salt.byteLength); | ||
| /** | ||
| * Creates a decryption function that decrypts AES-GCM encrypted messages using password-derived keys. | ||
| * Extracts salt and IV from the encrypted data to derive the correct decryption key. | ||
| * | ||
| * @param arrayBufferToUtf8String - Function to convert byte arrays to UTF-8 strings | ||
| * @param generateKey - Function to derive decryption keys from passwords | ||
| * @param subtle - The SubtleCrypto interface for cryptographic operations | ||
| * @returns A function that decrypts encrypted messages with passwords | ||
| */ | ||
| function createDecrypt(arrayBufferToUtf8String, generateKey, subtle) { | ||
| return async function decrypt(encrypted, password) { | ||
| if (!encrypted || !encrypted.length) { | ||
| throw new Error('Cannot decrypt without a message'); | ||
| } | ||
| if (!password) { | ||
| throw new Error('Cannot decrypt without a password'); | ||
| } | ||
| const salt = encrypted.slice(0, 16); | ||
| const iv = encrypted.slice(16, 28); | ||
| const data = encrypted.slice(28); | ||
| const key = await generateKey(password, salt); | ||
| const decryptedContent = await subtle.decrypt({ ...encryptionConfig, iv }, key, data); | ||
| return arrayBufferToUtf8String(decryptedContent); | ||
| }; | ||
| } | ||
| const decrypt = createDecrypt(arrayBufferToUtf8String, generateKey, subtle); | ||
| /** | ||
| * Creates a vault factory function that produces encrypted storage instances. | ||
@@ -212,3 +521,3 @@ * Vaults provide secure, password-protected storage for sensitive data with optional single-use mode. | ||
| return function createVault(singleUse = false) { | ||
| let password = Array.from(getRandomValues(16)) | ||
| let password = from(getRandomValues(16)) | ||
| .map((b) => b.toString(16).padStart(2, '0')) | ||
@@ -218,3 +527,3 @@ .join(''); | ||
| let isVaultClosed = false; | ||
| let storage = new Map(); | ||
| let storage = createMap(); | ||
| /** | ||
@@ -230,9 +539,9 @@ * Writes an encrypted value to the vault with the specified label. | ||
| if (isVaultClosed) { | ||
| throw new Error('Vault is closed.'); | ||
| throw createError('Vault is closed.'); | ||
| } | ||
| if (!label) { | ||
| throw new Error('Label is required.'); | ||
| throw createError('Label is required.'); | ||
| } | ||
| if (!value) { | ||
| throw new Error('Value is required.'); | ||
| throw createError('Value is required.'); | ||
| } | ||
@@ -253,9 +562,9 @@ const encryptedValue = await encrypt(value, password); | ||
| if (isVaultClosed) { | ||
| throw new Error('Vault is closed.'); | ||
| throw createError('Vault is closed.'); | ||
| } | ||
| if (!label) { | ||
| throw new Error('Label is required.'); | ||
| throw createError('Label is required.'); | ||
| } | ||
| if (!password) { | ||
| throw new Error('Password is required.'); | ||
| throw createError('Password is required.'); | ||
| } | ||
@@ -281,3 +590,3 @@ const encryptedValue = storage.get(label); | ||
| if (isVaultClosed) { | ||
| throw new Error('Vault is closed.'); | ||
| throw createError('Vault is closed.'); | ||
| } | ||
@@ -300,3 +609,3 @@ if (isPasswordAccessed) { | ||
| } | ||
| const vault = Object.create(null, { | ||
| const vault = create(null, { | ||
| write: { | ||
@@ -327,3 +636,4 @@ value: write, | ||
| }); | ||
| return vault; | ||
| // Freeze to prevent addition of new properties | ||
| return freeze(vault); | ||
| }; | ||
@@ -341,4 +651,4 @@ } | ||
| function randomPseudo(seed) { | ||
| const x = Math.sin(seed) * 10000; | ||
| return x - Math.floor(x); | ||
| const x = sin(seed) * 10000; | ||
| return x - floor(x); | ||
| } | ||
@@ -357,2 +667,20 @@ | ||
| /** | ||
| * Safe copies of Number built-in methods and constants. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/number | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _isNaN = globalThis.isNaN; | ||
| // ============================================================================ | ||
| // Global Type Checking (legacy, less strict) | ||
| // ============================================================================ | ||
| /** | ||
| * (Safe copy) Global isNaN function (coerces to number first, less strict than Number.isNaN). | ||
| */ | ||
| const globalIsNaN = _isNaN; | ||
| /** | ||
| * Normalizes a given time to the nearest base time window. | ||
@@ -365,15 +693,59 @@ * | ||
| function normalizeToBaseTimeWindow(time, baseTimeWindow) { | ||
| if (!time || !(time instanceof Date) || isNaN(time.getTime())) { | ||
| throw new Error('Invalid time input'); | ||
| if (!time || !(time instanceof Date) || globalIsNaN(time.getTime())) { | ||
| throw createError('Invalid time input'); | ||
| } | ||
| if (baseTimeWindow <= 0) { | ||
| throw new Error('Base time window must be positive'); | ||
| throw createError('Base time window must be positive'); | ||
| } | ||
| const timeInMs = time.getTime(); | ||
| const windowInMs = baseTimeWindow * 60 * 1000; | ||
| const normalizedTimeInMs = Math.floor(timeInMs / windowInMs) * windowInMs; | ||
| return new Date(normalizedTimeInMs); | ||
| const normalizedTimeInMs = floor(timeInMs / windowInMs) * windowInMs; | ||
| return createDate(normalizedTimeInMs); | ||
| } | ||
| /** | ||
| * Safe copies of Promise built-in methods via factory functions. | ||
| * | ||
| * Since constructors cannot be safely captured via Object.assign, this module | ||
| * provides factory functions that use Reflect.construct internally. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/promise | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Promise = globalThis.Promise; | ||
| /** | ||
| * (Safe copy) Returns a Promise that resolves with the given value. | ||
| */ | ||
| _Promise.resolve.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Returns a Promise that rejects with the given reason. | ||
| */ | ||
| _Promise.reject.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Returns a Promise that resolves when all promises resolve. | ||
| */ | ||
| _Promise.all.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Returns a Promise that resolves/rejects with the first settled promise. | ||
| */ | ||
| _Promise.race.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Returns a Promise that resolves when all promises settle. | ||
| */ | ||
| _Promise.allSettled.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Returns a Promise that resolves with the first fulfilled promise. | ||
| */ | ||
| _Promise.any.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Creates a Promise along with its resolve and reject functions. | ||
| * Note: Available only in ES2024+ environments. | ||
| */ | ||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| _Promise.withResolvers?.bind(_Promise); | ||
| /** | ||
| * Creates a time-based one-time password (TOTP) generator function. | ||
@@ -388,5 +760,5 @@ * Generates passwords that change based on time windows, supporting previous/current/next window offsets. | ||
| if (getType(windowOffset) !== 'number' || windowOffset < -1 || 1 < windowOffset) { | ||
| throw new Error('Window offset must be -1, 0, or 1.'); | ||
| throw createError('Window offset must be -1, 0, or 1.'); | ||
| } | ||
| const offsetTime = new Date(currentUtcTime.getTime() + windowOffset * baseTimeWindow * 60000); | ||
| const offsetTime = createDate(currentUtcTime.getTime() + windowOffset * baseTimeWindow * 60000); | ||
| return await createHash(randomPseudoTimeBased(normalizeToBaseTimeWindow(offsetTime, baseTimeWindow)).toString()); | ||
@@ -409,3 +781,3 @@ }; | ||
| * Creates a factory function that generates time-based password generators for multiple time windows. | ||
| * Returns an object with methods to generate passwords for current, previous, and next time windows. | ||
| * Returns a frozen object with methods to generate passwords for current, previous, and next time windows. | ||
| * | ||
@@ -420,3 +792,4 @@ * @param getTimeBasedPassword - Function to generate a single time-based password with window offset | ||
| const next = () => getTimeBasedPassword(currentUtcTime, baseTimeWindow, 1); | ||
| return { current, previous, next }; | ||
| // Freeze to prevent runtime modification of password generator methods | ||
| return freeze({ current, previous, next }); | ||
| }; | ||
@@ -423,0 +796,0 @@ } |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.umd.js","sources":["../../../../../../../../libs/utils/string/src/lib/shared-consts.ts","../../../../../../../../libs/utils/string/src/lib/array-buffer-to-utf8-string/array-buffer-to-utf8-string.ts","../../../../../../../../libs/utils/string/src/lib/utf8-string-to-uint8-array/browser/utf8-string-to-uint8-array.ts","../../../../../../../../libs/cryptography/src/lib/subtle/browser.ts","../../../../../../../../libs/cryptography/src/lib/create-hash/browser.ts","../../../../../../../../libs/cryptography/src/lib/get-random-values/browser.ts","../../../../../../../../libs/utils/data/src/shared/consts.ts","../../../../../../../../libs/utils/data/src/get-type.ts","../../../../../../../../libs/cryptography/src/lib/encryption-config.ts","../../../../../../../../libs/cryptography/src/lib/generate-key/create-key-generator.ts","../../../../../../../../libs/cryptography/src/lib/generate-key/browser.ts","../../../../../../../../libs/cryptography/src/lib/encrypt/create-encrypt.ts","../../../../../../../../libs/cryptography/src/lib/encrypt/browser.ts","../../../../../../../../libs/cryptography/src/lib/decrypt/create-decrypt.ts","../../../../../../../../libs/cryptography/src/lib/decrypt/browser.ts","../../../../../../../../libs/cryptography/src/lib/create-vault/create-value-creator.ts","../../../../../../../../libs/cryptography/src/lib/create-vault/browser.ts","../../../../../../../../libs/utils/random-generator/src/random-pseudo.ts","../../../../../../../../libs/utils/random-generator/src/random-pseudo-time-based.ts","../../../../../../../../libs/utils/time/src/normalize-to-base-time-window.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-password/create-get-time-based-password.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-password/browser.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/create-get-time-based-passwords.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/browser.ts","../../../../../../../../libs/cryptography/src/lib/is-sha-256-hash.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":[],"mappings":";;;;;;IAAuB,IAAI,WAAW;IAC/B,MAAM,YAAY,GAAG,IAAI,WAAW,CAAC,MAAM,CAAC;;ICCnD;;;;;IAKG;IACG,SAAU,uBAAuB,CAAC,UAAuB,EAAA;IAC7D,IAAA,OAAO,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC;IACxC;;ICVA;;;;;IAKG;IACG,SAAU,sBAAsB,CAAC,IAAY,EAAA;QACjD,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC;IACvC;;UCRa,MAAM,GAAiB,UAAU,CAAC,MAAM,CAAC;;ICItD;;;;;;;IAOG;IACI,eAAe,UAAU,CAAC,IAAY,EAAE,YAA2B,SAAS,EAAA;IACjF,IAAA,IAAI;YACF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,SAAS,EAAgB,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC;IACzG,aAAA,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;iBAC1C,IAAI,CAAC,EAAE,CAAC;QACb;IAAE,IAAA,MAAM;IACN,QAAA,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC;QACxC;IACF;;ICpBA;;;;;;IAMG;IACG,SAAU,eAAe,CAAC,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QAAQ,EAAE,IAAI,EAAE;IACpC,IAAA,CAAC;IACH;;ICfA;;;;;;;IAOG;UACU,qBAAqB,GAAG,wBAAwB,CAAC,oBAAoB;;ICTlF;;;;;;IAMG;IACG,SAAU,YAAY,CAAC,IAAa,EAAA;IACxC,IAAA,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,QAAQ,GAAG,iBAAiB,CAAC,IAAI,CAAS,IAAI,CAAC,GAAG,KAAK;IAClF;;;;;;;;;;;;;;;;;;"} | ||
| {"version":3,"file":"index.umd.js","sources":["../../../../../../../../libs/utils/immutable-api/src/built-in-copy/array/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/error/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/typed-arrays/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/encoding/index.ts","../../../../../../../../libs/utils/string/src/lib/shared-consts.ts","../../../../../../../../libs/utils/string/src/lib/array-buffer-to-utf8-string/array-buffer-to-utf8-string.ts","../../../../../../../../libs/utils/string/src/lib/utf8-string-to-uint8-array/browser/utf8-string-to-uint8-array.ts","../../../../../../../../libs/cryptography/src/lib/subtle/browser.ts","../../../../../../../../libs/cryptography/src/lib/create-hash/browser.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/object/index.ts","../../../../../../../../libs/utils/data/src/shared/consts.ts","../../../../../../../../libs/utils/data/src/get-type.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/map/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/date/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/math/index.ts","../../../../../../../../libs/cryptography/src/lib/encryption-config.ts","../../../../../../../../libs/cryptography/src/lib/generate-key/create-key-generator.ts","../../../../../../../../libs/cryptography/src/lib/generate-key/browser.ts","../../../../../../../../libs/cryptography/src/lib/decrypt/create-decrypt.ts","../../../../../../../../libs/cryptography/src/lib/decrypt/browser.ts","../../../../../../../../libs/cryptography/src/lib/get-random-values/browser.ts","../../../../../../../../libs/cryptography/src/lib/encrypt/create-encrypt.ts","../../../../../../../../libs/cryptography/src/lib/encrypt/browser.ts","../../../../../../../../libs/cryptography/src/lib/create-vault/create-value-creator.ts","../../../../../../../../libs/cryptography/src/lib/create-vault/browser.ts","../../../../../../../../libs/utils/random-generator/src/random-pseudo.ts","../../../../../../../../libs/utils/random-generator/src/random-pseudo-time-based.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/number/index.ts","../../../../../../../../libs/utils/time/src/normalize-to-base-time-window.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/promise/index.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-password/create-get-time-based-password.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-password/browser.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/create-get-time-based-passwords.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/browser.ts","../../../../../../../../libs/cryptography/src/lib/is-sha-256-hash.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["_Reflect"],"mappings":";;;;;;IAAA;;;;;;;IAOG;IAEH;IACA,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK;IAG/B;;IAEG;IACI,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO;IAErC;;IAEG;IACI,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI;;ICrB/B;;;;;;;;;;IAUG;IAEH;IACA,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK;IAQ/B,MAAMA,UAAQ,GAAG,UAAU,CAAC,OAAO;IAGnC;;;;;;;IAOG;IACI,MAAM,WAAW,GAAG,CAAC,OAAgB,EAAE,OAAsB,KAAmBA,UAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;;IChCrI;;;;;;;;IAQG;IAEH;IACA,MAAM,YAAY,GAAG,UA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G,YAAY,GAAG,cAAc,GAAG,KAAK,CAAC;IAE/F,QAAA,OAAO,MAAM,UAAU,CAAC,qBAAqB,CAAC,yBAAyB,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;IAClH,IAAA,CAAC;IACH;;ICtBA;;;;;;;;IAQG;UACU,oBAAoB,GAAG,0BAA0B,CAAC,UAAU;;ICTzE;;;;;;IAMG;IACG,SAAU,wBAAwB,CACtC,oBAAkH,EAAA;IAElH,IAAA,OAAO,SAAS,qBAAqB,CAAC,cAAc,EAAE,cAAc,EAAA;IAClE,QAAA,MAAM,OAAO,GAAG,MAAM,oBAAoB,CAAC,cAAc,EAAE,cAAc,EAAE,CAAC,CAAC;IAC7E,QAAA,MAAM,QAAQ,GAAG,MAAM,oBAAoB,CAAC,cAAc,EAAE,cAAc,EAAE,EAAE,CAAC;IAC/E,QAAA,MAAM,IAAI,GAAG,MAAM,oBAAoB,CAAC,cAAc,EAAE,cAAc,EAAE,CAAC,CAAC;;YAE1E,OAAO,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC5C,IAAA,CAAC;IACH;;ICjBA;;;;;;;IAOG;UACU,qBAAqB,GAAG,wBAAwB,CAAC,oBAAoB;;ICTlF;;;;;;IAMG;IACG,SAAU,YAAY,CAAC,IAAa,EAAA;IACxC,IAAA,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,QAAQ,GAAG,iBAAiB,CAAC,IAAI,CAAS,IAAI,CAAC,GAAG,KAAK;IAClF;;;;;;;;;;;;;;;;;;"} |
@@ -1,2 +0,2 @@ | ||
| !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).HyperfrontendCryptography={})}(this,function(e){"use strict";new TextEncoder;const t=new TextDecoder("utf8");function r(e){return(new TextEncoder).encode(e)}const n=globalThis.crypto.subtle;async function o(e,t="SHA-256"){try{return Array.from(new Uint8Array(await n.digest(t,r(e)))).map(e=>e.toString(16).padStart(2,"0")).join("")}catch{throw new Error("Error creating hash")}}function i(e){if(!e)throw new Error("Cannot generate random values without a byte length.");return globalThis.crypto.getRandomValues(new Uint8Array(e))}const a=[],s=e=>{if(null===e)return"null";const t=typeof e;if("object"===t){if(Array.isArray(e))return"array";for(const t of a)if(e instanceof t)return t.name}return t},u={name:"AES-GCM"};const c=function(e,t){return async function(r,n){if("string"!==s(r))throw new Error("Cannot generate key without a password type string");if(0===r.length)throw new Error("Cannot generate key with an empty string as password");if(!n)throw new Error("Cannot generate key without a salt");const o=await e.importKey("raw",t(r),{name:"PBKDF2"},!1,["deriveKey"]);return e.deriveKey({name:"PBKDF2",salt:n,iterations:1e5,hash:"SHA-256"},o,{...u,length:256},!1,["encrypt","decrypt"])}}(n,r);const w=function(e,t,r,n){return async function(o,i){if(!o)throw new Error("Cannot encrypt an empty message.");if(!i)throw new Error("Cannot encrypt without a password.");const a=t(16),s=t(12),c=await r(i,a),w=await n.encrypt({...u,iv:s},c,e(o)),f=new Uint8Array(w),l=new Uint8Array(a.byteLength+s.byteLength+f.byteLength);return l.set(a,0),l.set(s,a.byteLength),l.set(f,a.byteLength+s.byteLength),l}}(r,i,c,n);const f=function(e,t,r){return async function(n,o){if(!n||!n.length)throw new Error("Cannot decrypt without a message");if(!o)throw new Error("Cannot decrypt without a password");const i=n.slice(0,16),a=n.slice(16,28),s=n.slice(28),c=await t(o,i),w=await r.decrypt({...u,iv:a},c,s);return e(w)}}(function(e){return t.decode(e)},c,n);const l=function(e,t,r){return function(n=!1){let o=Array.from(e(16)).map(e=>e.toString(16).padStart(2,"0")).join(""),i=!1,a=!1,s=new Map;function u(){s.clear(),s=null,o=null,a=!0}return Object.create(null,{write:{value:async function(e,r){if(a)throw new Error("Vault is closed.");if(!e)throw new Error("Label is required.");if(!r)throw new Error("Value is required.");const n=await t(r,o);s.set(e,n)},enumerable:!1,writable:!1,configurable:!1},read:{value:async function(e,t){if(a)throw new Error("Vault is closed.");if(!e)throw new Error("Label is required.");if(!t)throw new Error("Password is required.");const o=s.get(e);if(!o)return null;const i=await r(o,t);return n&&u(),i},enumerable:!1,writable:!1,configurable:!1},getPassword:{value:function(){if(a)throw new Error("Vault is closed.");return i?null:(i=!0,o)},enumerable:!1,writable:!1,configurable:!1},close:{value:u,enumerable:!1,writable:!1,configurable:!1}})}}(i,w,f);function y(e){return function(e){const t=1e4*Math.sin(e);return t-Math.floor(t)}(e.getTime())}const h=function(e){return async function(t,r,n=0){if("number"!==s(n)||n<-1||1<n)throw new Error("Window offset must be -1, 0, or 1.");const o=new Date(t.getTime()+n*r*6e4);return await e(y(function(e,t){if(!e||!(e instanceof Date)||isNaN(e.getTime()))throw new Error("Invalid time input");if(t<=0)throw new Error("Base time window must be positive");const r=e.getTime(),n=60*t*1e3,o=Math.floor(r/n)*n;return new Date(o)}(o,r)).toString())}}(o);const d=function(e){return function(t,r){return{current:()=>e(t,r,0),previous:()=>e(t,r,-1),next:()=>e(t,r,1)}}}(h);e.createHash=o,e.createVault=l,e.decrypt=f,e.encrypt=w,e.encryptionConfig=u,e.generateKey=c,e.getRandomValues=i,e.getTimeBasedPassword=h,e.getTimeBasedPasswords=d,e.isSHA256Hash=function(e){return"string"===s(e)&&/^[a-f0-9]{64}$/i.test(e)},e.subtle=n}); | ||
| !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).HyperfrontendCryptography={})}(this,function(t){"use strict";const n=globalThis.Array,e=n.isArray,r=n.from,o=globalThis.Error,i=globalThis.Reflect,a=(t,n)=>i.construct(o,[t,n]),s=globalThis.ArrayBuffer,l=globalThis.SharedArrayBuffer,c=globalThis.Uint8Array,u=globalThis.Uint8ClampedArray,f=globalThis.Uint16Array,b=globalThis.Uint32Array,d=globalThis.Int8Array,h=globalThis.Int16Array,g=globalThis.Int32Array,y=globalThis.Float32Array,w=globalThis.Float64Array,m=globalThis.BigInt64Array,p=globalThis.BigUint64Array,T=globalThis.Reflect;function A(t,n,e){return"number"==typeof t?T.construct(c,[t]):t instanceof s||t instanceof l?T.construct(c,[t,n,e]):T.construct(c,[t])}c.from.bind(c),c.of.bind(c),u.from.bind(u),u.of.bind(u),f.from.bind(f),f.of.bind(f),b.from.bind(b),b.of.bind(b),d.from.bind(d),d.of.bind(d),h.from.bind(h),h.of.bind(h),g.from.bind(g),g.of.bind(g),y.from.bind(y),y.of.bind(y),w.from.bind(w),w.of.bind(w),m.from.bind(m),m.of.bind(m),p.from.bind(p),p.of.bind(p);const v=globalThis.TextEncoder,C=globalThis.TextDecoder,S=globalThis.Reflect,B=()=>S.construct(v,[]);B();const L=(R="utf8",S.construct(C,[R,P]));var R,P;function V(t){return B().encode(t)}A([104,101,108,108,111]),A([227,129,147,227,130,147,227,129,171,227,129,161,227,129,175]),A([]);const j=globalThis.crypto.subtle;async function x(t,n="SHA-256"){try{return r(A(await j.digest(n,V(t)))).map(t=>t.toString(16).padStart(2,"0")).join("")}catch{throw a("Error creating hash")}}const H=globalThis.Object,K=H.freeze,D=H.create,I=[],U=t=>{if(null===t)return"null";const n=typeof t;if("object"===n){if(e(t))return"array";for(const n of I)if(t instanceof n)return n.name}return n},q=globalThis.Map,E=globalThis.Reflect,F=globalThis.Date,k=globalThis.Reflect;function M(...t){return k.construct(F,t)}const N=globalThis.Math,z=N.floor,G=N.sin,O=K({name:"AES-GCM"});const W=function(t,n){return async function(e,r){if("string"!==U(e))throw a("Cannot generate key without a password type string");if(0===e.length)throw a("Cannot generate key with an empty string as password");if(!r)throw a("Cannot generate key without a salt");const o=await t.importKey("raw",n(e),{name:"PBKDF2"},!1,["deriveKey"]);return t.deriveKey({name:"PBKDF2",salt:r,iterations:1e5,hash:"SHA-256"},o,{...O,length:256},!1,["encrypt","decrypt"])}}(j,V);const $=function(t,n,e){return async function(r,o){if(!r||!r.length)throw a("Cannot decrypt without a message");if(!o)throw a("Cannot decrypt without a password");const i=r.slice(0,16),s=r.slice(16,28),l=r.slice(28),c=await n(o,i),u=await e.decrypt({...O,iv:s},c,l);return t(u)}}(function(t){return L.decode(t)},W,j);function J(t){if(!t)throw a("Cannot generate random values without a byte length.");return globalThis.crypto.getRandomValues(A(t))}const Q=function(t,n,e,r){return async function(o,i){if(!o)throw a("Cannot encrypt an empty message.");if(!i)throw a("Cannot encrypt without a password.");const s=n(16),l=n(12),c=await e(i,s),u=A(await r.encrypt({...O,iv:l},c,t(o))),f=A(s.byteLength+l.byteLength+u.byteLength);return f.set(s,0),f.set(l,s.byteLength),f.set(u,s.byteLength+l.byteLength),f}}(V,J,W,j);const X=function(t,n,e){return function(o=!1){let i=r(t(16)).map(t=>t.toString(16).padStart(2,"0")).join(""),s=!1,l=!1,c=E.construct(q,u?[u]:[]);var u;function f(){c.clear(),c=null,i=null,l=!0}const b=D(null,{write:{value:async function(t,e){if(l)throw a("Vault is closed.");if(!t)throw a("Label is required.");if(!e)throw a("Value is required.");const r=await n(e,i);c.set(t,r)},enumerable:!1,writable:!1,configurable:!1},read:{value:async function(t,n){if(l)throw a("Vault is closed.");if(!t)throw a("Label is required.");if(!n)throw a("Password is required.");const r=c.get(t);if(!r)return null;const i=await e(r,n);return o&&f(),i},enumerable:!1,writable:!1,configurable:!1},getPassword:{value:function(){if(l)throw a("Vault is closed.");return s?null:(s=!0,i)},enumerable:!1,writable:!1,configurable:!1},close:{value:f,enumerable:!1,writable:!1,configurable:!1}});return K(b)}}(J,Q,$);function Y(t){return function(t){const n=1e4*G(t);return n-z(n)}(t.getTime())}const Z=globalThis.isNaN;const _=globalThis.Promise;_.resolve.bind(_),_.reject.bind(_),_.all.bind(_),_.race.bind(_),_.allSettled.bind(_),_.any.bind(_),_.withResolvers?.bind(_);const tt=function(t){return async function(n,e,r=0){if("number"!==U(r)||r<-1||1<r)throw a("Window offset must be -1, 0, or 1.");const o=M(n.getTime()+r*e*6e4);return await t(Y(function(t,n){if(!t||!(t instanceof Date)||Z(t.getTime()))throw a("Invalid time input");if(n<=0)throw a("Base time window must be positive");const e=t.getTime(),r=60*n*1e3;return M(z(e/r)*r)}(o,e)).toString())}}(x);const nt=function(t){return function(n,e){return K({current:()=>t(n,e,0),previous:()=>t(n,e,-1),next:()=>t(n,e,1)})}}(tt);t.createHash=x,t.createVault=X,t.decrypt=$,t.encrypt=Q,t.encryptionConfig=O,t.generateKey=W,t.getRandomValues=J,t.getTimeBasedPassword=tt,t.getTimeBasedPasswords=nt,t.isSHA256Hash=function(t){return"string"===U(t)&&/^[a-f0-9]{64}$/i.test(t)},t.subtle=j}); | ||
| //# sourceMappingURL=index.umd.min.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.umd.min.js","sources":["../../../../../../../../libs/utils/string/src/lib/shared-consts.ts","../../../../../../../../libs/utils/string/src/lib/utf8-string-to-uint8-array/browser/utf8-string-to-uint8-array.ts","../../../../../../../../libs/cryptography/src/lib/subtle/browser.ts","../../../../../../../../libs/cryptography/src/lib/create-hash/browser.ts","../../../../../../../../libs/cryptography/src/lib/get-random-values/browser.ts","../../../../../../../../libs/utils/data/src/shared/consts.ts","../../../../../../../../libs/utils/data/src/get-type.ts","../../../../../../../../libs/cryptography/src/lib/encryption-config.ts","../../../../../../../../libs/cryptography/src/lib/generate-key/browser.ts","../../../../../../../../libs/cryptography/src/lib/generate-key/create-key-generator.ts","../../../../../../../../libs/cryptography/src/lib/encrypt/browser.ts","../../../../../../../../libs/cryptography/src/lib/encrypt/create-encrypt.ts","../../../../../../../../libs/cryptography/src/lib/decrypt/browser.ts","../../../../../../../../libs/cryptography/src/lib/decrypt/create-decrypt.ts","../../../../../../../../libs/utils/string/src/lib/array-buffer-to-utf8-string/array-buffer-to-utf8-string.ts","../../../../../../../../libs/cryptography/src/lib/create-vault/browser.ts","../../../../../../../../libs/cryptography/src/lib/create-vault/create-value-creator.ts","../../../../../../../../libs/utils/random-generator/src/random-pseudo-time-based.ts","../../../../../../../../libs/utils/random-generator/src/random-pseudo.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-password/browser.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-password/create-get-time-based-password.ts","../../../../../../../../libs/utils/time/src/normalize-to-base-time-window.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/browser.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/create-get-time-based-passwords.ts","../../../../../../../../libs/cryptography/src/lib/is-sha-256-hash.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["TextEncoder","UTF8_DECODER","TextDecoder","utf8StringToUint8Array","text","encode","subtle","globalThis","crypto","async","createHash","data","algorithm","Array","from","Uint8Array","digest","map","b","toString","padStart","join","Error","getRandomValues","byteLength","registeredClasses","getType","target","nativeDataType","isArray","registeredClass","name","encryptionConfig","generateKey","password","salt","length","keyMaterial","importKey","deriveKey","iterations","hash","createKeyGenerator","encrypt","message","iv","key","encryptedContent","buffer","result","set","createEncrypt","decrypt","arrayBufferToUtf8String","encrypted","slice","decryptedContent","createDecrypt","uint8Array","decode","createVault","singleUse","isPasswordAccessed","isVaultClosed","storage","Map","close","clear","Object","create","write","value","label","encryptedValue","enumerable","writable","configurable","read","get","getPassword","createValueCreator","randomPseudoTimeBased","seedTime","seed","x","Math","sin","floor","randomPseudo","getTime","getTimeBasedPassword","currentUtcTime","baseTimeWindow","windowOffset","offsetTime","Date","time","isNaN","timeInMs","windowInMs","normalizedTimeInMs","normalizeToBaseTimeWindow","createGetTimeBasedPassword","getTimeBasedPasswords","current","previous","next","createTimeBasedPasswords","test"],"mappings":"gQAAuB,IAAIA,YACpB,MAAMC,EAAe,IAAIC,YAAY,QCKtC,SAAUC,EAAuBC,GACrC,OAAO,IAAIJ,aAAcK,OAAOD,EAClC,OCRaE,EAAuBC,WAAWC,OAAOF,OCY/CG,eAAeC,EAAWC,EAAcC,EAA2B,WACxE,IACE,O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AElB,MAAMwE,EAAa,IAAIC,KAAKJ,EAAeF,UAAYI,EAAeD,EAAiB,KAEvF,aAAalF,EAAWuE,ECdtB,SAAoCe,EAAYJ,GACpD,IAAKI,KAAUA,aAAgBD,OAASE,MAAMD,EAAKP,WACjD,MAAM,IAAInE,MAAM,sBAGlB,GAAIsE,GAAkB,EACpB,MAAM,IAAItE,MAAM,qCAGlB,MAAM4E,EAAWF,EAAKP,UAChBU,EAA8B,GAAjBP,EAAsB,IACnCQ,EAAqBf,KAAKE,MAAMW,EAAWC,GAAcA,EAC/D,OAAO,IAAIJ,KAAKK,EAClB,CDCkDC,CAA0BP,EAAYF,IAAiBzE,WACvG,CACF,CDXoCmF,CAA2B5F,SGDlD6F,ECFP,SACJb,GAEA,OAAO,SAA+BC,EAAgBC,GAIpD,MAAO,CAAEY,QAHO,IAAMd,EAAqBC,EAAgBC,EAAgB,GAGzDa,SAFD,IAAMf,EAAqBC,EAAgBC,GAAgB,GAEhDc,KADf,IAAMhB,EAAqBC,EAAgBC,EAAgB,GAE1E,CACF,CDPqCe,CAAyBjB,qLEFxD,SAAuBjD,GAC3B,MAAyB,WAAlBf,EAAQe,IAAqB,kBAAkBmE,KAAanE,EACrE"} | ||
| {"version":3,"file":"index.umd.min.js","sources":["../../../../../../../../libs/utils/immutable-api/src/built-in-copy/array/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/error/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/typed-arrays/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/encoding/index.ts","../../../../../../../../libs/utils/string/src/lib/shared-consts.ts","../../../../../../../../libs/utils/string/src/lib/utf8-string-to-uint8-array/browser/utf8-string-to-uint8-array.ts","../../../../../../../../libs/cryptography/src/lib/subtle/browser.ts","../../../../../../../../libs/cryptography/src/lib/create-hash/browser.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/object/index.ts","../../../../../../../../libs/utils/data/src/shared/consts.ts","../../../../../../../../libs/utils/data/src/get-type.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/map/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/date/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/math/index.ts","../../../../../../../../libs/cryptography/src/lib/encryption-config.ts","../../../../../../../../libs/cryptography/src/lib/generate-key/browser.ts","../../../../../../../../libs/cryptography/src/lib/generate-key/create-key-generator.ts","../../../../../../../../libs/cryptography/src/lib/decrypt/browser.ts","../../../../../../../../libs/cryptography/src/lib/decrypt/create-decrypt.ts","../../../../../../../../libs/utils/string/src/lib/array-buffer-to-utf8-string/array-buffer-to-utf8-string.ts","../../../../../../../../libs/cryptography/src/lib/get-random-values/browser.ts","../../../../../../../../libs/cryptography/src/lib/encrypt/browser.ts","../../../../../../../../libs/cryptography/src/lib/encrypt/create-encrypt.ts","../../../../../../../../libs/cryptography/src/lib/create-vault/browser.ts","../../../../../../../../libs/cryptography/src/lib/create-vault/create-value-creator.ts","../../../../../../../../libs/utils/random-generator/src/random-pseudo-time-based.ts","../../../../../../../../libs/utils/random-generator/src/random-pseudo.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/number/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/promise/index.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-password/browser.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-password/create-get-time-based-password.ts","../../../../../../../../libs/utils/time/src/normalize-to-base-time-window.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/browser.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/create-get-time-based-passwords.ts","../../../../../../../../libs/cryptography/src/lib/is-sha-256-hash.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["_Array","globalThis","Array","isArray","from","_Error","Error","_Reflect","Reflect","createError","message","options","construct","_ArrayBuffer","ArrayBuffer","_SharedArrayBuffer","SharedArrayBuffer","_Uint8Array","Uint8Array","_Uint8ClampedArray","Uint8ClampedArray","_Uint16Array","Uint16Array","_Uint32Array","Uint32Array","_Int8Array","Int8Array","_Int16Array","Int16Array","_Int32Array","Int32Array","_Float32Array","Float32Array","_Float64Array","Float64Array","_BigInt64Array","BigInt64Array","_BigUint64Array","BigUint64Array","createUint8Array","arg","byteOffset","length","bind","of","_TextEncoder","TextEncoder","_TextDecoder","TextDecoder","createTextEncoder","UTF8_DECODER","label","utf8StringToUint8Array","text","encode","subtle","crypto","async","createHash","data","algorithm","digest","map","b","toString","padStart","join","_Object","Object","freeze","create","registeredClasses","getType","target","nativeDataType","registeredClass","name","_Map","Map","_Date","Date","createDate","args","_Math","Math","floor","sin","encryptionConfig","generateKey","password","salt","keyMaterial","importKey","deriveKey","iterations","hash","createKeyGenerator","decrypt","arrayBufferToUtf8String","encrypted","slice","iv","key","decryptedContent","createDecrypt","uint8Array","decode","getRandomValues","byteLength","encrypt","buffer","result","set","createEncrypt","createVault","singleUse","isPasswordAccessed","isVaultClosed","storage","iterable","close","clear","vault","write","value","encryptedValue","enumerable","writable","configurable","read","get","getPassword","createValueCreator","randomPseudoTimeBased","seedTime","seed","x","randomPseudo","getTime","globalIsNaN","isNaN","_Promise","Promise","resolve","reject","all","race","allSettled","any","withResolvers","getTimeBasedPassword","currentUtcTime","baseTimeWindow","windowOffset","offsetTime","time","timeInMs","windowInMs","normalizeToBaseTimeWindow","createGetTimeBasedPassword","getTimeBasedPasswords","current","previous","next","createTimeBasedPasswords","test"],"mappings":"gQAUA,MAAMA,EAASC,WAAWC,MAMbC,EAAUH,EAAOG,QAKjBC,EAAOJ,EAAOI,KCRrBC,EAASJ,WAAWK,MAQpBC,EAAWN,WAAWO,QAWfC,EAAc,CAACC,EAAkBC,IAAyCJ,EAASK,UAAUP,EAAQ,CAACK,EAASC,ICrBtHE,EAAeZ,WAAWa,YAC1BC,EAAqBd,WAAWe,kBAEhCC,EAAchB,WA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Y,sBAGpB,GAAI+I,GAAkB,EACpB,MAAM/I,EAAY,qCAGpB,MAAMmJ,EAAWD,EAAKjB,UAChBmB,EAA8B,GAAjBL,EAAsB,IAEzC,OAAOvE,EADoBI,EAAMuE,EAAWC,GAAcA,EAE5D,CDFkDC,CAA0BJ,EAAYF,IAAiBxF,WACvG,CACF,CDboC+F,CAA2BrG,SGDlDsG,GCDP,SACJV,GAEA,OAAO,SAA+BC,EAAgBC,GAKpD,OAAOnF,EAAO,CAAE4F,QAJA,IAAMX,EAAqBC,EAAgBC,EAAgB,GAIlDU,SAHR,IAAMZ,EAAqBC,EAAgBC,GAAgB,GAGzCW,KAFtB,IAAMb,EAAqBC,EAAgBC,EAAgB,IAG1E,CACF,CDTqCY,CAAyBd,wLEFxD,SAAuBvD,GAC3B,MAAyB,WAAlBvB,EAAQuB,IAAqB,kBAAkBsE,KAAatE,EACrE"} |
+8
-0
@@ -5,2 +5,10 @@ # Changelog | ||
| ## [0.0.3](https://github.com/AndrewRedican/hyperfrontend/compare/lib-cryptography@0.0.2...lib-cryptography@0.0.3) (2026-03-02) | ||
| ### Bug Fixes | ||
| * **lib-cryptography:** correct package exports ([651fae9](https://github.com/AndrewRedican/hyperfrontend/commit/651fae94622e6300f6351216f3be342aaa9e4962)) | ||
| * **lib-cryptography:** prevent runtime modification of security-sensitive objects ([4af1411](https://github.com/AndrewRedican/hyperfrontend/commit/4af14115c6128fc5939539282f49abf26723f9ac)) | ||
| ## [0.0.2](https://github.com/AndrewRedican/hyperfrontend/compare/lib-cryptography@0.0.1...lib-cryptography@0.0.2) (2026-02-26) | ||
@@ -7,0 +15,0 @@ |
+16
-1
@@ -6,2 +6,17 @@ 'use strict'; | ||
| /** | ||
| * Safe copies of Array built-in static methods. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/array | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Array = globalThis.Array; | ||
| /** | ||
| * (Safe copy) Determines whether the passed value is an Array. | ||
| */ | ||
| const isArray = _Array.isArray; | ||
| /** | ||
| * Returns the data type of the target. | ||
@@ -19,3 +34,3 @@ * Uses native `typeof` operator, however, makes distinction between `null`, `array`, and `object`. | ||
| if (nativeDataType === 'object') { | ||
| if (Array.isArray(target)) | ||
| if (isArray(target)) | ||
| return 'array'; | ||
@@ -22,0 +37,0 @@ for (const registeredClass of registeredClasses) { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.cjs.js","sources":["../../../../../../../../libs/utils/data/src/shared/consts.ts","../../../../../../../../libs/utils/data/src/get-type.ts","../../../../../../../../libs/cryptography/src/lib/is-sha-256-hash.ts"],"sourcesContent":[null,null,null],"names":[],"mappings":";;AAGO,MAAM,iBAAiB,GAAmB,EAAE;;ACAnD;;;;;;;AAOG;AACI,MAAM,OAAO,GAAG,CAA8B,MAAe,KAAO;IACzE,IAAI,MAAM,KAAK,IAAI;AAAE,QAAA,OAAU,MAAM;AACrC,IAAA,MAAM,cAAc,GAAG,OAAO,MAAM;AACpC,IAAA,IAAI,cAAc,KAAK,QAAQ,EAAE;AAC/B,QAAA,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;AAAE,YAAA,OAAU,OAAO;AAC5C,QAAA,KAAK,MAAM,eAAe,IAAI,iBAAiB,EAAE;YAC/C,IAAI,MAAM,YAAY,eAAe;gBAAE,OAAU,eAAe,CAAC,IAAI;QACvE;IACF;AACA,IAAA,OAAU,cAAc;AAC1B,CAAC;;ACnBD;;;;;;AAMG;AACG,SAAU,YAAY,CAAC,IAAa,EAAA;AACxC,IAAA,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,QAAQ,GAAG,iBAAiB,CAAC,IAAI,CAAS,IAAI,CAAC,GAAG,KAAK;AAClF;;;;"} | ||
| {"version":3,"file":"index.cjs.js","sources":["../../../../../../../../libs/utils/data/src/shared/consts.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/array/index.ts","../../../../../../../../libs/utils/data/src/get-type.ts","../../../../../../../../libs/cryptography/src/lib/is-sha-256-hash.ts"],"sourcesContent":[null,null,null,null],"names":[],"mappings":";;AAIO,MAAM,iBAAiB,GAAmB,EAAE;;ACJnD;;;;;;;AAOG;AAEH;AACA,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK;AAG/B;;AAEG;AACI,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO;;ACZrC;;;;;;;AAOG;AACI,MAAM,OAAO,GAAG,CAA8B,MAAe,KAAO;IACzE,IAAI,MAAM,KAAK,IAAI;AAAE,QAAA,OAAU,MAAM;AACrC,IAAA,MAAM,cAAc,GAAG,OAAO,MAAM;AACpC,IAAA,IAAI,cAAc,KAAK,QAAQ,EAAE;QAC/B,IAAI,OAAO,CAAC,MAAM,CAAC;AAAE,YAAA,OAAU,OAAO;AACtC,QAAA,KAAK,MAAM,eAAe,IAAI,iBAAiB,EAAE;YAC/C,IAAI,MAAM,YAAY,eAAe;gBAAE,OAAU,eAAe,CAAC,IAAI;QACvE;IACF;AACA,IAAA,OAAU,cAAc;AAC1B,CAAC;;ACpBD;;;;;;AAMG;AACG,SAAU,YAAY,CAAC,IAAa,EAAA;AACxC,IAAA,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,QAAQ,GAAG,iBAAiB,CAAC,IAAI,CAAS,IAAI,CAAC,GAAG,KAAK;AAClF;;;;"} |
+16
-1
| const registeredClasses = []; | ||
| /** | ||
| * Safe copies of Array built-in static methods. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/array | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Array = globalThis.Array; | ||
| /** | ||
| * (Safe copy) Determines whether the passed value is an Array. | ||
| */ | ||
| const isArray = _Array.isArray; | ||
| /** | ||
| * Returns the data type of the target. | ||
@@ -16,3 +31,3 @@ * Uses native `typeof` operator, however, makes distinction between `null`, `array`, and `object`. | ||
| if (nativeDataType === 'object') { | ||
| if (Array.isArray(target)) | ||
| if (isArray(target)) | ||
| return 'array'; | ||
@@ -19,0 +34,0 @@ for (const registeredClass of registeredClasses) { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.esm.js","sources":["../../../../../../../../libs/utils/data/src/shared/consts.ts","../../../../../../../../libs/utils/data/src/get-type.ts","../../../../../../../../libs/cryptography/src/lib/is-sha-256-hash.ts"],"sourcesContent":[null,null,null],"names":[],"mappings":"AAGO,MAAM,iBAAiB,GAAmB,EAAE;;ACAnD;;;;;;;AAOG;AACI,MAAM,OAAO,GAAG,CAA8B,MAAe,KAAO;IACzE,IAAI,MAAM,KAAK,IAAI;AAAE,QAAA,OAAU,MAAM;AACrC,IAAA,MAAM,cAAc,GAAG,OAAO,MAAM;AACpC,IAAA,IAAI,cAAc,KAAK,QAAQ,EAAE;AAC/B,QAAA,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;AAAE,YAAA,OAAU,OAAO;AAC5C,QAAA,KAAK,MAAM,eAAe,IAAI,iBAAiB,EAAE;YAC/C,IAAI,MAAM,YAAY,eAAe;gBAAE,OAAU,eAAe,CAAC,IAAI;QACvE;IACF;AACA,IAAA,OAAU,cAAc;AAC1B,CAAC;;ACnBD;;;;;;AAMG;AACG,SAAU,YAAY,CAAC,IAAa,EAAA;AACxC,IAAA,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,QAAQ,GAAG,iBAAiB,CAAC,IAAI,CAAS,IAAI,CAAC,GAAG,KAAK;AAClF;;;;"} | ||
| {"version":3,"file":"index.esm.js","sources":["../../../../../../../../libs/utils/data/src/shared/consts.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/array/index.ts","../../../../../../../../libs/utils/data/src/get-type.ts","../../../../../../../../libs/cryptography/src/lib/is-sha-256-hash.ts"],"sourcesContent":[null,null,null,null],"names":[],"mappings":"AAIO,MAAM,iBAAiB,GAAmB,EAAE;;ACJnD;;;;;;;AAOG;AAEH;AACA,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK;AAG/B;;AAEG;AACI,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO;;ACZrC;;;;;;;AAOG;AACI,MAAM,OAAO,GAAG,CAA8B,MAAe,KAAO;IACzE,IAAI,MAAM,KAAK,IAAI;AAAE,QAAA,OAAU,MAAM;AACrC,IAAA,MAAM,cAAc,GAAG,OAAO,MAAM;AACpC,IAAA,IAAI,cAAc,KAAK,QAAQ,EAAE;QAC/B,IAAI,OAAO,CAAC,MAAM,CAAC;AAAE,YAAA,OAAU,OAAO;AACtC,QAAA,KAAK,MAAM,eAAe,IAAI,iBAAiB,EAAE;YAC/C,IAAI,MAAM,YAAY,eAAe;gBAAE,OAAU,eAAe,CAAC,IAAI;QACvE;IACF;AACA,IAAA,OAAU,cAAc;AAC1B,CAAC;;ACpBD;;;;;;AAMG;AACG,SAAU,YAAY,CAAC,IAAa,EAAA;AACxC,IAAA,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,QAAQ,GAAG,iBAAiB,CAAC,IAAI,CAAS,IAAI,CAAC,GAAG,KAAK;AAClF;;;;"} |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/cryptography/src/lib/create-hash/browser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAI5C;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,GAAE,aAAyB,GAAG,OAAO,CAAC,MAAM,CAAC,CAQpG"} | ||
| {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/cryptography/src/lib/create-hash/browser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAO5C;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,GAAE,aAAyB,GAAG,OAAO,CAAC,MAAM,CAAC,CAQpG"} |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/cryptography/src/lib/create-hash/node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAG5C;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,GAAE,aAAyB,GAAG,OAAO,CAAC,MAAM,CAAC,CASpG"} | ||
| {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/cryptography/src/lib/create-hash/node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAK5C;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,GAAE,aAAyB,GAAG,OAAO,CAAC,MAAM,CAAC,CASpG"} |
@@ -1,2 +0,2 @@ | ||
| export declare const createVault: (singleUse?: boolean) => import("./model").Vault; | ||
| export declare const createVault: (singleUse?: boolean) => Readonly<import("./model").Vault>; | ||
| //# sourceMappingURL=browser.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/cryptography/src/lib/create-vault/browser.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,WAAW,kDAAwD,CAAA"} | ||
| {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/cryptography/src/lib/create-vault/browser.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,WAAW,4DAAwD,CAAA"} |
@@ -11,3 +11,3 @@ import type { Vault } from './model'; | ||
| */ | ||
| export declare function createValueCreator(getRandomValues: (byteLength: number) => Uint8Array, encrypt: (message: string, password: string) => Promise<Uint8Array>, decrypt: (encrypted: Uint8Array, password: string) => Promise<string>): (singleUse?: boolean) => Vault; | ||
| export declare function createValueCreator(getRandomValues: (byteLength: number) => Uint8Array, encrypt: (message: string, password: string) => Promise<Uint8Array>, decrypt: (encrypted: Uint8Array, password: string) => Promise<string>): (singleUse?: boolean) => Readonly<Vault>; | ||
| //# sourceMappingURL=create-value-creator.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"create-value-creator.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/cryptography/src/lib/create-vault/create-value-creator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEpC;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,eAAe,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,UAAU,EACnD,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,EACnE,OAAO,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,GACpE,CAAC,SAAS,CAAC,EAAE,OAAO,KAAK,KAAK,CAyHhC"} | ||
| {"version":3,"file":"create-value-creator.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/cryptography/src/lib/create-vault/create-value-creator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAMpC;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,eAAe,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,UAAU,EACnD,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,EACnE,OAAO,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,GACpE,CAAC,SAAS,CAAC,EAAE,OAAO,KAAK,QAAQ,CAAC,KAAK,CAAC,CA0H1C"} |
| export interface Vault { | ||
| write(label: string, value: string): Promise<void>; | ||
| read(label: string, password: string): Promise<string | null>; | ||
| getPassword(): string; | ||
| close(): void; | ||
| readonly write: (label: string, value: string) => Promise<void>; | ||
| readonly read: (label: string, password: string) => Promise<string | null>; | ||
| readonly getPassword: () => string | null; | ||
| readonly close: () => void; | ||
| } | ||
| //# sourceMappingURL=model.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/cryptography/src/lib/create-vault/model.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,KAAK;IACpB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAClD,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IAC7D,WAAW,IAAI,MAAM,CAAA;IACrB,KAAK,IAAI,IAAI,CAAA;CACd"} | ||
| {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/cryptography/src/lib/create-vault/model.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC/D,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IAC1E,QAAQ,CAAC,WAAW,EAAE,MAAM,MAAM,GAAG,IAAI,CAAA;IACzC,QAAQ,CAAC,KAAK,EAAE,MAAM,IAAI,CAAA;CAC3B"} |
@@ -1,2 +0,2 @@ | ||
| export declare const createVault: (singleUse?: boolean) => import("./model").Vault; | ||
| export declare const createVault: (singleUse?: boolean) => Readonly<import("./model").Vault>; | ||
| //# sourceMappingURL=node.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/cryptography/src/lib/create-vault/node.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,WAAW,kDAAwD,CAAA"} | ||
| {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/cryptography/src/lib/create-vault/node.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,WAAW,4DAAwD,CAAA"} |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"create-decrypt.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/cryptography/src/lib/decrypt/create-decrypt.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,uBAAuB,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,MAAM,EACvD,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC,SAAS,CAAC,EACvE,MAAM,EAAE,YAAY,GACnB,CAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAe9D"} | ||
| {"version":3,"file":"create-decrypt.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/cryptography/src/lib/decrypt/create-decrypt.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,uBAAuB,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,MAAM,EACvD,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC,SAAS,CAAC,EACvE,MAAM,EAAE,YAAY,GACnB,CAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAe9D"} |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"create-encrypt.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/cryptography/src/lib/encrypt/create-encrypt.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,sBAAsB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,UAAU,EACpD,eAAe,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,UAAU,EACnD,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC,SAAS,CAAC,EACvE,MAAM,EAAE,YAAY,GACnB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAuB5D"} | ||
| {"version":3,"file":"create-encrypt.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/cryptography/src/lib/encrypt/create-encrypt.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,sBAAsB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,UAAU,EACpD,eAAe,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,UAAU,EACnD,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC,SAAS,CAAC,EACvE,MAAM,EAAE,YAAY,GACnB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAuB5D"} |
| import type { EncryptionConfig } from './encryption-config.model'; | ||
| export declare const encryptionConfig: { | ||
| readonly name: EncryptionConfig["name"]; | ||
| }; | ||
| /** | ||
| * Frozen encryption configuration to prevent runtime tampering. | ||
| * Using AES-GCM as the default algorithm for authenticated encryption. | ||
| */ | ||
| export declare const encryptionConfig: Readonly<{ | ||
| name: EncryptionConfig['name']; | ||
| }>; | ||
| //# sourceMappingURL=encryption-config.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"encryption-config.d.ts","sourceRoot":"","sources":["../../../../../../../libs/cryptography/src/lib/encryption-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAEjE,eAAO,MAAM,gBAAgB;mBACpB,gBAAgB,CAAC,MAAM,CAAC;CAChC,CAAA"} | ||
| {"version":3,"file":"encryption-config.d.ts","sourceRoot":"","sources":["../../../../../../../libs/cryptography/src/lib/encryption-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAGjE;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC;IAAE,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;CAAE,CAExE,CAAA"} |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"create-key-generator.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/cryptography/src/lib/generate-key/create-key-generator.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,EACpB,sBAAsB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,UAAU,GACnD,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC,SAAS,CAAC,CA4B5D"} | ||
| {"version":3,"file":"create-key-generator.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/cryptography/src/lib/generate-key/create-key-generator.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,EACpB,sBAAsB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,UAAU,GACnD,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC,SAAS,CAAC,CA4B5D"} |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/cryptography/src/lib/get-random-values/browser.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,CAK9D"} | ||
| {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/cryptography/src/lib/get-random-values/browser.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,CAK9D"} |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/cryptography/src/lib/get-random-values/node.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,CAK9D"} | ||
| {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/cryptography/src/lib/get-random-values/node.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,CAK9D"} |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"create-get-time-based-password.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/cryptography/src/lib/get-time-based-password/create-get-time-based-password.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAKzD;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,aAAa,KAAK,OAAO,CAAC,MAAM,CAAC,GACvE,CAAC,cAAc,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,CAS9F"} | ||
| {"version":3,"file":"create-get-time-based-password.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/cryptography/src/lib/get-time-based-password/create-get-time-based-password.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAOzD;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,aAAa,KAAK,OAAO,CAAC,MAAM,CAAC,GACvE,CAAC,cAAc,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,CAS9F"} |
@@ -9,3 +9,3 @@ /** | ||
| */ | ||
| export declare const getTimeBasedPasswords: (currentUtcTime: Date, baseTimeWindow: number) => import("./model").TimeBasedPasswordGenerators; | ||
| export declare const getTimeBasedPasswords: (currentUtcTime: Date, baseTimeWindow: number) => Readonly<import("./model").TimeBasedPasswordGenerators>; | ||
| //# sourceMappingURL=browser.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/browser.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,iGAAiD,CAAA"} | ||
| {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/browser.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,2GAAiD,CAAA"} |
| import type { TimeBasedPasswordGenerators } from './model'; | ||
| /** | ||
| * Creates a factory function that generates time-based password generators for multiple time windows. | ||
| * Returns an object with methods to generate passwords for current, previous, and next time windows. | ||
| * Returns a frozen object with methods to generate passwords for current, previous, and next time windows. | ||
| * | ||
@@ -9,3 +9,3 @@ * @param getTimeBasedPassword - Function to generate a single time-based password with window offset | ||
| */ | ||
| export declare function createTimeBasedPasswords(getTimeBasedPassword: (currentUtcTime: Date, baseTimeWindow: number, windowOffset?: -1 | 0 | 1) => Promise<string>): (currentUtcTime: Date, baseTimeWindow: number) => TimeBasedPasswordGenerators; | ||
| export declare function createTimeBasedPasswords(getTimeBasedPassword: (currentUtcTime: Date, baseTimeWindow: number, windowOffset?: -1 | 0 | 1) => Promise<string>): (currentUtcTime: Date, baseTimeWindow: number) => Readonly<TimeBasedPasswordGenerators>; | ||
| //# sourceMappingURL=create-get-time-based-passwords.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"create-get-time-based-passwords.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/create-get-time-based-passwords.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAA;AAE1D;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,oBAAoB,EAAE,CAAC,cAAc,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,GACjH,CAAC,cAAc,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,KAAK,2BAA2B,CAO/E"} | ||
| {"version":3,"file":"create-get-time-based-passwords.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/create-get-time-based-passwords.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAA;AAG1D;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,oBAAoB,EAAE,CAAC,cAAc,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,GACjH,CAAC,cAAc,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,KAAK,QAAQ,CAAC,2BAA2B,CAAC,CAQzF"} |
| export interface TimeBasedPasswordGenerators { | ||
| current: () => Promise<string>; | ||
| previous: () => Promise<string>; | ||
| next: () => Promise<string>; | ||
| readonly current: () => Promise<string>; | ||
| readonly previous: () => Promise<string>; | ||
| readonly next: () => Promise<string>; | ||
| } | ||
| //# sourceMappingURL=model.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/model.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;IAC9B,QAAQ,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;IAC/B,IAAI,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;CAC5B"} | ||
| {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/model.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;IACvC,QAAQ,CAAC,QAAQ,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;CACrC"} |
@@ -9,3 +9,3 @@ /** | ||
| */ | ||
| export declare const getTimeBasedPasswords: (currentUtcTime: Date, baseTimeWindow: number) => import("./model").TimeBasedPasswordGenerators; | ||
| export declare const getTimeBasedPasswords: (currentUtcTime: Date, baseTimeWindow: number) => Readonly<import("./model").TimeBasedPasswordGenerators>; | ||
| //# sourceMappingURL=node.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/node.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,iGAAiD,CAAA"} | ||
| {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/node.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,2GAAiD,CAAA"} |
+455
-73
@@ -6,2 +6,79 @@ 'use strict'; | ||
| /** | ||
| * Safe copies of Error built-ins via factory functions. | ||
| * | ||
| * Since constructors cannot be safely captured via Object.assign, this module | ||
| * provides factory functions that use Reflect.construct internally. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/error | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Error = globalThis.Error; | ||
| const _Reflect$5 = globalThis.Reflect; | ||
| /** | ||
| * (Safe copy) Creates a new Error using the captured Error constructor. | ||
| * Use this instead of `new Error()`. | ||
| * | ||
| * @param message - Optional error message. | ||
| * @param options - Optional error options. | ||
| * @returns A new Error instance. | ||
| */ | ||
| const createError = (message, options) => _Reflect$5.construct(_Error, [message, options]); | ||
| /** | ||
| * Safe copies of Promise built-in methods via factory functions. | ||
| * | ||
| * Since constructors cannot be safely captured via Object.assign, this module | ||
| * provides factory functions that use Reflect.construct internally. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/promise | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Promise = globalThis.Promise; | ||
| const _Reflect$4 = globalThis.Reflect; | ||
| /** | ||
| * (Safe copy) Creates a new Promise using the captured Promise constructor. | ||
| * Use this instead of `new Promise()`. | ||
| * | ||
| * @param executor - The executor function. | ||
| * @returns A new Promise instance. | ||
| */ | ||
| const createPromise = (executor) => _Reflect$4.construct(_Promise, [executor]); | ||
| /** | ||
| * (Safe copy) Returns a Promise that resolves with the given value. | ||
| */ | ||
| _Promise.resolve.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Returns a Promise that rejects with the given reason. | ||
| */ | ||
| _Promise.reject.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Returns a Promise that resolves when all promises resolve. | ||
| */ | ||
| _Promise.all.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Returns a Promise that resolves/rejects with the first settled promise. | ||
| */ | ||
| _Promise.race.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Returns a Promise that resolves when all promises settle. | ||
| */ | ||
| _Promise.allSettled.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Returns a Promise that resolves with the first fulfilled promise. | ||
| */ | ||
| _Promise.any.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Creates a Promise along with its resolve and reject functions. | ||
| * Note: Available only in ES2024+ environments. | ||
| */ | ||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| _Promise.withResolvers?.bind(_Promise); | ||
| /** | ||
| * Creates a cryptographic hash of the provided data using Node.js crypto module. | ||
@@ -15,3 +92,3 @@ * | ||
| async function createHash(data, algorithm = 'SHA-256') { | ||
| return new Promise((resolve, reject) => { | ||
| return createPromise((resolve, reject) => { | ||
| try { | ||
@@ -22,3 +99,3 @@ const hash = node_crypto.createHash(algorithm).update(data).digest('hex'); | ||
| catch { | ||
| reject(new Error('Error creating hash')); | ||
| reject(createError('Error creating hash')); | ||
| } | ||
@@ -29,17 +106,182 @@ }); | ||
| /** | ||
| * Generates cryptographically secure random values using Node.js crypto module. | ||
| * Safe copies of encoding built-ins via factory functions. | ||
| * | ||
| * @param byteLength - The number of random bytes to generate | ||
| * @returns A Uint8Array containing the random bytes | ||
| * @throws {Error} When byteLength is not provided or is zero | ||
| * Provides safe references to TextEncoder, TextDecoder, atob, and btoa. | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/encoding | ||
| */ | ||
| function getRandomValues(byteLength) { | ||
| if (!byteLength) { | ||
| throw new Error('Cannot generate random values without a byte length.'); | ||
| // Capture references at module initialization time | ||
| const _TextEncoder = globalThis.TextEncoder; | ||
| const _TextDecoder = globalThis.TextDecoder; | ||
| const _Reflect$3 = globalThis.Reflect; | ||
| /** | ||
| * (Safe copy) Creates a new TextEncoder using the captured TextEncoder constructor. | ||
| * Use this instead of `new TextEncoder()`. | ||
| * | ||
| * @returns A new TextEncoder instance. | ||
| */ | ||
| const createTextEncoder = () => _Reflect$3.construct(_TextEncoder, []); | ||
| /** | ||
| * (Safe copy) Creates a new TextDecoder using the captured TextDecoder constructor. | ||
| * Use this instead of `new TextDecoder()`. | ||
| * | ||
| * @param label - The encoding label (e.g., 'utf-8', 'utf-16'). Defaults to 'utf-8'. | ||
| * @param options - Optional TextDecoderOptions. | ||
| * @returns A new TextDecoder instance. | ||
| */ | ||
| const createTextDecoder = (label, options) => _Reflect$3.construct(_TextDecoder, [label, options]); | ||
| /** | ||
| * Safe copies of TypedArray and ArrayBuffer built-ins via factory functions. | ||
| * | ||
| * Provides safe references to Uint8Array, Int8Array, ArrayBuffer, DataView, etc. | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/typed-arrays | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _ArrayBuffer = globalThis.ArrayBuffer; | ||
| const _SharedArrayBuffer = globalThis.SharedArrayBuffer; | ||
| const _Uint8Array = globalThis.Uint8Array; | ||
| const _Uint8ClampedArray = globalThis.Uint8ClampedArray; | ||
| const _Uint16Array = globalThis.Uint16Array; | ||
| const _Uint32Array = globalThis.Uint32Array; | ||
| const _Int8Array = globalThis.Int8Array; | ||
| const _Int16Array = globalThis.Int16Array; | ||
| const _Int32Array = globalThis.Int32Array; | ||
| const _Float32Array = globalThis.Float32Array; | ||
| const _Float64Array = globalThis.Float64Array; | ||
| const _BigInt64Array = globalThis.BigInt64Array; | ||
| const _BigUint64Array = globalThis.BigUint64Array; | ||
| const _Reflect$2 = globalThis.Reflect; | ||
| function createUint8Array(arg, byteOffset, length) { | ||
| if (typeof arg === 'number') { | ||
| return _Reflect$2.construct(_Uint8Array, [arg]); | ||
| } | ||
| return new Uint8Array(node_crypto.randomBytes(byteLength)); | ||
| if (arg instanceof _ArrayBuffer || arg instanceof _SharedArrayBuffer) { | ||
| return _Reflect$2.construct(_Uint8Array, [arg, byteOffset, length]); | ||
| } | ||
| return _Reflect$2.construct(_Uint8Array, [arg]); | ||
| } | ||
| /** | ||
| * (Safe copy) Creates a new Uint8Array from an array-like or iterable object. | ||
| */ | ||
| _Uint8Array.from.bind(_Uint8Array); | ||
| /** | ||
| * (Safe copy) Creates a new Uint8Array from a variable number of arguments. | ||
| */ | ||
| _Uint8Array.of.bind(_Uint8Array); | ||
| /** | ||
| * (Safe copy) Creates a new Uint8ClampedArray from an array-like or iterable object. | ||
| */ | ||
| _Uint8ClampedArray.from.bind(_Uint8ClampedArray); | ||
| /** | ||
| * (Safe copy) Creates a new Uint8ClampedArray from a variable number of arguments. | ||
| */ | ||
| _Uint8ClampedArray.of.bind(_Uint8ClampedArray); | ||
| /** | ||
| * (Safe copy) Creates a new Uint16Array from an array-like or iterable object. | ||
| */ | ||
| _Uint16Array.from.bind(_Uint16Array); | ||
| /** | ||
| * (Safe copy) Creates a new Uint16Array from a variable number of arguments. | ||
| */ | ||
| _Uint16Array.of.bind(_Uint16Array); | ||
| /** | ||
| * (Safe copy) Creates a new Uint32Array from an array-like or iterable object. | ||
| */ | ||
| _Uint32Array.from.bind(_Uint32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Uint32Array from a variable number of arguments. | ||
| */ | ||
| _Uint32Array.of.bind(_Uint32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int8Array from an array-like or iterable object. | ||
| */ | ||
| _Int8Array.from.bind(_Int8Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int8Array from a variable number of arguments. | ||
| */ | ||
| _Int8Array.of.bind(_Int8Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int16Array from an array-like or iterable object. | ||
| */ | ||
| _Int16Array.from.bind(_Int16Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int16Array from a variable number of arguments. | ||
| */ | ||
| _Int16Array.of.bind(_Int16Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int32Array from an array-like or iterable object. | ||
| */ | ||
| _Int32Array.from.bind(_Int32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int32Array from a variable number of arguments. | ||
| */ | ||
| _Int32Array.of.bind(_Int32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Float32Array from an array-like or iterable object. | ||
| */ | ||
| _Float32Array.from.bind(_Float32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Float32Array from a variable number of arguments. | ||
| */ | ||
| _Float32Array.of.bind(_Float32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Float64Array from an array-like or iterable object. | ||
| */ | ||
| _Float64Array.from.bind(_Float64Array); | ||
| /** | ||
| * (Safe copy) Creates a new Float64Array from a variable number of arguments. | ||
| */ | ||
| _Float64Array.of.bind(_Float64Array); | ||
| /** | ||
| * (Safe copy) Creates a new BigInt64Array from an array-like or iterable object. | ||
| */ | ||
| _BigInt64Array.from.bind(_BigInt64Array); | ||
| /** | ||
| * (Safe copy) Creates a new BigInt64Array from a variable number of arguments. | ||
| */ | ||
| _BigInt64Array.of.bind(_BigInt64Array); | ||
| /** | ||
| * (Safe copy) Creates a new BigUint64Array from an array-like or iterable object. | ||
| */ | ||
| _BigUint64Array.from.bind(_BigUint64Array); | ||
| /** | ||
| * (Safe copy) Creates a new BigUint64Array from a variable number of arguments. | ||
| */ | ||
| _BigUint64Array.of.bind(_BigUint64Array); | ||
| new TextEncoder(); | ||
| const UTF8_DECODER = new TextDecoder('utf8'); | ||
| createTextEncoder(); | ||
| const UTF8_DECODER = createTextDecoder('utf8'); | ||
| ({ | ||
| SIMPLE: { | ||
| ARRAY: createUint8Array([104, 101, 108, 108, 111]), | ||
| }, | ||
| NON_ASCII: { | ||
| ARRAY: createUint8Array([ | ||
| 227, | ||
| 129, | ||
| 147, // こ | ||
| 227, | ||
| 130, | ||
| 147, // ん | ||
| 227, | ||
| 129, | ||
| 171, // に | ||
| 227, | ||
| 129, | ||
| 161, // ち | ||
| 227, | ||
| 129, | ||
| 175, // は | ||
| ]), | ||
| }, | ||
| EMPTY: { | ||
| ARRAY: createUint8Array([]), | ||
| }, | ||
| }); | ||
@@ -63,3 +305,3 @@ /** | ||
| function utf8StringToUint8Array(text) { | ||
| return new Uint8Array(Buffer.from(text, 'utf8')); | ||
| return createUint8Array(Buffer.from(text, 'utf8')); | ||
| } | ||
@@ -69,5 +311,44 @@ | ||
| /** | ||
| * Safe copies of Object built-in methods. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/object | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Object = globalThis.Object; | ||
| /** | ||
| * (Safe copy) Prevents modification of existing property attributes and values, | ||
| * and prevents the addition of new properties. | ||
| */ | ||
| const freeze = _Object.freeze; | ||
| /** | ||
| * (Safe copy) Creates an object that has the specified prototype or that has null prototype. | ||
| */ | ||
| const create = _Object.create; | ||
| const registeredClasses = []; | ||
| /** | ||
| * Safe copies of Array built-in static methods. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/array | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Array = globalThis.Array; | ||
| /** | ||
| * (Safe copy) Determines whether the passed value is an Array. | ||
| */ | ||
| const isArray = _Array.isArray; | ||
| /** | ||
| * (Safe copy) Creates an array from an array-like or iterable object. | ||
| */ | ||
| const from = _Array.from; | ||
| /** | ||
| * Returns the data type of the target. | ||
@@ -85,3 +366,3 @@ * Uses native `typeof` operator, however, makes distinction between `null`, `array`, and `object`. | ||
| if (nativeDataType === 'object') { | ||
| if (Array.isArray(target)) | ||
| if (isArray(target)) | ||
| return 'array'; | ||
@@ -96,5 +377,72 @@ for (const registeredClass of registeredClasses) { | ||
| const encryptionConfig = { | ||
| /** | ||
| * Safe copies of Map built-in via factory function. | ||
| * | ||
| * Since constructors cannot be safely captured via Object.assign, this module | ||
| * provides a factory function that uses Reflect.construct internally. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/map | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Map = globalThis.Map; | ||
| const _Reflect$1 = globalThis.Reflect; | ||
| /** | ||
| * (Safe copy) Creates a new Map using the captured Map constructor. | ||
| * Use this instead of `new Map()`. | ||
| * | ||
| * @param iterable - Optional iterable of key-value pairs. | ||
| * @returns A new Map instance. | ||
| */ | ||
| const createMap = (iterable) => _Reflect$1.construct(_Map, iterable ? [iterable] : []); | ||
| /** | ||
| * Safe copies of Date built-in via factory function and static methods. | ||
| * | ||
| * Since constructors cannot be safely captured via Object.assign, this module | ||
| * provides a factory function that uses Reflect.construct internally. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/date | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Date = globalThis.Date; | ||
| const _Reflect = globalThis.Reflect; | ||
| function createDate(...args) { | ||
| return _Reflect.construct(_Date, args); | ||
| } | ||
| /** | ||
| * Safe copies of Math built-in methods. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/math | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Math = globalThis.Math; | ||
| /** | ||
| * (Safe copy) Returns the largest integer less than or equal to a number. | ||
| */ | ||
| const floor = _Math.floor; | ||
| // ============================================================================ | ||
| // Trigonometry | ||
| // ============================================================================ | ||
| /** | ||
| * (Safe copy) Returns the sine of a number. | ||
| */ | ||
| const sin = _Math.sin; | ||
| /** | ||
| * Frozen encryption configuration to prevent runtime tampering. | ||
| * Using AES-GCM as the default algorithm for authenticated encryption. | ||
| */ | ||
| const encryptionConfig = freeze({ | ||
| name: 'AES-GCM', | ||
| }; | ||
| }); | ||
@@ -112,9 +460,9 @@ /** | ||
| if (getType(password) !== 'string') { | ||
| throw new Error('Cannot generate key without a password type string'); | ||
| throw createError('Cannot generate key without a password type string'); | ||
| } | ||
| if (password.length === 0) { | ||
| throw new Error('Cannot generate key with an empty string as password'); | ||
| throw createError('Cannot generate key with an empty string as password'); | ||
| } | ||
| if (!salt) { | ||
| throw new Error('Cannot generate key without a salt'); | ||
| throw createError('Cannot generate key without a salt'); | ||
| } | ||
@@ -137,2 +485,44 @@ const keyMaterial = await subtle.importKey('raw', utf8StringToUint8Array(password), { name: 'PBKDF2' }, false, [ | ||
| /** | ||
| * Creates a decryption function that decrypts AES-GCM encrypted messages using password-derived keys. | ||
| * Extracts salt and IV from the encrypted data to derive the correct decryption key. | ||
| * | ||
| * @param arrayBufferToUtf8String - Function to convert byte arrays to UTF-8 strings | ||
| * @param generateKey - Function to derive decryption keys from passwords | ||
| * @param subtle - The SubtleCrypto interface for cryptographic operations | ||
| * @returns A function that decrypts encrypted messages with passwords | ||
| */ | ||
| function createDecrypt(arrayBufferToUtf8String, generateKey, subtle) { | ||
| return async function decrypt(encrypted, password) { | ||
| if (!encrypted || !encrypted.length) { | ||
| throw createError('Cannot decrypt without a message'); | ||
| } | ||
| if (!password) { | ||
| throw createError('Cannot decrypt without a password'); | ||
| } | ||
| const salt = encrypted.slice(0, 16); | ||
| const iv = encrypted.slice(16, 28); | ||
| const data = encrypted.slice(28); | ||
| const key = await generateKey(password, salt); | ||
| const decryptedContent = await subtle.decrypt({ ...encryptionConfig, iv }, key, data); | ||
| return arrayBufferToUtf8String(decryptedContent); | ||
| }; | ||
| } | ||
| const decrypt = createDecrypt(arrayBufferToUtf8String, generateKey, subtle); | ||
| /** | ||
| * Generates cryptographically secure random values using Node.js crypto module. | ||
| * | ||
| * @param byteLength - The number of random bytes to generate | ||
| * @returns A Uint8Array containing the random bytes | ||
| * @throws {Error} When byteLength is not provided or is zero | ||
| */ | ||
| function getRandomValues(byteLength) { | ||
| if (!byteLength) { | ||
| throw createError('Cannot generate random values without a byte length.'); | ||
| } | ||
| return createUint8Array(node_crypto.randomBytes(byteLength)); | ||
| } | ||
| /** | ||
| * Creates an encryption function that encrypts messages using AES-GCM with password-derived keys. | ||
@@ -150,6 +540,6 @@ * Generates random salt and initialization vector (IV) for each encryption operation. | ||
| if (!message) { | ||
| throw new Error('Cannot encrypt an empty message.'); | ||
| throw createError('Cannot encrypt an empty message.'); | ||
| } | ||
| if (!password) { | ||
| throw new Error('Cannot encrypt without a password.'); | ||
| throw createError('Cannot encrypt without a password.'); | ||
| } | ||
@@ -160,4 +550,4 @@ const salt = getRandomValues(16); | ||
| const encryptedContent = await subtle.encrypt({ ...encryptionConfig, iv: iv }, key, utf8StringToUint8Array(message)); | ||
| const buffer = new Uint8Array(encryptedContent); | ||
| const result = new Uint8Array(salt.byteLength + iv.byteLength + buffer.byteLength); | ||
| const buffer = createUint8Array(encryptedContent); | ||
| const result = createUint8Array(salt.byteLength + iv.byteLength + buffer.byteLength); | ||
| result.set(salt, 0); | ||
@@ -173,30 +563,2 @@ result.set(iv, salt.byteLength); | ||
| /** | ||
| * Creates a decryption function that decrypts AES-GCM encrypted messages using password-derived keys. | ||
| * Extracts salt and IV from the encrypted data to derive the correct decryption key. | ||
| * | ||
| * @param arrayBufferToUtf8String - Function to convert byte arrays to UTF-8 strings | ||
| * @param generateKey - Function to derive decryption keys from passwords | ||
| * @param subtle - The SubtleCrypto interface for cryptographic operations | ||
| * @returns A function that decrypts encrypted messages with passwords | ||
| */ | ||
| function createDecrypt(arrayBufferToUtf8String, generateKey, subtle) { | ||
| return async function decrypt(encrypted, password) { | ||
| if (!encrypted || !encrypted.length) { | ||
| throw new Error('Cannot decrypt without a message'); | ||
| } | ||
| if (!password) { | ||
| throw new Error('Cannot decrypt without a password'); | ||
| } | ||
| const salt = encrypted.slice(0, 16); | ||
| const iv = encrypted.slice(16, 28); | ||
| const data = encrypted.slice(28); | ||
| const key = await generateKey(password, salt); | ||
| const decryptedContent = await subtle.decrypt({ ...encryptionConfig, iv }, key, data); | ||
| return arrayBufferToUtf8String(decryptedContent); | ||
| }; | ||
| } | ||
| const decrypt = createDecrypt(arrayBufferToUtf8String, generateKey, subtle); | ||
| /** | ||
| * Creates a vault factory function that produces encrypted storage instances. | ||
@@ -212,3 +574,3 @@ * Vaults provide secure, password-protected storage for sensitive data with optional single-use mode. | ||
| return function createVault(singleUse = false) { | ||
| let password = Array.from(getRandomValues(16)) | ||
| let password = from(getRandomValues(16)) | ||
| .map((b) => b.toString(16).padStart(2, '0')) | ||
@@ -218,3 +580,3 @@ .join(''); | ||
| let isVaultClosed = false; | ||
| let storage = new Map(); | ||
| let storage = createMap(); | ||
| /** | ||
@@ -230,9 +592,9 @@ * Writes an encrypted value to the vault with the specified label. | ||
| if (isVaultClosed) { | ||
| throw new Error('Vault is closed.'); | ||
| throw createError('Vault is closed.'); | ||
| } | ||
| if (!label) { | ||
| throw new Error('Label is required.'); | ||
| throw createError('Label is required.'); | ||
| } | ||
| if (!value) { | ||
| throw new Error('Value is required.'); | ||
| throw createError('Value is required.'); | ||
| } | ||
@@ -253,9 +615,9 @@ const encryptedValue = await encrypt(value, password); | ||
| if (isVaultClosed) { | ||
| throw new Error('Vault is closed.'); | ||
| throw createError('Vault is closed.'); | ||
| } | ||
| if (!label) { | ||
| throw new Error('Label is required.'); | ||
| throw createError('Label is required.'); | ||
| } | ||
| if (!password) { | ||
| throw new Error('Password is required.'); | ||
| throw createError('Password is required.'); | ||
| } | ||
@@ -281,3 +643,3 @@ const encryptedValue = storage.get(label); | ||
| if (isVaultClosed) { | ||
| throw new Error('Vault is closed.'); | ||
| throw createError('Vault is closed.'); | ||
| } | ||
@@ -300,3 +662,3 @@ if (isPasswordAccessed) { | ||
| } | ||
| const vault = Object.create(null, { | ||
| const vault = create(null, { | ||
| write: { | ||
@@ -327,3 +689,4 @@ value: write, | ||
| }); | ||
| return vault; | ||
| // Freeze to prevent addition of new properties | ||
| return freeze(vault); | ||
| }; | ||
@@ -341,4 +704,4 @@ } | ||
| function randomPseudo(seed) { | ||
| const x = Math.sin(seed) * 10000; | ||
| return x - Math.floor(x); | ||
| const x = sin(seed) * 10000; | ||
| return x - floor(x); | ||
| } | ||
@@ -357,2 +720,20 @@ | ||
| /** | ||
| * Safe copies of Number built-in methods and constants. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/number | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _isNaN = globalThis.isNaN; | ||
| // ============================================================================ | ||
| // Global Type Checking (legacy, less strict) | ||
| // ============================================================================ | ||
| /** | ||
| * (Safe copy) Global isNaN function (coerces to number first, less strict than Number.isNaN). | ||
| */ | ||
| const globalIsNaN = _isNaN; | ||
| /** | ||
| * Normalizes a given time to the nearest base time window. | ||
@@ -365,12 +746,12 @@ * | ||
| function normalizeToBaseTimeWindow(time, baseTimeWindow) { | ||
| if (!time || !(time instanceof Date) || isNaN(time.getTime())) { | ||
| throw new Error('Invalid time input'); | ||
| if (!time || !(time instanceof Date) || globalIsNaN(time.getTime())) { | ||
| throw createError('Invalid time input'); | ||
| } | ||
| if (baseTimeWindow <= 0) { | ||
| throw new Error('Base time window must be positive'); | ||
| throw createError('Base time window must be positive'); | ||
| } | ||
| const timeInMs = time.getTime(); | ||
| const windowInMs = baseTimeWindow * 60 * 1000; | ||
| const normalizedTimeInMs = Math.floor(timeInMs / windowInMs) * windowInMs; | ||
| return new Date(normalizedTimeInMs); | ||
| const normalizedTimeInMs = floor(timeInMs / windowInMs) * windowInMs; | ||
| return createDate(normalizedTimeInMs); | ||
| } | ||
@@ -388,5 +769,5 @@ | ||
| if (getType(windowOffset) !== 'number' || windowOffset < -1 || 1 < windowOffset) { | ||
| throw new Error('Window offset must be -1, 0, or 1.'); | ||
| throw createError('Window offset must be -1, 0, or 1.'); | ||
| } | ||
| const offsetTime = new Date(currentUtcTime.getTime() + windowOffset * baseTimeWindow * 60000); | ||
| const offsetTime = createDate(currentUtcTime.getTime() + windowOffset * baseTimeWindow * 60000); | ||
| return await createHash(randomPseudoTimeBased(normalizeToBaseTimeWindow(offsetTime, baseTimeWindow)).toString()); | ||
@@ -409,3 +790,3 @@ }; | ||
| * Creates a factory function that generates time-based password generators for multiple time windows. | ||
| * Returns an object with methods to generate passwords for current, previous, and next time windows. | ||
| * Returns a frozen object with methods to generate passwords for current, previous, and next time windows. | ||
| * | ||
@@ -420,3 +801,4 @@ * @param getTimeBasedPassword - Function to generate a single time-based password with window offset | ||
| const next = () => getTimeBasedPassword(currentUtcTime, baseTimeWindow, 1); | ||
| return { current, previous, next }; | ||
| // Freeze to prevent runtime modification of password generator methods | ||
| return freeze({ current, previous, next }); | ||
| }; | ||
@@ -423,0 +805,0 @@ } |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.cjs.js","sources":["../../../../../../../../libs/cryptography/src/lib/create-hash/node.ts","../../../../../../../../libs/cryptography/src/lib/get-random-values/node.ts","../../../../../../../../libs/utils/string/src/lib/shared-consts.ts","../../../../../../../../libs/utils/string/src/lib/array-buffer-to-utf8-string/array-buffer-to-utf8-string.ts","../../../../../../../../libs/utils/string/src/lib/utf8-string-to-uint8-array/node/utf8-string-to-uint8-array.ts","../../../../../../../../libs/cryptography/src/lib/subtle/node.ts","../../../../../../../../libs/utils/data/src/shared/consts.ts","../../../../../../../../libs/utils/data/src/get-type.ts","../../../../../../../../libs/cryptography/src/lib/encryption-config.ts","../../../../../../../../libs/cryptography/src/lib/generate-key/create-key-generator.ts","../../../../../../../../libs/cryptography/src/lib/generate-key/node.ts","../../../../../../../../libs/cryptography/src/lib/encrypt/create-encrypt.ts","../../../../../../../../libs/cryptography/src/lib/encrypt/node.ts","../../../../../../../../libs/cryptography/src/lib/decrypt/create-decrypt.ts","../../../../../../../../libs/cryptography/src/lib/decrypt/node.ts","../../../../../../../../libs/cryptography/src/lib/create-vault/create-value-creator.ts","../../../../../../../../libs/cryptography/src/lib/create-vault/node.ts","../../../../../../../../libs/utils/random-generator/src/random-pseudo.ts","../../../../../../../../libs/utils/random-generator/src/random-pseudo-time-based.ts","../../../../../../../../libs/utils/time/src/normalize-to-base-time-window.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-password/create-get-time-based-password.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-password/node.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/create-get-time-based-passwords.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/node.ts","../../../../../../../../libs/cryptography/src/lib/is-sha-256-hash.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["_createHash","randomBytes","webcrypto"],"mappings":";;;;AAGA;;;;;;;AAOG;AACI,eAAe,UAAU,CAAC,IAAY,EAAE,YAA2B,SAAS,EAAA;IACjF,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAI;AACrC,QAAA,IAAI;AACF,YAAA,MAAM,IAAI,GAAGA,sBAAW,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;YAC9D,OAAO,CAAC,IAAI,C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H;;ACpBA;;;;;;;;AAQG;MACU,oBAAoB,GAAG,0BAA0B,CAAC,UAAU;;ACVzE;;;;;;AAMG;AACG,SAAU,wBAAwB,CACtC,oBAAkH,EAAA;AAElH,IAAA,OAAO,SAAS,qBAAqB,CAAC,cAAc,EAAE,cAAc,EAAA;AAClE,QAAA,MAAM,OAAO,GAAG,MAAM,oBAAoB,CAAC,cAAc,EAAE,cAAc,EAAE,CAAC,CAAC;AAC7E,QAAA,MAAM,QAAQ,GAAG,MAAM,oBAAoB,CAAC,cAAc,EAAE,cAAc,EAAE,EAAE,CAAC;AAC/E,QAAA,MAAM,IAAI,GAAG,MAAM,oBAAoB,CAAC,cAAc,EAAE,cAAc,EAAE,CAAC,CAAC;AAC1E,QAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE;AACpC,IAAA,CAAC;AACH;;ACfA;;;;;;;AAOG;MACU,qBAAqB,GAAG,wBAAwB,CAAC,oBAAoB;;ACTlF;;;;;;AAMG;AACG,SAAU,YAAY,CAAC,IAAa,EAAA;AACxC,IAAA,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,QAAQ,GAAG,iBAAiB,CAAC,IAAI,CAAS,IAAI,CAAC,GAAG,KAAK;AAClF;;;;;;;;;;;;;;"} | ||
| {"version":3,"file":"index.cjs.js","sources":["../../../../../../../../libs/utils/immutable-api/src/built-in-copy/error/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/promise/index.ts","../../../../../../../../libs/cryptography/src/lib/create-hash/node.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/encoding/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/typed-arrays/index.ts","../../../../../../../../libs/utils/string/src/lib/shared-consts.ts","../../../../../../../../libs/utils/string/src/lib/array-buffer-to-utf8-string/array-buffer-to-utf8-string.ts","../../../../../../../../libs/utils/string/src/lib/utf8-string-to-uint8-array/node/utf8-string-to-uint8-array.ts","../../../../../../../../libs/cryptography/src/lib/subtle/node.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/object/index.ts","../../../../../../../../libs/utils/data/src/shared/consts.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/array/index.ts","../../../../../../../../libs/utils/data/src/get-type.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/map/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/date/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/math/index.ts","../../../../../../../../libs/cryptography/src/lib/encryption-config.ts","../../../../../../../../libs/cryptography/src/lib/generate-key/create-key-generator.ts","../../../../../../../../libs/cryptography/src/lib/generate-key/node.ts","../../../../../../../../libs/cryptography/src/lib/decrypt/create-decrypt.ts","../../../../../../../../libs/cryptography/src/lib/decrypt/node.ts","../../../../../../../../libs/cryptography/src/lib/get-random-values/node.ts","../../../../../../../../libs/cryptography/src/lib/encrypt/create-encrypt.ts","../../../../../../../../libs/cryptography/src/lib/encrypt/node.ts","../../../../../../../../libs/cryptography/src/lib/create-vault/create-value-creator.ts","../../../../../../../../libs/cryptography/src/lib/create-vault/node.ts","../../../../../../../../libs/utils/random-generator/src/random-pseudo.ts","../../../../../../../../libs/utils/random-generator/src/random-pseudo-time-based.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/number/index.ts","../../../../../../../../libs/utils/time/src/normalize-to-base-time-window.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-password/create-get-time-based-password.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-password/node.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/create-get-time-based-passwords.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/node.ts","../../../../../../../../libs/cryptography/src/lib/is-sha-256-hash.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["_Reflect","_createHash","webcrypto","randomBytes"],"mappings":";;;;AAAA;;;;;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EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC5C,IAAA,CAAC;AACH;;ACjBA;;;;;;;AAOG;MACU,qBAAqB,GAAG,wBAAwB,CAAC,oBAAoB;;ACTlF;;;;;;AAMG;AACG,SAAU,YAAY,CAAC,IAAa,EAAA;AACxC,IAAA,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,QAAQ,GAAG,iBAAiB,CAAC,IAAI,CAAS,IAAI,CAAC,GAAG,KAAK;AAClF;;;;;;;;;;;;;;"} |
+456
-74
@@ -1,4 +0,81 @@ | ||
| import { createHash as createHash$1, randomBytes, webcrypto } from 'node:crypto'; | ||
| import { createHash as createHash$1, webcrypto, randomBytes } from 'node:crypto'; | ||
| /** | ||
| * Safe copies of Error built-ins via factory functions. | ||
| * | ||
| * Since constructors cannot be safely captured via Object.assign, this module | ||
| * provides factory functions that use Reflect.construct internally. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/error | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Error = globalThis.Error; | ||
| const _Reflect$5 = globalThis.Reflect; | ||
| /** | ||
| * (Safe copy) Creates a new Error using the captured Error constructor. | ||
| * Use this instead of `new Error()`. | ||
| * | ||
| * @param message - Optional error message. | ||
| * @param options - Optional error options. | ||
| * @returns A new Error instance. | ||
| */ | ||
| const createError = (message, options) => _Reflect$5.construct(_Error, [message, options]); | ||
| /** | ||
| * Safe copies of Promise built-in methods via factory functions. | ||
| * | ||
| * Since constructors cannot be safely captured via Object.assign, this module | ||
| * provides factory functions that use Reflect.construct internally. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/promise | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Promise = globalThis.Promise; | ||
| const _Reflect$4 = globalThis.Reflect; | ||
| /** | ||
| * (Safe copy) Creates a new Promise using the captured Promise constructor. | ||
| * Use this instead of `new Promise()`. | ||
| * | ||
| * @param executor - The executor function. | ||
| * @returns A new Promise instance. | ||
| */ | ||
| const createPromise = (executor) => _Reflect$4.construct(_Promise, [executor]); | ||
| /** | ||
| * (Safe copy) Returns a Promise that resolves with the given value. | ||
| */ | ||
| _Promise.resolve.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Returns a Promise that rejects with the given reason. | ||
| */ | ||
| _Promise.reject.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Returns a Promise that resolves when all promises resolve. | ||
| */ | ||
| _Promise.all.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Returns a Promise that resolves/rejects with the first settled promise. | ||
| */ | ||
| _Promise.race.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Returns a Promise that resolves when all promises settle. | ||
| */ | ||
| _Promise.allSettled.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Returns a Promise that resolves with the first fulfilled promise. | ||
| */ | ||
| _Promise.any.bind(_Promise); | ||
| /** | ||
| * (Safe copy) Creates a Promise along with its resolve and reject functions. | ||
| * Note: Available only in ES2024+ environments. | ||
| */ | ||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| _Promise.withResolvers?.bind(_Promise); | ||
| /** | ||
| * Creates a cryptographic hash of the provided data using Node.js crypto module. | ||
@@ -12,3 +89,3 @@ * | ||
| async function createHash(data, algorithm = 'SHA-256') { | ||
| return new Promise((resolve, reject) => { | ||
| return createPromise((resolve, reject) => { | ||
| try { | ||
@@ -19,3 +96,3 @@ const hash = createHash$1(algorithm).update(data).digest('hex'); | ||
| catch { | ||
| reject(new Error('Error creating hash')); | ||
| reject(createError('Error creating hash')); | ||
| } | ||
@@ -26,17 +103,182 @@ }); | ||
| /** | ||
| * Generates cryptographically secure random values using Node.js crypto module. | ||
| * Safe copies of encoding built-ins via factory functions. | ||
| * | ||
| * @param byteLength - The number of random bytes to generate | ||
| * @returns A Uint8Array containing the random bytes | ||
| * @throws {Error} When byteLength is not provided or is zero | ||
| * Provides safe references to TextEncoder, TextDecoder, atob, and btoa. | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/encoding | ||
| */ | ||
| function getRandomValues(byteLength) { | ||
| if (!byteLength) { | ||
| throw new Error('Cannot generate random values without a byte length.'); | ||
| // Capture references at module initialization time | ||
| const _TextEncoder = globalThis.TextEncoder; | ||
| const _TextDecoder = globalThis.TextDecoder; | ||
| const _Reflect$3 = globalThis.Reflect; | ||
| /** | ||
| * (Safe copy) Creates a new TextEncoder using the captured TextEncoder constructor. | ||
| * Use this instead of `new TextEncoder()`. | ||
| * | ||
| * @returns A new TextEncoder instance. | ||
| */ | ||
| const createTextEncoder = () => _Reflect$3.construct(_TextEncoder, []); | ||
| /** | ||
| * (Safe copy) Creates a new TextDecoder using the captured TextDecoder constructor. | ||
| * Use this instead of `new TextDecoder()`. | ||
| * | ||
| * @param label - The encoding label (e.g., 'utf-8', 'utf-16'). Defaults to 'utf-8'. | ||
| * @param options - Optional TextDecoderOptions. | ||
| * @returns A new TextDecoder instance. | ||
| */ | ||
| const createTextDecoder = (label, options) => _Reflect$3.construct(_TextDecoder, [label, options]); | ||
| /** | ||
| * Safe copies of TypedArray and ArrayBuffer built-ins via factory functions. | ||
| * | ||
| * Provides safe references to Uint8Array, Int8Array, ArrayBuffer, DataView, etc. | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/typed-arrays | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _ArrayBuffer = globalThis.ArrayBuffer; | ||
| const _SharedArrayBuffer = globalThis.SharedArrayBuffer; | ||
| const _Uint8Array = globalThis.Uint8Array; | ||
| const _Uint8ClampedArray = globalThis.Uint8ClampedArray; | ||
| const _Uint16Array = globalThis.Uint16Array; | ||
| const _Uint32Array = globalThis.Uint32Array; | ||
| const _Int8Array = globalThis.Int8Array; | ||
| const _Int16Array = globalThis.Int16Array; | ||
| const _Int32Array = globalThis.Int32Array; | ||
| const _Float32Array = globalThis.Float32Array; | ||
| const _Float64Array = globalThis.Float64Array; | ||
| const _BigInt64Array = globalThis.BigInt64Array; | ||
| const _BigUint64Array = globalThis.BigUint64Array; | ||
| const _Reflect$2 = globalThis.Reflect; | ||
| function createUint8Array(arg, byteOffset, length) { | ||
| if (typeof arg === 'number') { | ||
| return _Reflect$2.construct(_Uint8Array, [arg]); | ||
| } | ||
| return new Uint8Array(randomBytes(byteLength)); | ||
| if (arg instanceof _ArrayBuffer || arg instanceof _SharedArrayBuffer) { | ||
| return _Reflect$2.construct(_Uint8Array, [arg, byteOffset, length]); | ||
| } | ||
| return _Reflect$2.construct(_Uint8Array, [arg]); | ||
| } | ||
| /** | ||
| * (Safe copy) Creates a new Uint8Array from an array-like or iterable object. | ||
| */ | ||
| _Uint8Array.from.bind(_Uint8Array); | ||
| /** | ||
| * (Safe copy) Creates a new Uint8Array from a variable number of arguments. | ||
| */ | ||
| _Uint8Array.of.bind(_Uint8Array); | ||
| /** | ||
| * (Safe copy) Creates a new Uint8ClampedArray from an array-like or iterable object. | ||
| */ | ||
| _Uint8ClampedArray.from.bind(_Uint8ClampedArray); | ||
| /** | ||
| * (Safe copy) Creates a new Uint8ClampedArray from a variable number of arguments. | ||
| */ | ||
| _Uint8ClampedArray.of.bind(_Uint8ClampedArray); | ||
| /** | ||
| * (Safe copy) Creates a new Uint16Array from an array-like or iterable object. | ||
| */ | ||
| _Uint16Array.from.bind(_Uint16Array); | ||
| /** | ||
| * (Safe copy) Creates a new Uint16Array from a variable number of arguments. | ||
| */ | ||
| _Uint16Array.of.bind(_Uint16Array); | ||
| /** | ||
| * (Safe copy) Creates a new Uint32Array from an array-like or iterable object. | ||
| */ | ||
| _Uint32Array.from.bind(_Uint32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Uint32Array from a variable number of arguments. | ||
| */ | ||
| _Uint32Array.of.bind(_Uint32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int8Array from an array-like or iterable object. | ||
| */ | ||
| _Int8Array.from.bind(_Int8Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int8Array from a variable number of arguments. | ||
| */ | ||
| _Int8Array.of.bind(_Int8Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int16Array from an array-like or iterable object. | ||
| */ | ||
| _Int16Array.from.bind(_Int16Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int16Array from a variable number of arguments. | ||
| */ | ||
| _Int16Array.of.bind(_Int16Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int32Array from an array-like or iterable object. | ||
| */ | ||
| _Int32Array.from.bind(_Int32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Int32Array from a variable number of arguments. | ||
| */ | ||
| _Int32Array.of.bind(_Int32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Float32Array from an array-like or iterable object. | ||
| */ | ||
| _Float32Array.from.bind(_Float32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Float32Array from a variable number of arguments. | ||
| */ | ||
| _Float32Array.of.bind(_Float32Array); | ||
| /** | ||
| * (Safe copy) Creates a new Float64Array from an array-like or iterable object. | ||
| */ | ||
| _Float64Array.from.bind(_Float64Array); | ||
| /** | ||
| * (Safe copy) Creates a new Float64Array from a variable number of arguments. | ||
| */ | ||
| _Float64Array.of.bind(_Float64Array); | ||
| /** | ||
| * (Safe copy) Creates a new BigInt64Array from an array-like or iterable object. | ||
| */ | ||
| _BigInt64Array.from.bind(_BigInt64Array); | ||
| /** | ||
| * (Safe copy) Creates a new BigInt64Array from a variable number of arguments. | ||
| */ | ||
| _BigInt64Array.of.bind(_BigInt64Array); | ||
| /** | ||
| * (Safe copy) Creates a new BigUint64Array from an array-like or iterable object. | ||
| */ | ||
| _BigUint64Array.from.bind(_BigUint64Array); | ||
| /** | ||
| * (Safe copy) Creates a new BigUint64Array from a variable number of arguments. | ||
| */ | ||
| _BigUint64Array.of.bind(_BigUint64Array); | ||
| new TextEncoder(); | ||
| const UTF8_DECODER = new TextDecoder('utf8'); | ||
| createTextEncoder(); | ||
| const UTF8_DECODER = createTextDecoder('utf8'); | ||
| ({ | ||
| SIMPLE: { | ||
| ARRAY: createUint8Array([104, 101, 108, 108, 111]), | ||
| }, | ||
| NON_ASCII: { | ||
| ARRAY: createUint8Array([ | ||
| 227, | ||
| 129, | ||
| 147, // こ | ||
| 227, | ||
| 130, | ||
| 147, // ん | ||
| 227, | ||
| 129, | ||
| 171, // に | ||
| 227, | ||
| 129, | ||
| 161, // ち | ||
| 227, | ||
| 129, | ||
| 175, // は | ||
| ]), | ||
| }, | ||
| EMPTY: { | ||
| ARRAY: createUint8Array([]), | ||
| }, | ||
| }); | ||
@@ -60,3 +302,3 @@ /** | ||
| function utf8StringToUint8Array(text) { | ||
| return new Uint8Array(Buffer.from(text, 'utf8')); | ||
| return createUint8Array(Buffer.from(text, 'utf8')); | ||
| } | ||
@@ -66,5 +308,44 @@ | ||
| /** | ||
| * Safe copies of Object built-in methods. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/object | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Object = globalThis.Object; | ||
| /** | ||
| * (Safe copy) Prevents modification of existing property attributes and values, | ||
| * and prevents the addition of new properties. | ||
| */ | ||
| const freeze = _Object.freeze; | ||
| /** | ||
| * (Safe copy) Creates an object that has the specified prototype or that has null prototype. | ||
| */ | ||
| const create = _Object.create; | ||
| const registeredClasses = []; | ||
| /** | ||
| * Safe copies of Array built-in static methods. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/array | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Array = globalThis.Array; | ||
| /** | ||
| * (Safe copy) Determines whether the passed value is an Array. | ||
| */ | ||
| const isArray = _Array.isArray; | ||
| /** | ||
| * (Safe copy) Creates an array from an array-like or iterable object. | ||
| */ | ||
| const from = _Array.from; | ||
| /** | ||
| * Returns the data type of the target. | ||
@@ -82,3 +363,3 @@ * Uses native `typeof` operator, however, makes distinction between `null`, `array`, and `object`. | ||
| if (nativeDataType === 'object') { | ||
| if (Array.isArray(target)) | ||
| if (isArray(target)) | ||
| return 'array'; | ||
@@ -93,5 +374,72 @@ for (const registeredClass of registeredClasses) { | ||
| const encryptionConfig = { | ||
| /** | ||
| * Safe copies of Map built-in via factory function. | ||
| * | ||
| * Since constructors cannot be safely captured via Object.assign, this module | ||
| * provides a factory function that uses Reflect.construct internally. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/map | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Map = globalThis.Map; | ||
| const _Reflect$1 = globalThis.Reflect; | ||
| /** | ||
| * (Safe copy) Creates a new Map using the captured Map constructor. | ||
| * Use this instead of `new Map()`. | ||
| * | ||
| * @param iterable - Optional iterable of key-value pairs. | ||
| * @returns A new Map instance. | ||
| */ | ||
| const createMap = (iterable) => _Reflect$1.construct(_Map, iterable ? [iterable] : []); | ||
| /** | ||
| * Safe copies of Date built-in via factory function and static methods. | ||
| * | ||
| * Since constructors cannot be safely captured via Object.assign, this module | ||
| * provides a factory function that uses Reflect.construct internally. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/date | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Date = globalThis.Date; | ||
| const _Reflect = globalThis.Reflect; | ||
| function createDate(...args) { | ||
| return _Reflect.construct(_Date, args); | ||
| } | ||
| /** | ||
| * Safe copies of Math built-in methods. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/math | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _Math = globalThis.Math; | ||
| /** | ||
| * (Safe copy) Returns the largest integer less than or equal to a number. | ||
| */ | ||
| const floor = _Math.floor; | ||
| // ============================================================================ | ||
| // Trigonometry | ||
| // ============================================================================ | ||
| /** | ||
| * (Safe copy) Returns the sine of a number. | ||
| */ | ||
| const sin = _Math.sin; | ||
| /** | ||
| * Frozen encryption configuration to prevent runtime tampering. | ||
| * Using AES-GCM as the default algorithm for authenticated encryption. | ||
| */ | ||
| const encryptionConfig = freeze({ | ||
| name: 'AES-GCM', | ||
| }; | ||
| }); | ||
@@ -109,9 +457,9 @@ /** | ||
| if (getType(password) !== 'string') { | ||
| throw new Error('Cannot generate key without a password type string'); | ||
| throw createError('Cannot generate key without a password type string'); | ||
| } | ||
| if (password.length === 0) { | ||
| throw new Error('Cannot generate key with an empty string as password'); | ||
| throw createError('Cannot generate key with an empty string as password'); | ||
| } | ||
| if (!salt) { | ||
| throw new Error('Cannot generate key without a salt'); | ||
| throw createError('Cannot generate key without a salt'); | ||
| } | ||
@@ -134,2 +482,44 @@ const keyMaterial = await subtle.importKey('raw', utf8StringToUint8Array(password), { name: 'PBKDF2' }, false, [ | ||
| /** | ||
| * Creates a decryption function that decrypts AES-GCM encrypted messages using password-derived keys. | ||
| * Extracts salt and IV from the encrypted data to derive the correct decryption key. | ||
| * | ||
| * @param arrayBufferToUtf8String - Function to convert byte arrays to UTF-8 strings | ||
| * @param generateKey - Function to derive decryption keys from passwords | ||
| * @param subtle - The SubtleCrypto interface for cryptographic operations | ||
| * @returns A function that decrypts encrypted messages with passwords | ||
| */ | ||
| function createDecrypt(arrayBufferToUtf8String, generateKey, subtle) { | ||
| return async function decrypt(encrypted, password) { | ||
| if (!encrypted || !encrypted.length) { | ||
| throw createError('Cannot decrypt without a message'); | ||
| } | ||
| if (!password) { | ||
| throw createError('Cannot decrypt without a password'); | ||
| } | ||
| const salt = encrypted.slice(0, 16); | ||
| const iv = encrypted.slice(16, 28); | ||
| const data = encrypted.slice(28); | ||
| const key = await generateKey(password, salt); | ||
| const decryptedContent = await subtle.decrypt({ ...encryptionConfig, iv }, key, data); | ||
| return arrayBufferToUtf8String(decryptedContent); | ||
| }; | ||
| } | ||
| const decrypt = createDecrypt(arrayBufferToUtf8String, generateKey, subtle); | ||
| /** | ||
| * Generates cryptographically secure random values using Node.js crypto module. | ||
| * | ||
| * @param byteLength - The number of random bytes to generate | ||
| * @returns A Uint8Array containing the random bytes | ||
| * @throws {Error} When byteLength is not provided or is zero | ||
| */ | ||
| function getRandomValues(byteLength) { | ||
| if (!byteLength) { | ||
| throw createError('Cannot generate random values without a byte length.'); | ||
| } | ||
| return createUint8Array(randomBytes(byteLength)); | ||
| } | ||
| /** | ||
| * Creates an encryption function that encrypts messages using AES-GCM with password-derived keys. | ||
@@ -147,6 +537,6 @@ * Generates random salt and initialization vector (IV) for each encryption operation. | ||
| if (!message) { | ||
| throw new Error('Cannot encrypt an empty message.'); | ||
| throw createError('Cannot encrypt an empty message.'); | ||
| } | ||
| if (!password) { | ||
| throw new Error('Cannot encrypt without a password.'); | ||
| throw createError('Cannot encrypt without a password.'); | ||
| } | ||
@@ -157,4 +547,4 @@ const salt = getRandomValues(16); | ||
| const encryptedContent = await subtle.encrypt({ ...encryptionConfig, iv: iv }, key, utf8StringToUint8Array(message)); | ||
| const buffer = new Uint8Array(encryptedContent); | ||
| const result = new Uint8Array(salt.byteLength + iv.byteLength + buffer.byteLength); | ||
| const buffer = createUint8Array(encryptedContent); | ||
| const result = createUint8Array(salt.byteLength + iv.byteLength + buffer.byteLength); | ||
| result.set(salt, 0); | ||
@@ -170,30 +560,2 @@ result.set(iv, salt.byteLength); | ||
| /** | ||
| * Creates a decryption function that decrypts AES-GCM encrypted messages using password-derived keys. | ||
| * Extracts salt and IV from the encrypted data to derive the correct decryption key. | ||
| * | ||
| * @param arrayBufferToUtf8String - Function to convert byte arrays to UTF-8 strings | ||
| * @param generateKey - Function to derive decryption keys from passwords | ||
| * @param subtle - The SubtleCrypto interface for cryptographic operations | ||
| * @returns A function that decrypts encrypted messages with passwords | ||
| */ | ||
| function createDecrypt(arrayBufferToUtf8String, generateKey, subtle) { | ||
| return async function decrypt(encrypted, password) { | ||
| if (!encrypted || !encrypted.length) { | ||
| throw new Error('Cannot decrypt without a message'); | ||
| } | ||
| if (!password) { | ||
| throw new Error('Cannot decrypt without a password'); | ||
| } | ||
| const salt = encrypted.slice(0, 16); | ||
| const iv = encrypted.slice(16, 28); | ||
| const data = encrypted.slice(28); | ||
| const key = await generateKey(password, salt); | ||
| const decryptedContent = await subtle.decrypt({ ...encryptionConfig, iv }, key, data); | ||
| return arrayBufferToUtf8String(decryptedContent); | ||
| }; | ||
| } | ||
| const decrypt = createDecrypt(arrayBufferToUtf8String, generateKey, subtle); | ||
| /** | ||
| * Creates a vault factory function that produces encrypted storage instances. | ||
@@ -209,3 +571,3 @@ * Vaults provide secure, password-protected storage for sensitive data with optional single-use mode. | ||
| return function createVault(singleUse = false) { | ||
| let password = Array.from(getRandomValues(16)) | ||
| let password = from(getRandomValues(16)) | ||
| .map((b) => b.toString(16).padStart(2, '0')) | ||
@@ -215,3 +577,3 @@ .join(''); | ||
| let isVaultClosed = false; | ||
| let storage = new Map(); | ||
| let storage = createMap(); | ||
| /** | ||
@@ -227,9 +589,9 @@ * Writes an encrypted value to the vault with the specified label. | ||
| if (isVaultClosed) { | ||
| throw new Error('Vault is closed.'); | ||
| throw createError('Vault is closed.'); | ||
| } | ||
| if (!label) { | ||
| throw new Error('Label is required.'); | ||
| throw createError('Label is required.'); | ||
| } | ||
| if (!value) { | ||
| throw new Error('Value is required.'); | ||
| throw createError('Value is required.'); | ||
| } | ||
@@ -250,9 +612,9 @@ const encryptedValue = await encrypt(value, password); | ||
| if (isVaultClosed) { | ||
| throw new Error('Vault is closed.'); | ||
| throw createError('Vault is closed.'); | ||
| } | ||
| if (!label) { | ||
| throw new Error('Label is required.'); | ||
| throw createError('Label is required.'); | ||
| } | ||
| if (!password) { | ||
| throw new Error('Password is required.'); | ||
| throw createError('Password is required.'); | ||
| } | ||
@@ -278,3 +640,3 @@ const encryptedValue = storage.get(label); | ||
| if (isVaultClosed) { | ||
| throw new Error('Vault is closed.'); | ||
| throw createError('Vault is closed.'); | ||
| } | ||
@@ -297,3 +659,3 @@ if (isPasswordAccessed) { | ||
| } | ||
| const vault = Object.create(null, { | ||
| const vault = create(null, { | ||
| write: { | ||
@@ -324,3 +686,4 @@ value: write, | ||
| }); | ||
| return vault; | ||
| // Freeze to prevent addition of new properties | ||
| return freeze(vault); | ||
| }; | ||
@@ -338,4 +701,4 @@ } | ||
| function randomPseudo(seed) { | ||
| const x = Math.sin(seed) * 10000; | ||
| return x - Math.floor(x); | ||
| const x = sin(seed) * 10000; | ||
| return x - floor(x); | ||
| } | ||
@@ -354,2 +717,20 @@ | ||
| /** | ||
| * Safe copies of Number built-in methods and constants. | ||
| * | ||
| * These references are captured at module initialization time to protect against | ||
| * prototype pollution attacks. Import only what you need for tree-shaking. | ||
| * | ||
| * @module @hyperfrontend/immutable-api-utils/built-in-copy/number | ||
| */ | ||
| // Capture references at module initialization time | ||
| const _isNaN = globalThis.isNaN; | ||
| // ============================================================================ | ||
| // Global Type Checking (legacy, less strict) | ||
| // ============================================================================ | ||
| /** | ||
| * (Safe copy) Global isNaN function (coerces to number first, less strict than Number.isNaN). | ||
| */ | ||
| const globalIsNaN = _isNaN; | ||
| /** | ||
| * Normalizes a given time to the nearest base time window. | ||
@@ -362,12 +743,12 @@ * | ||
| function normalizeToBaseTimeWindow(time, baseTimeWindow) { | ||
| if (!time || !(time instanceof Date) || isNaN(time.getTime())) { | ||
| throw new Error('Invalid time input'); | ||
| if (!time || !(time instanceof Date) || globalIsNaN(time.getTime())) { | ||
| throw createError('Invalid time input'); | ||
| } | ||
| if (baseTimeWindow <= 0) { | ||
| throw new Error('Base time window must be positive'); | ||
| throw createError('Base time window must be positive'); | ||
| } | ||
| const timeInMs = time.getTime(); | ||
| const windowInMs = baseTimeWindow * 60 * 1000; | ||
| const normalizedTimeInMs = Math.floor(timeInMs / windowInMs) * windowInMs; | ||
| return new Date(normalizedTimeInMs); | ||
| const normalizedTimeInMs = floor(timeInMs / windowInMs) * windowInMs; | ||
| return createDate(normalizedTimeInMs); | ||
| } | ||
@@ -385,5 +766,5 @@ | ||
| if (getType(windowOffset) !== 'number' || windowOffset < -1 || 1 < windowOffset) { | ||
| throw new Error('Window offset must be -1, 0, or 1.'); | ||
| throw createError('Window offset must be -1, 0, or 1.'); | ||
| } | ||
| const offsetTime = new Date(currentUtcTime.getTime() + windowOffset * baseTimeWindow * 60000); | ||
| const offsetTime = createDate(currentUtcTime.getTime() + windowOffset * baseTimeWindow * 60000); | ||
| return await createHash(randomPseudoTimeBased(normalizeToBaseTimeWindow(offsetTime, baseTimeWindow)).toString()); | ||
@@ -406,3 +787,3 @@ }; | ||
| * Creates a factory function that generates time-based password generators for multiple time windows. | ||
| * Returns an object with methods to generate passwords for current, previous, and next time windows. | ||
| * Returns a frozen object with methods to generate passwords for current, previous, and next time windows. | ||
| * | ||
@@ -417,3 +798,4 @@ * @param getTimeBasedPassword - Function to generate a single time-based password with window offset | ||
| const next = () => getTimeBasedPassword(currentUtcTime, baseTimeWindow, 1); | ||
| return { current, previous, next }; | ||
| // Freeze to prevent runtime modification of password generator methods | ||
| return freeze({ current, previous, next }); | ||
| }; | ||
@@ -420,0 +802,0 @@ } |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.esm.js","sources":["../../../../../../../../libs/cryptography/src/lib/create-hash/node.ts","../../../../../../../../libs/cryptography/src/lib/get-random-values/node.ts","../../../../../../../../libs/utils/string/src/lib/shared-consts.ts","../../../../../../../../libs/utils/string/src/lib/array-buffer-to-utf8-string/array-buffer-to-utf8-string.ts","../../../../../../../../libs/utils/string/src/lib/utf8-string-to-uint8-array/node/utf8-string-to-uint8-array.ts","../../../../../../../../libs/cryptography/src/lib/subtle/node.ts","../../../../../../../../libs/utils/data/src/shared/consts.ts","../../../../../../../../libs/utils/data/src/get-type.ts","../../../../../../../../libs/cryptography/src/lib/encryption-config.ts","../../../../../../../../libs/cryptography/src/lib/generate-key/create-key-generator.ts","../../../../../../../../libs/cryptography/src/lib/generate-key/node.ts","../../../../../../../../libs/cryptography/src/lib/encrypt/create-encrypt.ts","../../../../../../../../libs/cryptography/src/lib/encrypt/node.ts","../../../../../../../../libs/cryptography/src/lib/decrypt/create-decrypt.ts","../../../../../../../../libs/cryptography/src/lib/decrypt/node.ts","../../../../../../../../libs/cryptography/src/lib/create-vault/create-value-creator.ts","../../../../../../../../libs/cryptography/src/lib/create-vault/node.ts","../../../../../../../../libs/utils/random-generator/src/random-pseudo.ts","../../../../../../../../libs/utils/random-generator/src/random-pseudo-time-based.ts","../../../../../../../../libs/utils/time/src/normalize-to-base-time-window.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-password/create-get-time-based-password.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-password/node.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/create-get-time-based-passwords.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/node.ts","../../../../../../../../libs/cryptography/src/lib/is-sha-256-hash.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["_createHash"],"mappings":";;AAGA;;;;;;;AAOG;AACI,eAAe,UAAU,CAAC,IAAY,EAAE,YAA2B,SAAS,EAAA;IACjF,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAI;AACrC,QAAA,IAAI;AACF,YAAA,MAAM,IAAI,GAAGA,YAAW,CAAC,SAAS,CAAC,C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CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;AAClH,IAAA,CAAC;AACH;;ACpBA;;;;;;;;AAQG;MACU,oBAAoB,GAAG,0BAA0B,CAAC,UAAU;;ACVzE;;;;;;AAMG;AACG,SAAU,wBAAwB,CACtC,oBAAkH,EAAA;AAElH,IAAA,OAAO,SAAS,qBAAqB,CAAC,cAAc,EAAE,cAAc,EAAA;AAClE,QAAA,MAAM,OAAO,GAAG,MAAM,oBAAoB,CAAC,cAAc,EAAE,cAAc,EAAE,CAAC,CAAC;AAC7E,QAAA,MAAM,QAAQ,GAAG,MAAM,oBAAoB,CAAC,cAAc,EAAE,cAAc,EAAE,EAAE,CAAC;AAC/E,QAAA,MAAM,IAAI,GAAG,MAAM,oBAAoB,CAAC,cAAc,EAAE,cAAc,EAAE,CAAC,CAAC;AAC1E,QAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE;AACpC,IAAA,CAAC;AACH;;ACfA;;;;;;;AAOG;MACU,qBAAqB,GAAG,wBAAwB,CAAC,oBAAoB;;ACTlF;;;;;;AAMG;AACG,SAAU,YAAY,CAAC,IAAa,EAAA;AACxC,IAAA,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,QAAQ,GAAG,iBAAiB,CAAC,IAAI,CAAS,IAAI,CAAC,GAAG,KAAK;AAClF;;;;"} | ||
| {"version":3,"file":"index.esm.js","sources":["../../../../../../../../libs/utils/immutable-api/src/built-in-copy/error/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/promise/index.ts","../../../../../../../../libs/cryptography/src/lib/create-hash/node.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/encoding/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/typed-arrays/index.ts","../../../../../../../../libs/utils/string/src/lib/shared-consts.ts","../../../../../../../../libs/utils/string/src/lib/array-buffer-to-utf8-string/array-buffer-to-utf8-string.ts","../../../../../../../../libs/utils/string/src/lib/utf8-string-to-uint8-array/node/utf8-string-to-uint8-array.ts","../../../../../../../../libs/cryptography/src/lib/subtle/node.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/object/index.ts","../../../../../../../../libs/utils/data/src/shared/consts.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/array/index.ts","../../../../../../../../libs/utils/data/src/get-type.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/map/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/date/index.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/math/index.ts","../../../../../../../../libs/cryptography/src/lib/encryption-config.ts","../../../../../../../../libs/cryptography/src/lib/generate-key/create-key-generator.ts","../../../../../../../../libs/cryptography/src/lib/generate-key/node.ts","../../../../../../../../libs/cryptography/src/lib/decrypt/create-decrypt.ts","../../../../../../../../libs/cryptography/src/lib/decrypt/node.ts","../../../../../../../../libs/cryptography/src/lib/get-random-values/node.ts","../../../../../../../../libs/cryptography/src/lib/encrypt/create-encrypt.ts","../../../../../../../../libs/cryptography/src/lib/encrypt/node.ts","../../../../../../../../libs/cryptography/src/lib/create-vault/create-value-creator.ts","../../../../../../../../libs/cryptography/src/lib/create-vault/node.ts","../../../../../../../../libs/utils/random-generator/src/random-pseudo.ts","../../../../../../../../libs/utils/random-generator/src/random-pseudo-time-based.ts","../../../../../../../../libs/utils/immutable-api/src/built-in-copy/number/index.ts","../../../../../../../../libs/utils/time/src/normalize-to-base-time-window.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-password/create-get-time-based-password.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-password/node.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/create-get-time-based-passwords.ts","../../../../../../../../libs/cryptography/src/lib/get-time-based-passwords/node.ts","../../../../../../../../libs/cryptography/src/lib/is-sha-256-hash.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null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c,EAAE,CAAC,CAAC;;QAE1E,OAAO,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC5C,IAAA,CAAC;AACH;;ACjBA;;;;;;;AAOG;MACU,qBAAqB,GAAG,wBAAwB,CAAC,oBAAoB;;ACTlF;;;;;;AAMG;AACG,SAAU,YAAY,CAAC,IAAa,EAAA;AACxC,IAAA,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,QAAQ,GAAG,iBAAiB,CAAC,IAAI,CAAS,IAAI,CAAC,GAAG,KAAK;AAClF;;;;"} |
+1
-1
| { | ||
| "name": "@hyperfrontend/cryptography", | ||
| "version": "0.0.2", | ||
| "version": "0.0.3", | ||
| "description": "Cryptography utilities for browser and Node.js environments.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
364351
52.34%4948
82.52%