A very rare, functioning Nazi Enigma machine was recently sold at an auction in New York for a record breaking amount of $365,000. Out of the 1,500 M4 Nazi Enigma machines built during World War II, around 1943 to 1945, only 150 were recovered, according to the Guardian.

A Bonhams spokeswoman said that the $365,000 price is the highest paid amount for an Enigma machine at an auction. The identity of the person who bought the machine was not revealed, and was only identified as a private collector.

The M4 was created by a German engineer, Arthur Scherbius, and can transcribe coded information. He manufactured his machine in Berlin, and it was eventually adapted by the German armed forces so enemies would not have access to encrypted commands, according to BBC History.

During the latter part of World War II, Alan Turing, and English mathematician, broke the Enigma code.

This resulted in the disposing of 70 percent of the Nazi Enigma machines. The model sold was very rare, since it survived the German disposal of Enigma machines, and it is one of only seven M4s out of the 50 Enigma machines remaining worldwide, according to the Telegraph UK.

"The Enigma machine is an exceptional encryption device, one of the most sophisticated and complicated of its type," according to Tom Lamb, specialist at Bonhams, DailyMail reported.

See how an Enigma machine works in the video below.