c++cryptographycellular-automatablock-cipherfeistel-cipher

Errant segments in cellular automata encryption algorithm


I've been implementing a paper that is targeting IoT encryption using a 64-bit block cipher via elementary cellular automata. The paper is in the repository/linked in the README.

I am trying to verify that an implementation of this algorithm actually works.

Current state

The first and third segments do not decrypt properly, I believe this is due to rule 153 being used.

P: deadbeefcafebabe
K: f6c78663f3578746
E: ce09ac834be8ba8d
D: df8cbeefcbcbbabe

Things I've verified

Errata I've noticed in the paper

Question

Does rule 153 actually work for reversing the automata during decryption? Rule 51 is essentially a NOT on the previous epoch, so I would expect rule 153's inverse to be in use during decryption, but doesn't appear to be reversible.

If anyone could take a look and provide feedback on where I went wrong I'd greatly appreciate it. I've already mailed the author and have yet to receive a response.

Code

https://github.com/optimisticninja/caencryption


Solution

  • After iterating through all automata rules, only linear rules work in place of 153 for alternating segments. Rule 29 appears to be the best alternate for diffusion of the plaintext.

    RULE 29
    P: deadbeefcafebabe
    K: f6c78663f3578746
    E: ce09bfd34be8a898
    D: deadbeefcafebabe
    RULE 51
    P: deadbeefcafebabe
    K: f6c78663f3578746
    E: ce09bfd34be8a898
    D: deadbeefcafebabe
    RULE 204
    P: deadbeefcafebabe
    K: f6c78663f3578746
    E: ce09bfd34be8a898
    D: deadbeefcafebabe
    RULE 205
    P: deadbeefcafebabe
    K: f6c78663f3578746
    E: ce09bfd34be8a898
    D: deadbeefcafebabe