Protect Your Sensitive Files with Frostbite

A powerful Node.js utility for selective file encryption that keeps your sensitive data secure.

Frostbite Logo

Key Features

Strong Encryption

AES-256-GCM encryption with secure key derivation using PBKDF2 with salt.

Selective Encryption

Encrypt individual files or entire directories with customizable ignore patterns.

License Key Binding

Add an extra layer of security with optional license key binding.

Key Rotation

Easily re-encrypt files with a new key to maintain security best practices.

Memory-Only Decryption

Decrypt files in memory without writing sensitive data to disk.

Live Project Support

Seamlessly integrate with live applications using the runtime API.

Installation

Global Installation

npm install -g frostbite

Install globally to use the CLI commands from anywhere.

Project Installation

npm install --save frostbite

Install as a project dependency to use the programmatic API.

Usage

Command Line Interface

# Encrypt a file or directory
frostbite lock path/to/sensitive --key mySecretKey

# Decrypt a file or directory
frostbite unlock path/to/sensitive.fbz --key mySecretKey

# Re-encrypt with a new key
frostbite rekey path/to/sensitive.fbz --old-key oldKey --new-key newKey

# Watch files for changes (live project mode)
frostbite watch path/to/directory --key mySecretKey

Programmatic API

const frostbite = require('frostbite');

// Encrypt a file or directory
await frostbite.encrypt('path/to/sensitive', {
  key: 'mySecretKey',
  license: 'optional-license'
});

// Decrypt a file or directory
await frostbite.decrypt('path/to/sensitive.fbz', {
  key: 'mySecretKey',
  license: 'optional-license'
});

// Re-encrypt with a new key
await frostbite.rekey('path/to/sensitive.fbz', {
  oldKey: 'oldSecretKey',
  newKey: 'newSecretKey'
});

Runtime API for Live Projects

const frostbite = require('frostbite');

// Create a runtime instance
const runtime = frostbite.createRuntime({
  key: process.env.FROSTBITE_KEY
});

// Initialize the runtime
await runtime.initialize();

// Decrypt a file without writing to disk
const config = await runtime.requireJSON('./config.json.fbz');

// Watch files for changes
await runtime.watch('./config', {
  autoDecrypt: true,
  autoEncrypt: true
});

Examples

Encrypting Configuration Files

Keep your sensitive configuration files secure while still allowing your application to access them.

View Example

Live Project Integration

See how to integrate Frostbite into a live Node.js application with automatic configuration reloading.

View Example

CI/CD Pipeline Integration

Learn how to securely manage encrypted files in your continuous integration and deployment workflows.

View Example

Documentation