Implementation and cryptanalysis of the Enigma machine