The Enigma machine was an electromechanical cipher device used by Germany to send secret messages before and during…