Skip to content

Releases: anbkit/fise

v0.1.5 - Standardize interfaces convention

01 Dec 19:55

Choose a tag to compare

Breaking Changes

  • Function Naming Convention: Standardized all function names with fise prefix for better discoverability
    • encryptFise()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.cipher or options.binaryCipher
    • Migration: Remove cipher parameter 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.tssrc/fiseEncrypt.ts
    • src/encryptBinaryFise.tssrc/fiseBinaryEncrypt.ts
    • Test files also renamed: encryptFise.test.mjsfiseEncrypt.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

28 Nov 13:48

Choose a tag to compare

Breaking Changes

  • Timestamp API: Changed from timestampMinutes to timestamp in EncryptOptions and DecryptOptions
    • More flexible - accepts any numeric timestamp value (not limited to minutes)
    • Rules can interpret timestamp as needed (minutes, seconds, milliseconds, etc.)
    • Migration: Replace timestampMinutes with timestamp in 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 data
    • xorBinaryCipher - Binary-optimized XOR cipher that operates directly on Uint8Array (no string conversion)
    • defaultBinaryRules - Binary-native rules optimized for Uint8Array operations
    • randomSaltBinary() - Generates random binary salt as Uint8Array
  • Rules Sharing: String and binary encryption can now share the same FiseRules interface
    • 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
  • Metadata Support: Added metadata field to FiseContext, EncryptOptions, and DecryptOptions
    • Pass custom values (e.g., productId, userId) to rules via metadata object
    • 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
  • Comprehensive Binary Test Suite: Added encryptFiseBinary.test.mjs with 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 both string and Uint8Array generics
    • FiseRules<string> for text-based encryption
    • FiseRules<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

27 Nov 13:08

Choose a tag to compare

  • 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

26 Nov 10:07

Choose a tag to compare

  • Update import for page fise

v0.1.1 - Hotfix

26 Nov 00:50

Choose a tag to compare

  • 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

25 Nov 20:58

Choose a tag to compare

Initial release of FISE — Fast Internet Secure Extensible.
Includes:

  • core pipeline (encrypt/decrypt)
  • rule engine
  • metadata + salt system
  • performance benchmarks
  • security docs