Bytes in
ock-byte-rotor -m encode \
--key-ints "233969659 753251273 593294788 325244558 296780300 467383710" \
-i plain.txt -o cipher.ock
A small Rust rotor machine for arbitrary bytes: encode, tag, inspect the moving frontier, decode, and demand the exact bytes back.
Educational crypto. Runnable mechanism, explicit restore path, no claim of modern audited encryption.
Current v0.4.0 handles raw byte streams, generates one or more 256-byte rotors, applies dynamic per-byte rounds, stores nonce/round/rotor parameters in an OCKR4 container and verifies a 32-byte toy tag before decoding.
The living Matrix renderer replays both encode and decode as a sliding hexdump frontier. The transform core remains Rust; the current visual reference is Python.
The visual is a sampled terminal trace of the same roundtrip story: plaintext → ciphertext → plaintext.
ock-byte-rotor -m encode \
--key-ints "233969659 753251273 593294788 325244558 296780300 467383710" \
-i plain.txt -o cipher.ock
ock-byte-rotor -m decode \
--key-ints "233969659 753251273 593294788 325244558 296780300 467383710" \
-i cipher.ock -o restored.txt
cmp plain.txt restored.txt
echo $?
Zero means the byte stream returned exactly.
OCKR4\0 magic, 64-bit little-endian nonce, one-byte round count and one-byte rotor count.
The transformed payload stays byte-for-byte length-preserving inside the container body.
Decode verifies the tag before transforming the payload back. It is not presented as a modern audited MAC.