This machine was used for key-code during World War II.
The process is explained in the next photo.