The top German codes were not on Enigma but on a Lorenz machine. It encoded onto the international teletype alphabet. A really long pseudo-random number would be generated by the machines rotors. Each letter had a binary number added on to it to encrypt it. Adding on the number again decrypted it at the other end
D Type Flip Flop Pseudo Random Number Generator
It was once thought by mathematicians that prime numbers could never have any application to the real world. As usual, that view has turned out to be quite mistaken—especially since the advent of computers. Today, prime numbers are used in cryptography, hash tables, pseudo-random number generation and distributed computing.