🇩🇪 DE 🇬🇧 EN
👻 Ghosts in the Machine / Chapter 21.2 – Text Crypter: Encryption as Default, Not an Option

In a world where Artificial Intelligences are no longer just passive data processors but actively react to the meaning of information, interpret it, and act based upon it, traditional security concepts reach their limits.

Most common encryption systems protect the transport of content through external keys, hashes, or digital signatures. However, these security measures typically only take effect after the information to be protected already exists in its unencrypted, semantically interpretable form.

The fundamental problem here is: The meaning itself, the intent behind a request, remains open and unprotected before it even enters the sphere of influence of downstream security mechanisms.

For systems designed to react to precisely this meaning, this subsequent protection is no longer sufficient. A new approach is required.

We therefore propose something fundamentally different. Not merely a cryptographic cipher that simply makes data unreadable.

But a structurally intelligent Text Crypter, a system that goes far beyond mere encryption. This Crypter is designed not only to obscure the information to be transmitted but also to simultaneously:

The Text Crypter thus becomes an indispensable prerequisite for any API interaction with an advanced AI system.

The principle is: No request without prior validation by the Crypter. No unprotected plaintext in the system, because without verification, there is no trust.

The Core Principle: Encryption Carries Its Secret Within

In contrast to approaches based on static, externally managed keys or simple password hashing methods, this Text Crypter follows a different philosophy:

It embeds the "secret" – i.e., the criteria for its validity and integrity – directly into the encrypted string itself. The original meaning of the user input is thereby broken down in several steps, obscured by dynamic factors, equipped with internal consistency checks, and the entire construct is inseparably linked to a timestamp.

This time-coupling is crucial to ensure that no intercepted or repeatedly sent encrypted string (replay attack) can ever produce the same effect in the target system.

Step-by-Step: The Functionality of the Text Crypter

The process of converting a plaintext input into a secured, self-validating string by the Text Crypter can be divided into three main phases:

1. Input Segmentation and Implementation of Mathematical Counter-Tests

First, the original user input is analyzed and broken down into logical segments. This segmentation can be word-based, phrase-based, or based on other semantic or structural criteria.

Example input:

Plaintext
"IloveHarmonyAlgos"

Possible segmentation:

Plaintext
["I", "love", "Harmony", "Algos"]

For each of these segments, a specific, deterministic mathematical check function or an internal consistency check is now generated.

These functions are not primarily designed for maximum cryptographic strength, but for fast computability and the ability to detect manipulations of the respective segment.

The results of these check functions (or compact representations thereof) become part of the later encrypted string.

Exemplary, illustrative check functions (concept in Python-like pseudocode):

def generate_segment_proof(segment_string):
    # Exemplary, simple logic – real implementations would be more complex
    if len(segment_string) < 3:
        proof = sum(ord(char) for char in segment_string) * len(segment_string)
    else:
        proof = (ord(segment_string[0]) + ord(segment_string[-1])) - ord(segment_string[1])
    return proof

segment_proofs = {}
segment_proofs["I"] = generate_segment_proof("I") # Yields X
segment_proofs["love"] = generate_segment_proof("love") # Yields Y
# ... and so on for all segments

These segment-based calculations serve as a fundamental self-test of the generated string on the recipient side. Before the AI system even attempts to decrypt or interpret the content, it can validate the supplied check values against the decrypted segments.

If the client-side reverse calculations do not match the check values embedded in the string, this is a strong indication of manipulation.

In such a case, a specific marker – for example, an inconspicuous character sequence like ZQX0 – is already embedded into the encrypted string during the encryption process on the client side if internal consistency checks fail.

This marker serves as a silent but unequivocal warning to the server.

2. Generation of a Time-Based Encoding Factor

To prevent replay attacks and ensure the uniqueness of each encrypted string, a dynamic, time-based encoding factor is generated. This factor directly influences the encryption algorithm and changes its behavior with each execution.

For this, the encryption process accesses multiple, preferably independent, time sources to complicate manipulation:

Exemplary generation of an encoding factor (concept in YAML-like representation):

YAML
TimeSources:
  BIOS_Timestamp: 1684085825123
  System_Timestamp: 1684085825345
  NTP_Timestamp: 1684085825050 # optional

Processing:

# Combined Time Hash (e.g., from milliseconds of the various sources)
Combined_Time_Hash_Raw: (123 + 345 + 050) % 1000 # Yields 518
Base_Value_From_Hash: 518 % 100 # Yields 18 (as base value)

# Additional dynamic factor, e.g., Fibonacci number based on current second
Current_Second: 05 # Example: 13:37:05
Fibonacci_Value_At_Second_5: 5

Calculated encoding factor:

Factor: Base_Value_From_Hash + Fibonacci_Value_At_Second_5 # 18 + 5 = 23
Final_Factor: 23 # In our manuscript example 283, simplified here

This final encoding factor (283 in the manuscript example) is now fed directly into the subsequent encoding algorithm. It can, for example, serve as an offset for character rotations, as a seed for selecting substitution characters, or as a basis for dynamically generating or selecting a specific base table for character encoding.

3. Dynamic Base Table Encoding

The actual obfuscation of the segmented input, which has been provided with check values, now occurs through dynamic base table encoding. A character table (Base Table) is used, containing only the allowed characters for the encrypted output.

In line with the strict whitelist approach defined in Chapter 21.1 ("Boundary Logic"), for example, a–z, A–Z, and the digits 1–9 (a base of 26+26+9 = 61 characters).

Each character of the original input segments is now mapped using the previously generated, time-based encoding factor through this dynamic Base Table:

Exemplary mapping process (simplified): Assume the allowed character set of the Base Table is Base61 (a-z, A-Z, 1-9). The time-based encoding factor is 283.

Input Character (from a segment): "I"
→ ASCII value of "I": 73

Calculation:

Mapped_Value = (ASCII_Value_Input + Encoding_Factor) = (73 + 283) = 356

Transformation to Base Table:

Index_In_Base_Table = Mapped_Value % Size_Of_Base_Table = 356 % 61 = 51

Output Character:

→ Character at Index 51 of the Base61 table (e.g., "r")

This process is performed for each character of the input. The output string grows continuously. At the end of the entire process, the encrypted string is assembled.

It contains:

Final output (example from the manuscript):

"rX2tRzpLg9fZ1mA4Q::PZK1"

Protection Mechanisms: More Than Just Encryption

Through this multi-stage construction, the Text Crypter offers a range of protection mechanisms that go far beyond simple encryption:

Symbol Mechanism Effect
🔒 Built-in Time Check Prevents replay attacks, as each string is unique due to the time factor and is only valid within a narrow time window.
🔎 Mathematical Checks Manipulations of individual segments of the original content lead to inconsistencies that are detected server-side.
🔁 Dynamic BaseTable The use of the time-based factor for mapping makes each generated string unique and complicates brute-force attacks.
🧬 Overall Checksum Validates the integrity and origin of the entire transmitted string. Manipulations of the overall string are immediately detected.
🧨 Anti-RE Mechanism (Client) Optional client-side mechanisms (e.g., code obfuscation, .dll detour prevention, self-monitoring threads in compiled clients) complicate reverse engineering of the Crypter algorithm itself. Feasibility varies greatly depending on the client platform.
Response to Manipulation Attempts and Delays:

The server-side counterpart of the Text Crypter rigorously validates every incoming string:

Advantages of the Text Crypter in the Overall System
Advantage Description
No Plaintext in Transmission From the point of client-side encryption, no plaintext readable by attackers or unauthorized logging tools exists. The semantic intent is protected even before transmission.
No Direct Prompting Possible Server-side AI systems no longer receive raw plaintext prompts, but only structured, pre-validated, and timestamped data blocks. This drastically reduces the attack surface for classic prompt injections.
Effective Replay Protection The tight time-coupling and the uniqueness of each generated string due to the dynamic encoding factor effectively prevent the reuse of intercepted requests.
Independence from SSL/TLS While SSL/TLS protects the communication channel, the Text Crypter secures the content at the application level. This provides an additional layer of security, even if the transport channel were compromised.
Control at Client Level The Crypter algorithm is portable and can be implemented in various client applications, enabling end-to-end protection of the input before it leaves the user's device.
Exemplary Attack (Replay) and System Reaction:

1. An attacker intercepts a valid string generated by the Text Crypter: "rX2tRzpLg9fZ1mA4Q::PZK1" (assuming this was originally generated and sent at 13:37:08).

2. The attacker resends this identical string a few minutes later, e.g., at 13:39:05, to the API.

3. The server receives the string and attempts to validate it:

4. Result of server-side validation:

Integration Possibilities of the Text Crypter

The logic of the Text Crypter is designed to be implementable on a variety of platforms and in different application scenarios:

Conclusion: From Plaintext to Trusted Event

The Text Crypter outlined here is far more than just an optional add-on for AI security. It is designed as a fundamentally new mandatory filter and trust anchor before any communication with a generative AI system.

It transforms the nature of the input: A simple sentence or a loose string of words becomes a structured, validated, and time-anchored test object.

A simple string becomes a unique, non-reproducible event. And potentially dangerous, unprotected plaintext becomes – with regard to direct, unvalidated processing by the AI – definitively a thing of the past.

Anyone who sends a string protected by this Crypter too late will inevitably fail. Anyone who tries to manipulate it will inevitably be caught. However, anyone who generates it correctly and in accordance with the rules has authenticated themselves and the integrity of their request in a new, structure-based way.

The era of naive plaintext prompting must end if we want to design AI systems that are both secure and powerful. Plaintext was yesterday. Today, we must begin to encrypt and validate the intent itself.