Rotor machine that encodes and decodes messages