Skip to content

Coderkube-App/bot-proof-storage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bot-Proof Storage

High-security browser storage library with built-in behavioral bot detection and encrypted client-side persistence.


Overview

bot-proof-storage is a secure wrapper around localStorage and sessionStorage designed to protect sensitive client-side data from bots, scrapers, and automated scripts.

Unlike traditional storage libraries that only encrypt data, this library actively monitors behavioral patterns to identify suspicious activity and automatically sanitize storage when threats are detected.


Features

  • AES-256 encrypted storage
  • Behavioral bot detection
  • Automatic storage sanitization
  • LocalStorage & SessionStorage support
  • SSR-safe implementation
  • Lightweight and dependency minimal

Security System

The library combines encrypted storage with behavioral analysis to detect automation patterns in real time.

Detection Signals

  • Linearity Detection Identifies unnatural straight-line mouse movement patterns commonly generated by bots.

  • Velocity Analysis Detects inhuman interaction speeds and unrealistic event timing.

  • Cadence Monitoring Flags repetitive and perfectly timed interaction sequences.


Active Defense

When suspicious behavior is confirmed:

  • Sensitive storage can be automatically cleared
  • Access to stored data is blocked
  • Custom security callbacks can be triggered

This helps prevent token extraction and unauthorized automation attacks.


Tech Stack

  • JavaScript / TypeScript
  • CryptoJS (AES-256 Encryption)
  • Browser Storage APIs

Installation

npm install bot-proof-storage

Usage

import { BotProofStorage } from 'bot-proof-storage';

const storage = new BotProofStorage({
  secretKey: 'your-secret-key',
  storageType: 'local',
  sensitivity: 0.5,
  autoWipeOnBot: true,
  onBotDetected: () => {
    console.error('Bot activity detected');
  }
});

storage.setItem('session', {
  token: 'xyz123'
});

const data = storage.getItem('session');

Configuration

Option Description
secretKey Encryption key used for AES protection
storageType local or session storage
sensitivity Detection strictness from 0.1 to 1.0
autoWipeOnBot Automatically clears storage on detection
onBotDetected Callback triggered on suspicious activity

Storage Flow

User Interaction
        ↓
Behavior Analysis
        ↓
Bot Detection Engine
        ↓
Encrypted Storage Access
        ↓
Auto Defense (Optional)

Use Cases

  • Authentication token protection
  • Secure session persistence
  • Anti-bot web applications
  • High-security client-side storage
  • Fraud prevention systems

SSR Support

The library includes built-in safeguards for environments such as:

  • Next.js
  • Server-side rendering applications
  • Hybrid rendering frameworks

Purpose

bot-proof-storage is designed for applications requiring stronger client-side protection than traditional encrypted storage solutions.

It provides:

  • Secure encrypted persistence
  • Behavioral threat detection
  • Automated response mechanisms
  • Lightweight integration into modern web apps

License

This project is licensed under the Apache-2.0 License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors