ai on my old rifc cipher...
From
Chris M. Thomasson@chris.m.thomasson.1@gmail.com to
sci.crypt on Tue Jan 13 01:58:10 2026
From Newsgroup: sci.crypt
Remember my old fractal ciphers with my nits I used to post about? Well,
ai got a hold of them. For some reason I asked it about them. It dumped
this out:
import math
from decimal import Decimal, getcontext
# Precision remains high to ensure "branch" selection is perfect getcontext().prec = 120
class SolidStateRIFC:
def __init__(self, c_real, c_imag, p_power, block_size=4):
self.c_r = Decimal(str(c_real))
self.c_i = Decimal(str(c_imag))
self.p = p_power
self.block_size = block_size
self.nits_per_byte = math.ceil(8 / math.log2(self.p))
# A static starting point for every block to ensure stability
self.base_iv = (Decimal('0.1'), Decimal('0.1'))
def _get_roots(self, z_r, z_i):
tr, ti = z_r - self.c_r, z_i - self.c_i
r = (tr**2 + ti**2).sqrt()
theta = Decimal(str(math.atan2(float(ti), float(tr))))
roots = []
root_r = r**(Decimal('1') / Decimal(str(self.p)))
for i in range(self.p):
angle = (theta + Decimal(str(2 * math.pi * i))) / Decimal(str(self.p))
roots.append((root_r * Decimal(str(math.cos(float(angle)))),
root_r * Decimal(str(math.sin(float(angle))))))
return roots
def _process_block_enc(self, block, start_z):
z_r, z_i = start_z
nits = []
for char in block:
val = ord(char)
for _ in range(self.nits_per_byte):
nits.append(val % self.p)
val //= self.p
for nit in nits:
z_r, z_i = self._get_roots(z_r, z_i)[nit]
return z_r, z_i
def _process_block_dec(self, ct_point, start_z, block_len):
z_r, z_i = ct_point
total_nits = block_len * self.nits_per_byte
recovered_nits = []
for _ in range(total_nits):
curr_r = (z_r**2 + z_i**2).sqrt()
curr_theta = Decimal(str(math.atan2(float(z_i), float(z_r))))
# Force high-precision power calculation
new_r = curr_r**self.p
new_theta = curr_theta * self.p
f_z_r = new_r * Decimal(str(math.cos(float(new_theta)))) + self.c_r
f_z_i = new_r * Decimal(str(math.sin(float(new_theta)))) + self.c_i
roots = self._get_roots(f_z_r, f_z_i)
# Euclidean distance check
nit = min(range(len(roots)), key=lambda i:
(roots[i][0]-z_r)**2 + (roots[i][1]-z_i)**2)
recovered_nits.append(nit)
z_r, z_i = f_z_r, f_z_i
text, nits = "", list(reversed(recovered_nits))
for i in range(0, len(nits), self.nits_per_byte):
chunk, val = nits[i:i+self.nits_per_byte], 0
for mult, nit in enumerate(chunk): val += nit * (self.p**mult)
text += chr(val)
return text
def encrypt(self, text):
cipherpoints = []
for i in range(0, len(text), self.block_size):
chunk = text[i:i+self.block_size]
# Every block starts fresh to avoid compounding floating
point drift
pt = self._process_block_enc(chunk, self.base_iv)
cipherpoints.append(pt)
return cipherpoints
def decrypt(self, points, original_len):
full_text = ""
remaining = original_len
for pt in points:
this_len = min(self.block_size, remaining)
full_text += self._process_block_dec(pt, self.base_iv,
this_len)
remaining -= this_len
return full_text
# --- Execution ---
# Small block_size (4) is best for absolute stability
engine = SolidStateRIFC(-0.123, 0.745, 4, block_size=4)
msg = "Those entities from other galaxies might use this for light-years
of data! No more overflows."
ct_points = engine.encrypt(msg)
print(f"Encrypted into {len(ct_points)} fractal coordinates.")
dt = engine.decrypt(ct_points, len(msg))
print(f"Decrypted: {dt}")
I get:
Encrypted into 24 fractal coordinates.
Decrypted: Those entities from other galaxies might use this for
light-years of data! No more overflows.
--- Synchronet 3.21a-Linux NewsLink 1.2
From
Chris M. Thomasson@chris.m.thomasson.1@gmail.com to
sci.crypt on Tue Jan 13 12:33:00 2026
From Newsgroup: sci.crypt
On 1/13/2026 7:05 AM, Richard Harnden wrote:
On 13/01/2026 09:58, Chris M. Thomasson wrote:
Remember my old fractal ciphers with my nits I used to post about?
Well, ai got a hold of them. For some reason I asked it about them. It
dumped this out:
[snip]
Encrypted into 24 fractal coordinates.
Decrypted: Those entities from other galaxies might use this for
light- years of data! No more overflows.
That really does sound like the ai is either talking bollocks, or trying
to be funny.
In any case, I don't think I'd trust anything it says.
Not sure why it used that plaintext. My old RIFC... Well, here is an
older version I did in C++ that did not use a julia point for the fractal.
https://groups.google.com/g/comp.lang.c++/c/bB1wA4wvoFc/m/OTccTiXLAgAJ
Its VERY sensitive to float point errors.
Actually, the reverse fractal is akin to another older one of mine
called MultiJulia. Fwiw, Paul was kind enough to write about it and use
it to make some nice renders:
https://paulbourke.net/fractals/multijulia
When you get some free time to burn, give it a go. RIFC is basically,
well, instead of using random numbers to choose roots, I use data... I
called then nits... :^)
I used to post about it some years ago on this group...
--- Synchronet 3.21a-Linux NewsLink 1.2