The B-Dienst (German: Beobachtungsdienst, observation service), also called xB-Dienst, X-B-Dienst and χB-Dienst, was a Department of the German Naval Intelligence Service (German: Marinenachrichtendienst, MND III) of the OKM, that dealt with the interception and recording, decoding and analysis of the enemy, in particular British radio communications before and during World War II.B-Dienst worked on cryptanalysis and deciphering (decrypting) of enemy and neutral states message traffic and security control of Kriegsmarine key processes and machinery.
B-Dienst was instrumental in molding Wehrmacht forces operations during the Battles of Norway and France in spring 1940, primarily due to the cryptanalysis successes it had achieved against early and less secure British Naval cyphers.
B-Dienst broke British Naval Combined Cypher No. 3 in October 1941, which was used to encrypt all communications between naval personnel, for Allied North Atlantic convoys, providing intelligence for the Battle of the Atlantic, until the British Admiralty introduced Naval Cypher No. 5 on 10 June 1943 and became effectively secure with the introduction of the stencil subtractor system that was used to recypher Naval Cypher No. 5, in January 1944.
The B-Dienst unit began as the German Radio Monitoring Service, or educational and news analysis service (German: Funkhorchdienst / Horchdienst) by the end of World War I, in 1918. as part of the navy of the German Empire.