It was obtained from a collector for use in the movie. In reality, the submarine U-571 was never captured. The submarines U-559 and U-110 were the ones captured with the codebooks, but by the British Navy in August 1941, four months before the United States entered the war.