
Asemica: An asemic Markov-chained cipher - photon12
https://github.com/linenoise/asemica
======
CodesInChaos
If I wanted to produce plaintext like ciphertexts, I'd:

1\. Encrypt the plaintext with a standard cipher, producing uniformly random
bytes

2\. Build a language model which predicts the probability of the next symbol
(nowadays you'd probably use a neural network for that).

3\. Run an arithmetic decoder (or similar) for that model on the ciphertext.
This translates random bytes into language. The quality of the output depends
on the quality of the language model.

------
daemonk
I've wanted something like this for barcodes. My company depends on our users
to enter in a 16 digit barcode correctly. It would be great if the 16 digit
barcode can somehow be bi-directionally translated into a sentence
(grammatically correct sentence would be even better). While this will
probably take the user more keystrokes to type out, it should reduce entry
errors.

~~~
CodesInChaos
If you drop the grammar requirement, you can easily use one of the many
dictionaries made for this purpose (e.g. diceware or a bip39 wordlist which
even has support for many languages).

If you feel fancy, you could make it order independent or add error correcting
codes to compensate for a limited number of mistakes at the cost of an extra
word or two.

------
prionassembly
That's not what usually...

[https://en.wikipedia.org/wiki/Asemic_writing](https://en.wikipedia.org/wiki/Asemic_writing)

------
MrXOR
Interesting!

You want secure asemic cipher? say hello to Format-preserving encryption.

[https://en.wikipedia.org/wiki/Format-
preserving_encryption](https://en.wikipedia.org/wiki/Format-
preserving_encryption)

------
CodesInChaos
I'd rather consider this an encoding than a cipher

~~~
jchook
Why? It has a secret key. Doesn’t that qualify it as a cipher?

~~~
CodesInChaos
I'd treat that file as merely a style template, not as a key.

Selling it as a cipher opens it up to criticism, since from the description it
sounds like a simple substitution cipher with decoy symbols, which is
obviously not secure.

