profile Kishan Jat

Mechanical vs Digital - Cryptography: From Mechanical Rotors to Modern Digital Algorithms

Cryptography (or cryptology) secures communication against Attackers by building protocols that hide private messages from third parties. For more, see Wikipedia.

Is software the only way to perform cryptography? No, cryptography can be implemented using hardware, mechanical devices, or even manual methods.

Cryptography evolved from WWII electro-mechanical devices - Enigma rotors (encryption/decryption) and Turing-Welchman Bombe (cryptanalysis) - that operated with zero software, to modern digital algorithms (AES, ECDSA/ECDHE) executed on hardware-accelerated processors. Pure mechanical encryption via spinning rotors and electrical circuits proved the concept without programs, but failed digital-era demands due to speed (~26 chars/sec vs. 10GB/s), physical wear, and unscalable security (~10²³ states vs. AES-256's 2²⁵⁶). Today's hybrid systems run symmetric (AES) and asymmetric (ECC) algorithms on reprogrammable silicon, handling quantum-resistant 256-bit keys impossible for physical machines.

Mechanical Cryptography: breaking the Enigma codes

This is not the exact story but is included here to explain how it worked.

France, 1942. 5:30 AM. Hans opens his codebook to today's page. It reads: "1 October: Rotors II-IV-V, Ringstellung A-M-T, Plugboard: AF BX CR DU EV..." He slides rotor II into the left slot, IV middle, V right. Sets windows to A-M-T. Plugs 10 wire pairs into the board: A-F, B-X, C-R, D-U, E-V, and five more.

Now his Enigma matches every German operator worldwide. Out of 159 quintillion possible settings.

Hans types "ATTACKATDAWN". Rotors click. Keyboard lamps light "XKGMPQJRVZL". He transmits.

Berlin, 19:00. Karl opens identical codebook. Same page. Same rotors II-IV-V, A-M-T, same 10 plugs. Types "XKGMPQJRVZL". Lamps light "ATTACKATDAWN".

Mechanical Cryptography Devices

These electro-mechanical devices operated without software, proving encryption/decryption possible via hardware alone decades before digital computers.

Wartime Bletchley Park Bombe machine featuring multiple rows of rotors

Wartime Bletchley Park Bombe machine featuring multiple rows of rotors.

Working rebuilt bombe machine with rotating drums

Working rebuilt bombe machine with rotating drums at The National Museum of Computing, Bletchley Park.

Hebern Rotor Machine (1917): Edward Hebern's electro-mechanical device with a single rotating rotor for substitution ciphers - the first rotor-based encryptor.​ source

Enigma (1918): Arthur Scherbius's rotor machine, commercially available by 1923, used by Germans in WWII. source

Polish Bomba (1932): Pre-Bombe electromechanical device - It was an electromechanical device for cryptanalyzing early 3-rotor Enigma (military version), using known-plaintext attacks. Source

British Bombe (1940): Designed independently by Alan Turing and Gordon Welchman at Bletchley Park, improving on Polish ideas for 4-rotor naval Enigma. source

Why Mechanical Cryptography Isn't Used in the Digital Era

Way too slow for modern needs: Rotor machines like Bombe took ~20 minutes to process one message key. Today's internet and phones need encryption happening millions of times per second - mechanical gears simply can't keep up with real-time video calls, banking apps, or cloud storage.

Tiny security compared to today: Rotor machines like Enigma, despite having enormous key spaces (Enigma had roughly 158 quintillion possible settings), relied on mathematical structures and operational procedures that made them vulnerable to cryptanalysis. Modern AES-256 encryption has 2^256 combinations - that's 3.4×10^77 possibilities - making brute-force attacks computationally infeasible even for the world's most powerful computers. it's about mathematical design. No classical computer could ever test all AES-256 combinations; you would need computational resources far exceeding what exists in the universe.

Can't update or fix problems: Once built, the wiring and rotor patterns were fixed. When cryptanalysts found weaknesses (like Bombe did to Enigma), you had to redesign and rebuild every machine. Modern systems can simply receive a software update to fix vulnerabilities or switch algorithms.

Digital chips replaced everything: Starting with transistors in the 1950s, electronic circuits could run complex math billions of times faster without moving parts. Today chips execute quantum-resistant encryption at light speed and update instantly.

The switch was inevitable - mechanical cryptography belonged to a world of telegrams and paper messages. Digital world demands speed, reliability, and adaptability that only electronics can provide.

How Digital Cryptography Works

Digital cryptography works through mathematical algorithms executed by computer processors to securely scramble and unscramble data, ensuring confidentiality, integrity, and authenticity.

Core Principles: Symmetric cryptography uses a single shared secret key for both encryption and decryption (AES standard). Both parties must securely exchange this key beforehand. It's extremely efficient for bulk data but requires trusted key distribution.

Asymmetric cryptography uses public-private key pairs (RSA, ECC). The public key encrypts data that only the matching private key can decrypt. This solves the key-distribution problem: public keys can be freely shared while private keys remain secret.

TLS 1.3 Workflow

Transport Layer Security (TLS) handshake: The initial process where a client and server authenticate each other, negotiate encryption algorithms, and securely establish shared keys before encrypted communication begins.

1 Client sends ClientHello: Announces TLS 1.3 capability, preferred cipher combinations, and its ephemeral ECDHE public key share - everything needed to start key negotiation in one message.

2 Server responds ServerHello: Confirms TLS 1.3, sends its ECDHE public key share, digital certificate, and ECDSA signature cryptographically proving it controls the certificate's private key.

3 Both derive shared secret via ECDHE: Each side independently computes the identical session secret using the other's public key share and their private key - mathematically guaranteed unique per connection.

4 All subsequent application data encrypted with AES-256-GCM: Web pages, videos, files flow encrypted with keys derived from the shared secret. Perfect Forward Secrecy (PFS) built-in: even server compromise later can't decrypt past sessions.

Current NIST Standards

NIST - National Institute of Standards and Technology

AES-256-GCM: A symmetric authenticated encryption cipher that combines encryption and integrity checks in one operation. Used widely for high-speed data protection in banking transactions, VPN connections, and full disk encryption systems.

ECDSA-P-384/P-521: Elliptic Curve Digital Signature Algorithm using NIST P-384 or P-521 curves. Provides server authentication during secure connections by signing certificates with smaller, efficient keys compared to traditional methods.

ECDHE (Curve25519/X25519 or P-384): Elliptic Curve Diffie-Hellman Ephemeral key exchange. Enables two parties to generate a unique shared secret for each session, ensuring perfect forward secrecy even if long-term keys are later compromised. Mandatory in modern secure protocols.

SHA-256/SHA-384: Secure Hash Algorithm family producing 256-bit or 384-bit digests. Essential for verifying data hasn't been tampered with, creating digital signatures, and deriving encryption keys from passphrases.

ML-KEM-768/1024 (Kyber FIPS 203): NIST's Module-Lattice-Based Key Encapsulation Mechanism. Designed to resist attacks from quantum computers. Currently deployed in hybrid systems alongside classical methods during transition phase.

ML-DSA-65/87 (Dilithium FIPS 204): Module-Lattice-Based Digital Signature Algorithm. Quantum-safe signing standard for authenticating servers and documents as ecosystems migrate from vulnerable classical cryptography.


Cryptography can be implemented purely in hardware or purely in software, but in practice, a combination of software and (often reprogrammable) hardware accelerators is commonly used to balance speed, security, flexibility, and scalability in modern systems.