Cryptography is the study of techniques for securing communication against adversaries. Historically it meant secrecy alone; modern cryptography also provides integrity, authentication and non-repudiation.
Until the twentieth century, ciphers worked by substitution (replacing letters) or transposition (rearranging them). The Caesar cipher shifts each letter by a fixed amount. The Vigenère cipher uses a repeating keyword to vary the shift, and resisted general solution for three centuries before Charles Babbage and Friedrich Kasiski independently broke it by detecting the key's period.
All such systems fall to frequency analysis, described by the ninth-century scholar al-Kindi: natural language has a characteristic distribution of letters, and simple ciphers preserve it.
Electromechanical rotor machines mechanised polyalphabetic substitution. The German Enigma passed each keystroke through a set of rotating wired discs, which advanced after every letter, so the same plaintext letter almost never encrypted the same way twice. Polish mathematicians at the Cipher Bureau, led by Marian Rejewski, reconstructed the machine's wiring in the early 1930s. At Bletchley Park, Alan Turing and Gordon Welchman built on that work with the Bombe, exploiting a structural weakness — Enigma never encrypted a letter as itself — and the predictability of German message formats.
Two ideas separate modern cryptography from what came before.
Public-key cryptography is what makes commerce on the Internet possible. Symmetric ciphers such as AES do the bulk encryption because they are fast; public-key methods are used to agree the symmetric key and to sign messages.
A cryptographic hash maps data of any size to a fixed-size value such that finding two inputs with the same output is infeasible. Hashes underpin digital signatures, password storage and content addressing — including the way this wiki stores each revision under the hash of its text, so that identical revisions are stored once.