JSPM

xypriss-acpes

1.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q46188F
  • License MIT

XyPriss Security is an advanced JavaScript security library designed for enterprise applications. It provides military-grade encryption, secure data structures, quantum-resistant cryptography, and comprehensive security utilities for modern web applications.

Package Exports

  • xypriss-acpes
  • xypriss-acpes/package.json

Readme

ACPES - Advanced Cross-Platform Encrypted Storage

npm version TypeScript License: MIT

ACPES is a secure, cross-platform storage solution that works seamlessly across Web, Mobile (React Native), and Node.js environments. It provides military-grade encryption, automatic platform detection, and comprehensive security features.

Migration Notice: The XyPriss library is the separated version of FortifyJS accessible via the link or using npm install fortify2-js. The FortifyJS library will be deprecated soon, so start moving from it to XyPriss for future improvements.

Features

  • Cross-Platform Compatibility: Works on Web, Mobile (React Native), and Node.js
  • Triple-Layer Encryption: Base + Double AES-256 + Advanced user-key encryption
  • Binary Obfuscation: Data converted to binary for maximum unreadability
  • User-Specified Keys: Custom encryption keys for maximum security control
  • Integrity Verification: HMAC-SHA256 checksums prevent data tampering
  • Device Fingerprinting: Unique encryption keys per device
  • Automatic Lockout: Protection against brute force attacks
  • TTL Support: Automatic data expiration
  • Compression: LZ-string compression for large data
  • Architecture: Import only what you need
  • TypeScript Support: Full type definitions included

Installation

npm install xypriss-acpes
# or
yarn add xypriss-acpes
# or
pnpm add xypriss-acpes

Quick Start

import { Storage, STORAGE_KEYS } from "xypriss-acpes";

// Store sensitive data
await Storage.setItem(STORAGE_KEYS.SESSION_TOKEN, "hello world");

// Retrieve data
const token = await Storage.getItem(STORAGE_KEYS.SESSION_TOKEN);

// Store with TTL (expires in 1 hour)
await Storage.setItemWithTTL("temp-data", "value", 3600);

// Advanced encryption with user-specified key
await Storage.setItem("top-secret", "classified-data", {
    userEncryptionKey: "MySecretKey2024!",
    advancedEncryption: true,
    enableBinaryEncoding: true,
});

// Check platform capabilities
const info = Storage.getPlatformInfo();
console.log(`Platform: ${info.platform}, Has Keychain: ${info.hasKeychain}`);

Platform Support

Web

  • localStorage: Primary storage for small data
  • IndexedDB: Fallback for large data or when localStorage is unavailable
  • Memory: Final fallback for unsupported browsers

Mobile (React Native)

  • Keychain (iOS): Secure keychain storage with biometric support
  • Keystore (Android): Android keystore integration
  • Biometric Authentication: Touch ID, Face ID, and fingerprint support

Node.js

  • File System: Encrypted file storage with proper permissions
  • Memory: Fallback for restricted environments

Security Features

Encryption

  • Double AES-256: Two layers of AES-256 encryption
  • PBKDF2 Key Derivation: 10,000 iterations for key strengthening
  • Device-Specific Keys: Unique keys per device using fingerprinting

Integrity Protection

  • HMAC-SHA256: Cryptographic checksums for data integrity
  • Version Validation: Automatic handling of format changes
  • Corruption Detection: Automatic cleanup of corrupted data

Access Control

  • Automatic Lockout: Configurable failed attempt limits
  • Security Metrics: Detailed access attempt tracking
  • Manual Unlock: Administrative override capabilities

Advanced Usage

Custom Configuration

import { ACPES } from "xypriss-acpes";

const customStorage = new ACPES({
    nodeStoragePath: "/custom/secure/path",
});

Platform-Specific Options

// Web with IndexedDB and compression
await Storage.setItem("data", largeJsonString, {
    useIndexedDB: true,
    compressionEnabled: true,
});

// Mobile with biometric authentication
await Storage.setItem("sensitive-data", value, {
    touchID: true,
    requireAuth: true,
    service: "MyApp",
});

// Node.js with custom file path
await Storage.setItem("server-config", config, {
    filePath: "/etc/myapp/secure.enc",
});

Security Monitoring

// Check security status
const metrics = Storage.getSecurityMetrics("sensitive-key");
if (metrics.isLocked) {
    console.log(`Service locked until: ${new Date(metrics.lockUntil)}`);
}

// Manual unlock if needed
await Storage.unlockService("sensitive-key");

API Reference

Core Methods

  • setItem(key, value, options?) - Store encrypted data
  • getItem(key, options?) - Retrieve and decrypt data
  • removeItem(key, options?) - Remove stored data
  • clear() - Remove all stored data
  • hasItem(key, options?) - Check if key exists

Utility Methods

  • setItemWithTTL(key, value, ttlSeconds, options?) - Store with expiration
  • updateItem(key, updater, options?) - Atomic updates
  • getPlatformInfo() - Get platform capabilities
  • getSecurityMetrics(key) - Get security status
  • unlockService(key) - Manual unlock

Documentation

Requirements

Web

  • Modern browsers with localStorage support
  • IndexedDB support (optional, for enhanced features)

Mobile

  • React Native 0.60+
  • react-native-keychain (for secure storage)

Node.js

  • Node.js 14+
  • File system write permissions

License

MIT License - see LICENSE file for details.

Contributing

Contributions are welcome! Please read our Contributing Guide for details on our code of conduct and development process.

Changelog

See CHANGELOG.md for version history and changes.