From Ancient Ciphers to Quantum Keys: A Journey Through Cryptography

Introduction
Cryptography is the practice and study of techniques for securing communication and data from adversaries. It ensures that information remains private, authentic, and untampered, even in the presence of malicious entities. Rooted in mathematics and computer science, cryptography plays a vital role in protecting digital systems and ensuring trust in the digital age.
How this all began?
Ancient Cryptography:
Caesar Cipher : Julius Caesar used a simple substitution cipher to protect military messages.
Al-Kindi : Introduced frequency analysis to break ciphers.
Vigenère Cipher: A more complex cipher considered unbreakable at the time.

Modern Cryptography:
Claude Shannon : Founded modern cryptographic theory.
Symmetric Encryption: DES (1970s) became a widely used encryption standard.
Public-Key Cryptography: Introduced by Diffie and Hellman in the 1970s, with RSA (1977) enabling secure communication without shared keys.

Diving deep in Cryptography:

1. Symmetric-Key Cryptography (Secret Key Cryptography)
Definition: Both the sender and the receiver use the same key for both encryption and decryption.
Examples:
AES (Advanced Encryption Standard): A widely used encryption standard for securing data.
DES (Data Encryption Standard): An older encryption algorithm now considered insecure.
RC4: A stream cipher that was widely used in protocols like SSL but is no longer considered secure.
2. Asymmetric-Key Cryptography (Public Key Cryptography)
Definition: Uses a pair of keys—one public key for encryption and a private key for decryption.
Examples:
RSA (Rivest–Shamir–Adleman): A widely used asymmetric encryption algorithm.
ECC (Elliptic Curve Cryptography): More efficient than RSA for key sizes.
DSA (Digital Signature Algorithm): Used for creating digital signatures.
3. Hash Functions
Definition: A one-way function that takes an input and produces a fixed-length output (hash). The output is typically unique for each unique input. Used for verifying data integrity and creating digital signatures, not for encryption and decryption.
Examples:
SHA (Secure Hash Algorithm): A family of cryptographic hash functions, such as SHA-256.
MD5 (Message Digest Algorithm 5): An older hash function, now considered weak due to vulnerability to collision attacks.
BLAKE2: A cryptographic hash function designed as an alternative to MD5 and SHA.
MORE ON → RSA

RSA (Rivest-Shamir-Adleman) is one of the most widely used asymmetric cryptographic algorithms. It is based on the principle of public-key cryptography, where two keys are used: a public key for encryption and a private key for decryption.
Steps to Generate RSA Keys
Choose two large prime numbers
pandq.- The larger the primes, the stronger the security.
Compute
n = p * q.- This value is used in both the public and private keys.
Calculate Euler’s Totient Function
φ(n) = (p - 1) * (q - 1).Choose a public exponent
e.- Typically,
eis 65537, which is a commonly used prime number.
- Typically,
Calculate the private exponent
d.dis the modular inverse ofemoduloφ(n). This can be calculated using the Extended Euclidean Algorithm.
The public key is
(n, e).- The private key is
(n, d).
- The private key is
AND…TAADAH! We can generate our own pair of public and private keys.
How to implement?
C++/Python/Java Libraries for Cryptography
OpenSSL: https://www.openssl.org
Crypto++: https://www.cryptopp.com/
Botan: https://botan.randombit.net/
PyCryptodome:https://www.pycryptodome.org
5.Bouncy Castle:https://www.bouncycastle.org/
Conclusion
The field has evolved significantly, from ancient encryption methods like Caesar ciphers to modern techniques such as RSA, AES, and elliptic curve cryptography (ECC), each offering greater security and efficiency. Cryptography is foundational in various applications, including secure messaging, digital signatures, key exchange protocols, and blockchain technology.



