Releases: anbkit/fise
Releases · anbkit/fise
v0.1.5 - Standardize interfaces convention
Breaking Changes
- Function Naming Convention: Standardized all function names with
fiseprefix for better discoverabilityencryptFise()→fiseEncrypt()decryptFise()→fiseDecrypt()encryptBinaryFise()→fiseBinaryEncrypt()decryptBinaryFise()→fiseBinaryDecrypt()- Migration: Update all function calls in your code:
// Before import { encryptFise, decryptFise, encryptBinaryFise, decryptBinaryFise } from 'fise'; const encrypted = encryptFise(text, xorCipher, rules); const decrypted = decryptFise(encrypted, xorCipher, rules); // After import { fiseEncrypt, fiseDecrypt, fiseBinaryEncrypt, fiseBinaryDecrypt } from 'fise'; const encrypted = fiseEncrypt(text, rules); const decrypted = fiseDecrypt(encrypted, rules);
- Cipher Parameter Moved to Options: Cipher is now optional and defaults to
xorCipher/xorBinaryCipher- More ergonomic API - most users don't need to specify cipher
- Cipher can still be customized via
options.cipheroroptions.binaryCipher - Migration: Remove
cipherparameter from function calls:// Before fiseEncrypt(text, xorCipher, rules); fiseDecrypt(envelope, xorCipher, rules); fiseBinaryEncrypt(data, xorBinaryCipher, rules); // After (default cipher) fiseEncrypt(text, rules); fiseDecrypt(envelope, rules); fiseBinaryEncrypt(data, rules); // Or with custom cipher fiseEncrypt(text, rules, { cipher: myCustomCipher }); fiseBinaryEncrypt(data, rules, { binaryCipher: myCustomBinaryCipher });
- File Naming: Source files renamed to match function names
src/encryptFise.ts→src/fiseEncrypt.tssrc/encryptBinaryFise.ts→src/fiseBinaryEncrypt.ts- Test files also renamed:
encryptFise.test.mjs→fiseEncrypt.test.mjs, etc.
Changed
- API Simplification: Default cipher (
xorCipher/xorBinaryCipher) is now used automatically- Reduces boilerplate for common use cases
- Still allows custom ciphers when needed via options
- Documentation: Updated all documentation files to reflect new API:
- All code examples updated to use new function names
- All examples updated to use simplified API (cipher in options)
- Updated
QUICK_START.md,PLATFORM_SUPPORT.md,BUILDER.md,BINARY_ENVELOPE.md - Updated README.md and all other documentation files
Fixed
- All 188 tests passing with new API
- Comprehensive test coverage for all presets and edge cases
v0.1.4 - Support encrypt/decrypt binary data
Breaking Changes
- Timestamp API: Changed from
timestampMinutestotimestampinEncryptOptionsandDecryptOptions- More flexible - accepts any numeric timestamp value (not limited to minutes)
- Rules can interpret timestamp as needed (minutes, seconds, milliseconds, etc.)
- Migration: Replace
timestampMinuteswithtimestampin your code:// Before encryptFise(data, cipher, rules, { timestampMinutes: 12345 }); decryptFise(envelope, cipher, rules, { timestampMinutes: 12345 }); // After encryptFise(data, cipher, rules, { timestamp: 12345 }); decryptFise(envelope, cipher, rules, { timestamp: 12345 });
Added
- Binary Encryption Support: Pure binary encryption/decryption for video, images, and other binary data
encryptBinaryFise()- Encrypts binary data (Uint8Array) with pure binary envelopes (no base64 conversion)decryptBinaryFise()- Decrypts binary envelopes back to original binary dataxorBinaryCipher- Binary-optimized XOR cipher that operates directly on Uint8Array (no string conversion)defaultBinaryRules- Binary-native rules optimized for Uint8Array operationsrandomSaltBinary()- Generates random binary salt as Uint8Array
- Rules Sharing: String and binary encryption can now share the same
FiseRulesinterface- Text-based rules automatically adapt to binary operations via
normalizeFiseRulesBinary() - Binary-native rules (
FiseRules<Uint8Array>) for optimal performance - Seamless interoperability between string and binary encryption modes
- Text-based rules automatically adapt to binary operations via
- Metadata Support: Added
metadatafield toFiseContext,EncryptOptions, andDecryptOptions- Pass custom values (e.g.,
productId,userId) to rules viametadataobject - Rules can access metadata via
ctx.metadata?.productId - Enables per-item encryption patterns (e.g., different encryption per product ID)
- Metadata must match between encryption and decryption
- Pass custom values (e.g.,
- Comprehensive Binary Test Suite: Added
encryptFiseBinary.test.mjswith 28 tests covering:- Basic binary encryption/decryption roundtrips
- Large binary data (1MB+)
- Video-like data (random bytes, 50KB+)
- Edge cases (empty, single byte, all zeros, all 255s)
- UTF-8 encoded text as binary
- Image-like data (PNG headers)
- Error handling (invalid envelopes, mismatched timestamps/metadata)
- Rules sharing between string and binary modes
- Performance Optimizations:
- Binary envelopes avoid base64 conversion overhead
- Direct Uint8Array operations for maximum speed
- Optimized for large file encryption (videos, images)
Changed
- File Naming: All imports updated to use new file name
- Type System: Enhanced
FiseRules<T>to support bothstringandUint8ArraygenericsFiseRules<string>for text-based encryptionFiseRules<Uint8Array>for binary encryption- Shared rules can work with both modes
Fixed
- All 141 tests passing with binary encryption support
v0.1.3 - Simplify rule interface and add Rule builder
-
simplify FiseRules to 3 core security points and add rule builder
-
BREAKING CHANGE: FiseRules interface now only requires 3 methods (offset, encodeLength, decodeLength). All other methods are optional and handled internally with secure defaults.
Core changes:
- refactor(types): simplify FiseRules to only require offset, encodeLength, decodeLength
- refactor(types): remove SimpleFiseRules, MinimalFiseRules, UltraMinimalFiseRules interfaces
- refactor(types): remove encodedLengthSize, saltPosition, preExtractLength from public API
- feat(core): add normalizeFiseRules() to fill in optional methods with secure defaults
- feat(rules): implement FiseBuilder and FiseBuilderInstance for fluent rule construction
- feat(rules): add 12 preset builder methods (defaults, hex, base62, timestamp, fixed, etc.)
- refactor(encryptFise): update to use simplified FiseRules interface
- refactor(encryptFise): remove minSaltLength/maxSaltLength from EncryptOptions (now in rules.saltRange)
- refactor(defaultRules): simplify implementation to match new interface
v0.1.2 - Update import path
- Update import for page fise
v0.1.1 - Hotfix
- The new version includes Unicode support in toBase64() and fromBase64():
- Node.js: Uses Buffer.from(str, 'utf8') for proper UTF-8 handling
- Browser: Converts to UTF-8 bytes before btoa(), and properly decodes from atob()
v0.1.0 – Initial release
Initial release of FISE — Fast Internet Secure Extensible.
Includes:
- core pipeline (encrypt/decrypt)
- rule engine
- metadata + salt system
- performance benchmarks
- security docs