bi3mw > Yesterday, 11:30 AM
# Reduced alphabet: No J, U, W
alphabet = list("ABCDEFGHIKLMNOPQRSTVXYZ") # 23 letters
def char_to_pos(c):
return alphabet.index(c.upper()) + 1
def pos_to_char(p):
p = (p - 1) % len(alphabet) + 1
return alphabet[p - 1]
def chain_decrypt_verbose(ciphertext):
ciphertext = ciphertext.upper()
decrypted = ""
table = []
prev_cipher_pos = 0
for i, c in enumerate(ciphertext, start=1):
if c not in alphabet:
decrypted += c
table.append([i, c]) # Nur zwei Spalten für Nicht-Buchstaben
continue
cipher_pos = char_to_pos(c)
plain_pos = (cipher_pos - prev_cipher_pos) % len(alphabet)
if plain_pos == 0:
plain_pos = len(alphabet)
plain_char = pos_to_char(plain_pos)
decrypted += plain_char
table.append([
i,
c,
cipher_pos,
plain_char,
plain_pos,
prev_cipher_pos,
f"({cipher_pos} - {prev_cipher_pos}) mod {len(alphabet)} = {plain_pos}"
])
prev_cipher_pos = cipher_pos
return decrypted, table
def print_table(table):
print("\nDecryption Table:")
print("-" * 90)
print(f"{'i':>3} | {'Cipher':^9} | {'cᵢ':^4} | {'Plain':^9} | {'pᵢ':^4} | {'cᵢ₋₁':^6} | {'Computation':<30}")
print("-" * 90)
for row in table:
if len(row) == 7:
i, cchar, cpos, pchar, ppos, cprev, calc = row
print(f"{i:>3} | {cchar:^9} | {cpos:^4} | {pchar:^9} | {ppos:^4} | {cprev:^6} | {calc:<30}")
elif len(row) == 2:
i, cchar = row
print(f"{i:>3} | {cchar:^9} | {'-':^4} | {'-':^9} | {'-':^4} | {'-':^6} | {'(not a letter)':<30}")
print("-" * 90)
def apply_fixed_substitution(text, from_list, to_list):
mapping = dict(zip(from_list, to_list))
substituted = ''.join(mapping.get(c, c) for c in text)
return substituted, mapping
if __name__ == "__main__":
text = input("? Enter ciphertext to decrypt (only letters A–Z, excluding J, U, W): ")
decrypted, table = chain_decrypt_verbose(text)
print(f"\n? Decrypted text: {decrypted}")
print_table(table)
# Substitution: Voynich → Latein
voynich_order = list("OEHYACDIKLRSTNQPMFGXBVZ")
latin_order = list("IEAUTSRNOMCLPDBQGVFHXYZ")
substituted, mapping = apply_fixed_substitution(decrypted, voynich_order, latin_order)
print("\n? Substituted (Voynich → Latin):")
print(substituted)
print("\n?️ Substitution Map:")
for voy, lat in mapping.items():
print(f" {voy} → {lat}")
oshfdk > Yesterday, 11:52 AM
(Yesterday, 11:30 AM)bi3mw Wrote: You are not allowed to view links. Register or Login to view.I asked in the You are not allowed to view links. Register or Login to view. if a made up chain cipher is easy to decrypt. Now I have written a Python script that decrypts a given Voynich word using the same method. The result is then mapped according to frequency analysis (EVA > Latin). Admittedly, this is a rather rudimentary approach, I am primarily interested in decoding with MOD 23. The method is simple enough to be considered and also much more effective than a simple substitution. It could be implemented practically with a letter disk (like Alberti disk).
bi3mw > 10 hours ago
(Yesterday, 11:52 AM)oshfdk Wrote: You are not allowed to view links. Register or Login to view.As an experiment could you try encoding some very simple maybe even repetitive English (or Latin) text using this method? I suppose it will become something like qtopihfdsjnvmglcxwtaksdbnkfhdyf - pure randomness and few obvious patterns.
oshfdk > 8 hours ago
bi3mw > 8 hours ago
(8 hours ago)oshfdk Wrote: You are not allowed to view links. Register or Login to view.Was the original entropy case sensitive? The text should be converted to uppercase or lowercase before the computation.
oshfdk > 7 hours ago
(8 hours ago)bi3mw Wrote: You are not allowed to view links. Register or Login to view.After converting all letters to capital letters in the original text, the entropy value is 3.9962.
(8 hours ago)bi3mw Wrote: You are not allowed to view links. Register or Login to view.I meant that a word can only be identical if the last letter at the end of the previous word is also identical.
(8 hours ago)bi3mw Wrote: You are not allowed to view links. Register or Login to view.This property should therefore theoretically also be found in the VMS.
bi3mw > 5 hours ago
(8 hours ago)bi3mw Wrote: You are not allowed to view links. Register or Login to view.I meant that a word can only be identical if the last letter at the end of the previous word is also identical. This property should therefore theoretically also be found in the VMS.
ReneZ > 1 hour ago
(7 hours ago)oshfdk Wrote: You are not allowed to view links. Register or Login to view.Also the increase from 3.9962 to 4.4779 is not minor, it's almost as huge as it can get. Maximum possible character entropy for an alphabet of 23 characters is log2(23) ~ 4.5236. The value of 4.5236 would mean the same probability of any character coming after any other character, it cannot get more random than that. 4.4779 is just ~0.05 bits from the absolute limit.
RadioFM > 1 hour ago
oshfdk > 49 minutes ago
(1 hour ago)ReneZ Wrote: You are not allowed to view links. Register or Login to view.I presume that these values from bi3mw represent the single character entropy, not the conditional character entropy.