# Wolfram Function Repository

Instant-use add-on functions for the Wolfram Language

Function Repository Resource:

Decipher a Chaocipher-enciphered string

Contributed by:
Sander Huisman

ResourceFunction["ChaoDecipher"][ deciphers |

The alphabets *α*_{p} and *α*_{c} should be a permutation of the letters "A"–"Z".

Any other letter than "a"–"z" and "A"–"Z" in *string* is ignored.

The output is in capital letters.

ResourceFunction["ChaoDecipher"] works by decoding each character in *string* (example: "AVSWQBHMEJT") using the following steps:

The character "A" is looked up in the cipher alphabet (bottom). One finds the corresponding letter "M" in the plain alphabet (top), so "A" is decoded to "M":

Both alphabets are shifted to the left such as to bring the red letters to the front:

The plain alphabet (top) is shifted one more to the left:

Move the 3rd letter of the plain alphabet (top) and the 2nd letter of the cipher alphabet (bottom) to the 14th position:

Continue with the next letter using the new alphabets:

Decipher a piece of text using unshuffled plain and cipher alphabets:

In[1]:= |

Out[1]= |

Decode a string that returns a "constant" string:

In[2]:= |

Out[2]= |

Use random plain and cipher alphabets:

In[3]:= |

Out[5]= |

The resource function ChaoCipher can be used to encipher a string. First encode a piece of string:

In[6]:= |

Out[8]= |

Now we can decipher it with ChaoDecipher:

In[9]:= |

Out[9]= |

- 1.0.0 – 01 August 2019

This work is licensed under a Creative Commons Attribution 4.0 International License