With a naval force small in numbers, but technically advanced, the German Naval High Command, in order to offset Allied Naval superiority, adopted a strategy designed to conceal as much as possible the location, intention and movement of its forces.
Forced by its nature to rely on radio communications, the German Navy issued to each vessel from battleship to harbor defense craft an ENIGMA cipher machine to ensure security. Here, as with other services, the dependence on ENIGMA for communications security proved to be disastrous.
Source National Cryptologic Museum
ENIGMA remains the best known German cryptographic machine of World War II.
From Wikipedia - A four-rotor Enigma was introduced by the Navy for U-boat traffic on 1 February 1942, called M4 (the network was known as "Triton", or "Shark" to the Allies). The extra rotor was fitted in the same space by splitting the reflector into a combination of a thin reflector and a thin fourth rotor.