Step 1: Generate Your Key Pair
Your passphrase is your private key. Keep it safe.
Step 2: Encrypt a Message
Step 3: Decrypt a Message
The decrypted message will appear here...
Operating Principles of the P-Key System
P-Key is an asymmetric cryptography system (public/private key) whose architecture represents a paradigm shift from traditional systems like RSA. Its security is not based on the presumed difficulty of a single static mathematical problem (such as factoring large numbers), but on the computational complexity and informational asymmetry of a generative process. Instead of relying on an algebraic "trapdoor," P-Key builds a unique and deterministic computational labyrinth for each user. The system's security derives from the fact that it is computationally impossible to reconstruct the complete secret map of this labyrinth possessing only the few public instructions provided for navigation. This approach shifts the security problem from number theory to complexity theory, making P-Key a natural candidate for post-quantum cryptography.
Key Generation
The key generation process in P-Key is intrinsically linked to the philosophy of the P System. The entire system is designed around the concept that the private key is not static data to be stored, but a process to be regenerated.
From Passphrase to Seed: The process begins with a Private Passphrase chosen by the user. This passphrase is processed by a Key Derivation Function (KDF) based on P-Hash logic, which performs intentionally "expensive" computational work (thousands of iterations) to transform the passphrase into a 64-bit Generative Seed. This complexity makes brute force attacks on the passphrase extremely slow and impractical.
The Genesis of the "Secret Map": The seed is used to initialize the Selective Genealogical Algorithm (SGA). The SGA executes a deterministic computational path for a preset number of iterations (e.g., 100,000). During this execution, the system records every salient event: the emergence of each new promoter (prime number) and periodic snapshots of the complete state of the Propagation Queue. The collection of all this data constitutes the Secret Execution Trace (the "treasure map"), a complex and unique data object that exists only in memory and is never saved.
Creating the Public Package: Two components are extracted from the secret trace:
The Computational Bridge: A small and selected subset of non-sensitive data from the trace (e.g., the first 10 emerged promoters, a specific queue snapshot). These are the "public instructions."
The Public Hash: The entire secret execution trace is serialized and processed by a standard hash algorithm (SHA3-512) to produce a 512-bit digital fingerprint.
The Public Key is the combination of the Computational Bridge and the Public Hash. The Private Key remains conceptually just the passphrase, i.e., the ability to regenerate the exact Secret Execution Trace.
Encryption and Decryption Process
P-Key is a hybrid system that clearly separates the asymmetric key exchange from the symmetric message encryption.
Encryption (Alice): To send a message to Bob, Alice performs the following steps:
1. Generates a one-time, strong, random session key (K_session).
2. Downloads Bob's Public Key.
3. Uses the "public instructions" contained in Bob's Computational Bridge to perform a series of mathematical transformations on her K_session. This is a forward-only operation: Alice can perform it, but cannot reverse it because she doesn't know the complete context from which the instructions were extracted. The result is an encrypted session key (K_encrypted).
4. Uses the original K_session (in plaintext) to encrypt the actual message, using the symmetric encryption engine inspired by P-Signature.
5. Alice sends Bob a packet containing K_encrypted and the encrypted message.
Decryption (Bob): Bob receives the packet and performs the reverse steps:
1. Enters his Private Passphrase to regenerate the entire Secret Execution Trace (his "treasure map").
2. Possessing the complete map, the operation that was "forward-only" for Alice is easily reversible for him. He uses his complete knowledge of the process to take K_encrypted and trace back to the original K_session. This is the system's "trapdoor."
3. Uses the recovered K_session to decrypt the message.
Security Analysis and Post-Quantum Potential
P-Key's security is based on a multi-layered architecture that clearly distinguishes it from current cryptographic systems.
Informational, not Algebraic Asymmetry: Security does not depend on a static mathematical problem. It depends on the computational difficulty of reconstructing complete information from partial information. An attacker, even if in possession of the Public Key, the Computational Bridge, and the complete algorithm, does not have enough data to infer the secret trace, making decryption impossible.
Irrelevance of Factorization: The factorization problem, central to RSA, becomes irrelevant. There is no single number N whose decomposition compromises the system. The attacker faces a problem of a completely different nature, closer to inverting a chaotic process than solving an equation.
Post-Quantum Potential: Shor's algorithm, which threatens current cryptographic systems, was designed to solve problems with a specific mathematical structure (such as factorization or discrete logarithm). P-Key's architecture does not present this structure. Security based on the complexity of a deterministic but chaotic computational process is not, at the current state of research, vulnerable to known quantum algorithms, making P-Key an intrinsically quantum-resistant system.