A German Enigma machine was recently auctioned off for $51,000. Credit: Artmark

A German Enigma machine, used by Nazis to encrypt messages during World War II, was sold to an online bidder for $51,620 after the seller paid only $115 for it at a flea market in Bucharest, Romania.

According to an article in Gizmodo, a professor of cryptology auctioned the fully-functional machine at Bucharest’s Artmark auction house on July 11, with a starting bid of just over $10,000.

According to CNN, the machine was made in 1941 and is considered to be in almost perfect condition.

Vlad Georgescu, relationship manager at Artmark, told CNN, that the machine had been previously owned by a mathematician who spent his life decrypting codes.

Enigma machines are electro-mechanical rotor cipher machines developed in the 1920s by German engineer Arthur Scherbius. The machine was adopted by the Nazi’s prior to World War II to encrypt messages into a new form that was considered unbreakable by enemies.

However, British cryptologists decrypted a number of enciphered messages, which is considered a substantial aid to the Allied war effort.

Alan Turing at Bletchley Park, Britain’s codebreaking center, was able to crack the code of the encrypted messages. This turning point is credited in ending the war by more than two years and ultimately saving 14 million lives.

An Enigma machine sold in London in 2011 for $208,000, six times more than what was estimated.