Skip to content

Sarvesh2005-code/subtext

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Subtext 🥷

The database is a lie.

Subtext is a high-performance, offline relational database engine that abandons traditional storage files. Instead, it mathematically embeds standard SQL table data into the Least Significant Bits (LSB) of standard image directories.

To the OS, you have a folder of high-resolution wallpapers. To Subtext, you have a fully ACID-compliant, SQL-driven Append-Only Log.

The "Wow" Factor

No cloud. No .db files. No network connections.

$ ls -l ~/Pictures/Wallpapers
-rw-r--r--  1 user  staff   5.2M  bg_01.png
-rw-r--r--  1 user  staff   4.8M  bg_02.png
-rw-r--r--  1 user  staff   6.1M  bg_03.png

$ subtext sql ~/Pictures/Wallpapers "SELECT username, hash FROM users WHERE id = 1"
+----------+----------------------------------+
| username | hash                             |
+----------+----------------------------------+
| sarvesh  | a9f0e61d137b...                  |
+----------+----------------------------------+

How It Works

Subtext treats a folder of PNGs/JPGs as a fragmented, Virtual File System (VFS).

  1. The MBR: The first 64KB of the first image acts as the Master Boot Record, storing the dynamic SQL Schema Registry.
  2. LSM Architecture: To prevent the CPU overhead of rewriting entire 5MB images for a single UPDATE, Subtext operates as a Log-Structured Merge-Tree (LSM). Data is serialized into ultra-dense postcard binaries and appended sequentially across the image pixels.
  3. Plausible Deniability: Before any data touches a pixel, it is masked via a deterministic XOR cipher. Running strings on the raw images yields nothing but cryptographic noise. Visually, the pixels shift by a maximum of ±2 RGB values, rendering the data mathematically invisible to the human eye.

Installation & Usage

1. Initialize the Directory Turns a standard folder of images into a Subtext storage block.

subtext init ./my_images

2. Execute SQL Subtext supports standard single-table CRUD operations.

subtext sql ./my_images "CREATE TABLE secrets (id INT, payload TEXT)"
subtext sql ./my_images "INSERT INTO secrets VALUES (1, 'The ghost is in the machine')"

3. Vacuum (Garbage Collection) Because it is an append-only log, updates leave "dead pixels" behind. Run vacuum to compact the data and free up image capacity.

subtext vacuum ./my_images

Security OPSEC

By default, Subtext secures the XOR cipher by hashing the absolute directory path. For true security, provide your own encryption key via the environment variable:

export SUBTEXT_KEY="your_super_secret_key"

Built for the shadows. Rule your domain.

About

Subtext is a high-performance, offline relational database engine that abandons traditional storage files. Instead, it mathematically embeds standard SQL table data into the Least Significant Bits (LSB) of standard image directories.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors