🚀 Support ZOSCII

This software is free and open-source. Help prove ZOSCII works by using it.

Can you crack the ZOSCII Snake Oil Challenge?

Learn more at ZOSCIICOIN

CyborgUnicorn.UNINTELLIGENCE / CyborgUnicorn.ZOSCII

The complete .NET SDK for ZOSCII (Zero Overhead Secure Code Information Interchange) — information-theoretically secure encoding, peer-to-peer ROM exchange, and message queue integration. Achieves I(M;A)=0: the encoded output is statistically independent of the input without the ROM key material.

Not encryption. ZOSCII is encoding — address-based indirection, not mathematical transformation. No algorithm to break, no key derivation to attack. Security is combinatorial and information-theoretic, not computational.

Table of Contents

1. Overview

CyborgUnicorn.UNINTELLIGENCE is the full-featured SDK including UNSIGNAL, PENTAGONE, MicroZOSCII, ROMExchange, and MQClient — everything needed to build zero-knowledge secure communication systems in .NET.

Class Prefix Purpose
ZZOSCII encode / decode / verify
UUNSIGNAL encode / decode / verify
BBinary operations: compare, split, join, verify (PENTAGONE)
MQMessage Queue: queue, store, replication, monitoring
MicroZOSCIIBootstrap encoding for ROM exchange
ROMExchangePeer-to-peer ROM exchange over TCP
Feature ZOSCII UNSIGNAL AES-256
Security Basis Information-theoretic Information-theoretic Computational
Quantum Resistant ✅ Yes ✅ Yes ❌ No
Harvest-Now-Decrypt-Later ✅ Immune ✅ Immune ❌ Vulnerable
Output Size 2× input 2× input + header ~1× input
ROM Required Yes (64KB+) Yes (128KB) No
I(M;A)=0 ✅ Yes ✅ Yes ❌ No

2. Installation

Install via NuGet Package Manager:

dotnet add package CyborgUnicorn.UNINTELLIGENCE

Or via the NuGet Package Manager Console in Visual Studio:

Install-Package CyborgUnicorn.UNINTELLIGENCE

Add the namespace to your files:

using CyborgUnicorn.ZOSCII;

3. Core Concepts

What is a ROM?

The ROM (Read-Only Memory) is your key material — a file, typically a JPEG or MP3, loaded into memory as a byte array. Both sides of a communication must hold an identical ROM. The ROM is never transmitted — only addresses into it are sent on the wire.

The ROM is everything. Protect it like a private key. Anyone with your ROM can decode all communications encoded with it. The ROM does not expire mathematically — rotate it when you choose to, not when forced to.

How ZOSCII Encoding Works

For each byte of plaintext, ZOSCII randomly selects one of the many positions in the ROM where that byte value appears. The position (address) is transmitted — not the byte itself. Without the ROM, an observer sees a stream of addresses that are statistically independent of the original data.

ZOSCII vs UNSIGNAL

ZOSCII is pure address-based encoding — simple, fast, 2× expansion. Use it for general-purpose encoding where both parties have the same ROM.

UNSIGNAL adds a moving-window header mechanism, random prefix/suffix lengths, and an offset scheme. Use it for the highest-assurance communications — it is the recommended encoding for most use cases.

4. ROM — Your Key Material

Load a ROM from a file (JPEG, MP3, or any binary file with good entropy), from raw bytes, or from a Base64 string. Always use a using block — ROM objects must be disposed.

using (ZOSCIIRom rom = ZOSCIIRom.FromFile("mykey.jpg")) 
{
    // use rom here
}

using (ZOSCIIRom rom = ZOSCIIRom.FromBytes(rawBytes)) { }
using (ZOSCIIRom rom = ZOSCIIRom.FromBase64(base64String)) { }
ROM Quality: Use a JPEG or MP3 with natural entropy. A good ROM has a non-uniform but not extreme byte distribution — natural physical bias from image/audio data is a feature, not a flaw. Avoid files that are mostly zeros or highly compressible. We recommend ROMs to be at least 64KB for ZOSCII and 128KB for UNSIGNAL.

Generating a ROM with EntropySugar + ROMGenerator

For programmatic ROM generation, use EntropySugar to collect system entropy and ROMGenerator to produce a signed ROM file:

var sugar = new EntropySugar();
sugar.CaptureFast(romsFolder);
sugar.CaptureSlow(dataFolder);
sugar.Add("FREE_MEM", freeMem.ToString());
sugar.Add("CPU_PCT", cpuPct.ToString());

byte[] rawRom = ROMGenerator.Bytes(new[] { @"C:\data\mp3s" }, sugar);

ROMGenerationResult result = ROMGenerator.File(
    new[] { @"C:\data\mp3s" }, sugar, signingRom, @"C:\data\roms", "session", 1);

5. ZOSCII Encode / Decode

All string overloads assume UTF-8. Both ends must agree on encoding.

// Bytes
byte[] encoded = ZEncode.Bytes(data, rom);
byte[] decoded = ZDecode.Bytes(encoded, rom);

// Strings
byte[] encoded = ZEncode.String("hello", rom);
string text    = ZDecode.ToString(encoded, rom);

// Files
ZEncode.File("input.bin", "output.zoc", rom);
ZDecode.File("output.zoc", "recovered.bin", rom);
string text = ZDecode.FileToString("output.zoc", rom);

// Base64
string b64   = ZEncode.ToBase64(data, rom);
byte[] back  = ZDecode.FromBase64(b64, rom);

// Chain (multiple ROMs in sequence)
byte[] chain     = ZEncode.Chain(data, new[] { rom1, rom2, rom3 });
byte[] unchained = ZDecode.Chain(chain, new[] { rom1, rom2, rom3 });
bool   ok        = ZEncode.ChainFile("input.bin", "output.zoc", new[] { rom1, rom2, rom3 });
bool   ok        = ZDecode.ChainFile("output.zoc", "recovered.bin", new[] { rom1, rom2, rom3 });

// Verify
bool blnMatch = ZVerify.File("encoded.zoc", "original.bin", rom);
bool blnMatch = ZVerify.Bytes(encodedBytes, plainBytes, rom);

6. UNSIGNAL Encode / Decode

UNSIGNAL adds a moving-window header with random offset, prefix, and suffix. Requires a 128KB ROM. Output format uses .sig extension by convention.

// Bytes
byte[] encoded = UEncode.Bytes(data, rom);
byte[] decoded = UDecode.Bytes(encoded, rom);

// Strings
byte[] encoded = UEncode.String("hello", rom);
string text    = UDecode.ToString(encoded, rom);

// Files
UEncode.File("input.bin", "output.sig", rom);
UDecode.File("output.sig", "recovered.bin", rom);
string text = UDecode.FileToString("output.sig", rom);

// Base64
string b64   = UEncode.ToBase64(data, rom);
byte[] back  = UDecode.FromBase64(b64, rom);

// Chain
byte[] chain     = UEncode.Chain(data, new[] { rom1, rom2, rom3 });
byte[] unchained = UDecode.Chain(chain, new[] { rom1, rom2, rom3 });
bool   ok        = UEncode.ChainFile("input.bin", "output.sig", new[] { rom1, rom2, rom3 });
bool   ok        = UDecode.ChainFile("output.sig", "recovered.bin", new[] { rom1, rom2, rom3 });

// Verify
bool blnMatch = UVerify.File("encoded.sig", "original.bin", rom);
Recommendation: Prefer UNSIGNAL over plain ZOSCII for all communications. The moving-window offset and random padding make traffic analysis significantly harder.

7. MQClient — Message Queue

The MQClient sends and receives raw bytes — encoding is the caller's responsibility. Use ZOSCII or UNSIGNAL to encode your payload before publishing, and decode after fetching.

Result Types

var mq = new MQClient();       // default 60s timeout
var mq = new MQClient(120);    // custom timeout

// User-Agent control (default: random GUID per request — anonymous)
mq.SetUserAgentRandom();           // fresh GUID on every request (default)
mq.SetUserAgentNone();             // omit User-Agent header entirely
mq.SetUserAgent("MyApp/1.0");     // fixed string until changed

string strServer = "https://your-server/index.php";

Queue Operations

// Publish
MQPublishResult pub = mq.Publish(strServer, "myqueue", arrEncodedBytes);

// Check for new messages without fetching content
MQCheckStatus status = mq.Check(strServer, "myqueue", strLastPointer);

// Fetch next message
MQFetchResult result = mq.FetchNext(strServer, "myqueue", strLastPointer);
if (result.HasMessage) 
{ 
    // decode result.EncodedBytes with your ROM
    strLastPointer = result.Pointer;  // advance only after processing
}

Store Operations

// Store (no queue association — server assigns filename)
MQPublishResult upload   = mq.Put(strServer, arrEncodedBytes);
MQFetchResult   retrieve = mq.Get(strServer, upload.StoredName);

// Scan for unidentified store files (-u suffix)
string[] arrUnidentified = mq.Scan(strServer);

// Identify (remove -u suffix after successful decode)
string[] arrIdentified = mq.Identify(strServer, arrUnidentified);

Replication (B2B)

// Pull one message from remote queue and publish locally — call in a loop
string strNewPointer;
MQPublishResult rep = mq.Replicate(strRemoteURL, strRemoteQueue, strLocalURL, strLocalQueue,
    strLastPointer, out strNewPointer, intRetentionDays_a: 7);
if (rep.Success && rep.ServerMessage != "up-to-date") { strLastPointer = strNewPointer; }

// Replicate to store (empty localQueue = store as unidentified, discoverable via Scan)
MQPublishResult rep = mq.Replicate(strRemoteURL, strRemoteQueue, strLocalURL, "",
    strLastPointer, out strNewPointer, intRetentionDays_a: 7);
Pointer tracking: The caller owns and persists the pointer. Advance it only after the message has been fully processed and decoded. Losing the pointer means re-fetching from the beginning.

8. MicroZOSCII — Bootstrap Encoding

MicroZOSCII solves the key distribution problem: how do you securely transmit a 128KB ROM to a new contact? It uses a compact 240-nibble microROM — representable as 3 × 54 base-62 characters — to encode and transmit the full ROM. The microROM can be derived from a Diffie-Hellman shared secret, typed in manually, scanned from a 2D barcode, or loaded from a contact list.

Wire efficiency: A 128KB ROM transmits as 262,144 1-byte addresses — exactly 2× expansion, same as standard ZOSCII.

Deriving a microROM

// From raw bytes (e.g. DH shared secret) — clamped to 240 nibbles
string strMicroROM = MicroZOSCII.FromBytes(arrSecret, null, null, null);
string strMicroROM = MicroZOSCII.FromBytes(arrS1, arrS2, arrS3, arrS4);  // up to 4 secrets

// From 3 x 54 base-62 strings (human entry, barcode, contact list)
string strMicroROM = MicroZOSCII.FromBase62(strChunk1, strChunk2, strChunk3);

Base-62 Conversion (for storage and display)

// Split microROM into 3 x 54 base-62 chunks for storage/display/QR codes
string[] arrChunks = MicroZOSCII.ToBase62(strMicroROM);  // returns string[3]

// Individual chunk conversion
string strHex    = MicroZOSCII.Base62ChunkToHex(strChunk);   // 54 chars → 80 hex nibbles
string strBase62 = MicroZOSCII.HexChunkToBase62(strHex);     // 80 hex nibbles → 54 chars

Distribution Check

// Check nibble distribution — int[16], index 0=count of '0' ... 15=count of 'F'
// Average is 15 per nibble (240/16).
// Recommended: discard and regenerate if any value falls below 5.
int[] arrDist = MicroZOSCII.GetDistribution(strMicroROM);

Encode / Decode

// Encode full ROM bytes → address array (2x expansion)
byte[] arrAddresses = MicroZOSCII.Encode(strMicroROM, arrROMBytes);

// Decode address array → full ROM bytes
byte[] arrROM = MicroZOSCII.Decode(strMicroROM, arrAddresses);
microROM Source Method Size Use Case
DH shared secret FromBytes 240 nibbles Automated online exchange
Manual entry FromBase62 240 nibbles Typed in by user
2D barcode scan FromBase62 240 nibbles QR code / DataMatrix
Contact list FromBase62 240 nibbles Pre-stored per contact

9. ROMExchange — Peer-to-Peer ROM Exchange

ROMExchange establishes a direct TCP connection between two parties, performs an optional Diffie-Hellman key exchange, and transmits a full ROM via MicroZOSCII encoding. DH exchange and ROM transmission are separate steps — either can be bypassed. No identifying information is sent at any point. The connection is maintained with a random GUID ping/pong keepalive until explicitly terminated.

Events

var objExchange = new ROMExchange();              // 60s timeout, 15s ping interval
var objExchange = new ROMExchange(120, 30000);    // custom timeout and ping interval

objExchange.OnConnection += (strHandle, strPeerIP) => { /* peer connected */ };
objExchange.OnTerminated += (strHandle) => { /* session ended */ };
objExchange.OnError      += (strHandle, strMessage) => { /* error occurred */ };

Bootstrap Method Registry

// Present available methods to the user before connecting
string[,] arrMethods = ROMExchange.GetBootstrapMethods();
// Currently returns: { { "DH", "Diffie-Hellman Key Exchange" } }

Listener Side (Server)

// Auto-accept: connection proceeds immediately
string strHandle = objExchange.Listen(9000);

// Manual accept: OnConnection fires, caller decides
string strHandle = objExchange.Listen(9000, false);        // 60s authorise timeout
string strHandle = objExchange.Listen(9000, false, 120);   // 120s authorise timeout

// In OnConnection handler:
objExchange.Authorise(strHandle);   // proceed
objExchange.Reject(strHandle);      // disconnect

Initiator Side (Client)

string strHandle = objExchange.Connect("192.168.1.5", 9000);
// OnConnection fires on success

DH Key Exchange (Optional)

// Both sides call independently — uses caller's ZOSCII ROM as private key source
// Each side uses their own ROM; the shared secret emerges from the math
byte[] arrSecret = objExchange.DHExchange(strHandle, objROM);

ROM Transmission

// Derive microROM from shared secret (or use FromBase62 for manual/barcode path)
string strMicroROM = MicroZOSCII.FromBytes(arrSecret, null, null, null);

// Listener sends the ROM
ROMExchangeResult objResult = objExchange.SendROM(strHandle, strMicroROM, arrROMBytes);

// Initiator receives the ROM
ROMExchangeResult objResult = objExchange.ReceiveROM(strHandle, strMicroROM);
if (objResult.Success) 
{ 
    byte[] arrROM = objResult.ROMBytes;
    // load into ZOSCIIRom.FromBytes(arrROM) for future use
}

Keepalive and Termination

// Start keepalive after all exchanges are complete
objExchange.StartKeepalive(strHandle);

// Check status
ROMExchangeStatus objStatus = objExchange.GetStatus(strHandle);

// Terminate from either end — other side receives OnTerminated event
objExchange.Terminate(strHandle);
Two-Stage Bootstrap (Recommended): For maximum security with better wire efficiency, use a two-stage approach:
  1. DH → microROM → MicroZOSCII encode a 16KB intermediate ROM (~65KB on wire)
  2. Use the 16KB ROM + ZEncode to send the full 128KB UNSIGNAL ROM (~256KB on wire)
Total: ~321KB vs 262KB single-stage, but with vastly greater combinatorial security at stage 1 (2,048^32,768 vs 16^262,144).

Complete Exchange Flow

Step Listener (Server) Initiator (Client)
1 Listen(port, false) —
2 — Connect(ip, port)
3 Authorise(handle) OnConnection fires
4 DHExchange(handle, rom) DHExchange(handle, rom)
5 MicroZOSCII.FromBytes(secret) MicroZOSCII.FromBytes(secret)
6 SendROM(handle, microROM, rom) ReceiveROM(handle, microROM)
7 StartKeepalive(handle) StartKeepalive(handle)
8 Terminate(handle) Terminate(handle)

10. PENTAGONE — 3-of-5 Redundancy

Split any data into 5 shares. Any 3 or more shares are sufficient to reconstruct the original. Useful for distributing ROM backups or any sensitive data across multiple locations.

// Split a file into 5 shares (.s1-.s5)
string[] arrShares = BSplit.File("data.sig", "data.sig");

// Reconstruct from any share path — sibling shares auto-discovered
string strOut = BJoin.File("data.sig.s2", "recovered.sig");

// Bytes
byte[][] arrShareBytes = BSplit.Bytes(data);
byte[]   arrRecovered  = BJoin.Bytes(new[] { arrShareBytes[0], null, arrShareBytes[2], 
                                             arrShareBytes[3], null });
// Pass null for missing shares (minimum 3 non-null required)

11. Utilities

BVerify — Binary Comparison

bool blnMatch = BVerify.File("file1.bin", "file2.bin");
bool blnMatch = BVerify.Bytes(arr1, arr2);

SecureDelete

SecureDelete.File("sensitive.bin");
SecureDelete.Folder("sensitive_dir");

Source — Extract Embedded Source

bool blnOk = Source.SaveAs(@"C:\MyFolder\CyborgUnicorn.UNINTELLIGENCE.source.zip");

12. Common Workflows

Secure Chat Over MQ

Both parties agree on a queue GUID and a shared ROM out of band (in person, phone, QR code). All messages are UNSIGNAL-encoded before publishing. The server sees only anonymous blobs.

// Sender
using (ZOSCIIRom objROM = ZOSCIIRom.FromFile("shared.jpg"))
{
    byte[] arrEncoded = UEncode.String("Hello!", objROM);
    mq.Publish(strServer, strQueueGUID, arrEncoded);
}

// Receiver
using (ZOSCIIRom objROM = ZOSCIIRom.FromFile("shared.jpg"))
{
    MQFetchResult objMsg = mq.FetchNext(strServer, strQueueGUID, strPointer);
    if (objMsg.HasMessage)
    {
        string strText = UDecode.ToString(objMsg.EncodedBytes, objROM);
        strPointer = objMsg.Pointer;
    }
}

New Contact ROM Exchange

When establishing a new secure channel, use ROMExchange to bootstrap the shared ROM:

// Both sides: set up events, then connect
var objExchange = new ROMExchange();
objExchange.OnConnection += (h, ip) => Console.WriteLine("Connected: " + ip);
objExchange.OnTerminated += (h) => Console.WriteLine("Terminated");

// Server
string strHandle = objExchange.Listen(9000, false);
// ... authorise on incoming connection ...
objExchange.Authorise(strHandle);

// Client  
string strHandle = objExchange.Connect("192.168.1.5", 9000);

// Both sides — DH exchange
using (ZOSCIIRom objMyROM = ZOSCIIRom.FromFile("mykey.jpg"))
{
    byte[] arrSecret   = objExchange.DHExchange(strHandle, objMyROM);
    string strMicroROM = MicroZOSCII.FromBytes(arrSecret, null, null, null);

    // Server sends, client receives
    // Server: objExchange.SendROM(strHandle, strMicroROM, arrSharedROMBytes);
    // Client: var objResult = objExchange.ReceiveROM(strHandle, strMicroROM);
}

objExchange.StartKeepalive(strHandle);
// ... use MQ with new shared ROM ...
objExchange.Terminate(strHandle);

Bypassing DH — Manual / Barcode ROM Exchange

If both parties already have the microROM seeds (typed in, scanned, or from a contact list), skip DH entirely:

string strMicroROM = MicroZOSCII.FromBase62(strChunk1, strChunk2, strChunk3);

// Check distribution before use
int[] arrDist = MicroZOSCII.GetDistribution(strMicroROM);
// Verify no value below 5

// Server sends ROM directly
objExchange.SendROM(strHandle, strMicroROM, arrROMBytes);

// Client receives ROM directly  
var objResult = objExchange.ReceiveROM(strHandle, strMicroROM);

13. Security Notes

🔐 ZOSCII is encoding, not encryption. Do not confuse the two. ZOSCII achieves I(M;A)=0 through address indirection — without the ROM, the encoded output reveals nothing about the input. This is information-theoretic security, stronger than any computational encryption.
Topic Guidance
ROM Storage Store ROMs with filesystem-level access controls. Anyone with your ROM can decode all communications encoded with it.
ROM Rotation ROMs don't expire mathematically. Rotate when you choose — after a breach, periodically, or never if your threat model allows.
microROM Distribution Recommended minimum: 5 instances per nibble value in the 240-nibble microROM. Discard and regenerate if any value falls below 5.
DH Security DH key exchange is computational (discrete log), not information-theoretic. Use out-of-band ROM exchange for the highest assurance. DH is a practical convenience, not an absolute guarantee.
MQ Zero Knowledge When used with ZOSCII/UNSIGNAL encoding, the MQ server has no knowledge of message content. It sees only anonymous blobs, queue names, timestamps, and retention settings.
Queue GUIDs The queue GUID is your "address." Share it out of band — never over an unencoded channel. A GUID is not secret by itself, but combined with an out-of-band ROM it forms the complete communication channel. What if you do share it publicly? You will likely get lots of noise within it - you won't likely be able to decode that noise but it uses your bandwidth.
ROMExchange Wire No identifying information is sent during ROMExchange. The ping/pong keepalive uses random GUIDs — each keepalive packet is different, providing no fingerprinting surface.
PENTAGONE Backup Store 5 shares in 5 separate physical locations. Any 3 reconstruct your ROM. This protects against storage failure and partial compromise simultaneously. Pentagone itself does not provide security, only redundancy - encode your data first with ZOSCII or UNSIGNAL.
UNINTELLIGENCE License: UNSIGNAL, PENTAGONE, MicroZOSCII, and ROMExchange are released under the UNINTELLIGENCE SOFTWARE LICENSE v1.1. ZOSCII core and MQClient are MIT licensed. Commercial licenses are available — contact Cyborg Unicorn Pty Ltd.