Published April 23, 2026 | Version v1
Software Open
Description
def rsme_encrypt(data, Y, P, S, M):
# Formula: C = [(((Data * Y) - P) + Y) XOR S] MOD M
# k = restoration constant (integer quotient)
pre_mod = (((data * Y) - P) + Y) ^ S
c = pre_mod % M
k = pre_mod // M
return c, k
def rsme_decrypt(c, k, Y, P, S, M):
# Reverse Formula: Data = ([(C + (k * M)) XOR S] - Y + P) / Y
x_restored = (c + (k * M)) ^ S
data = (x_restored - Y + P) / Y
return int(data)
# --- QUICK TEST ---
# Parameters Example:
Y, P, S, M = 5, 10, 7, 100
input_val = 123
# Encrypting
cipher, k_val = rsme_encrypt(input_val, Y, P, S, M)
print(f"Encrypted Ciphertext (C): {cipher}")
print(f"Restoration Constant (k): {k_val}")
# Decrypting
original = rsme_decrypt(cipher, k_val, Y, P, S, M)
print(f"Decrypted Result: {original}")
The Python code is just a functional demonstration of the logic. The goal is to implement this in low-level C for IoT devices.
Deterministic Mutation via PRNG
To ensure maximum memory efficiency on IoT/UAV hardware, RSME does not store static keys. Instead, it utilizes a Deterministic PRNG (Pseudo-Random Number Generator) mechanism:
•Synchronized State: Both the sender (UAV) and receiver (GCS) share a single Master Seed.
•On-the-fly Generation: Mutation parameters (Y, P, S) are generated in real-time based on a shared index.
•Zero-Key Exchange: No secret keys are transmitted over the air. Even if an attacker intercepts the metadata (k), the internal mutation state remains invisible without the Master Seed.
Here if you want to discuss about RSME:
https://news.ycombinator.com/threads?id=RanggaS
Notes
This project is open for modification and optimization. As the architect, I invite researchers and developers to refine the cryptographic formulas and implementation. All contributions that advance the 'Reactive Stability' concept are highly encouraged.
Technical info
The logic below is the C implementation of RSME for high-performance hardware (UAV/IoT).
#include <stdint.h>
typedef struct {
uint32_t ciphertext;
uint32_t k;
} RSME_Package;
// RSME Encryption: Optimized for speed and low CPU cycles
RSME_Package rsme_encrypt(uint32_t data, uint32_t Y, uint32_t P, uint32_t S, uint32_t M) {
RSME_Package pkg;
uint64_t pre_mod = ((( (uint64_t)data * Y) - P) + Y) ^ S;
pkg.ciphertext = (uint32_t)(pre_mod % M);
pkg.k = (uint32_t)(pre_mod / M); // The Restoration Constant
return pkg;
}
// RSME Decryption: High-speed restoration using 'k'
uint32_t rsme_decrypt(uint32_t c, uint32_t k, uint32_t S, uint32_t M) {
uint64_t restored = (uint64_t)c + ((uint64_t)k * M);
return (uint32_t)(restored ^ S);
}
Files
RSME_Reactive_Encryption_Technical_Specification.pdf
Files (46.6 kB)
| Name | Size | Download all |
|---|---|---|
| md5:4b3b535cf7fbe1783c9a3d34c9b85900 | 46.6 kB | Preview Download |



















