2025-02-23T10:18:16
Status: #moc
Tags: #technology #softwaredevelopment #crypto #security #quantum #bitcoin
Links: [[Society]] | [[Technology]] | [[Software Development]] | [[Quantum-Resistant Cryptography in Blockchain Wallets]] | [[XML Aficionado/Bitcoin|Bitcoin]]
# Cryptography
## 1. Introduction
[Cryptography](https://en.wikipedia.org/wiki/Cryptography) is the science of securing information by transforming it into a form that is unintelligible to anyone who does not possess the means (or key) to decode it. In our increasingly interconnected world, cryptography underpins everything from online banking transactions to social media messages and blockchains, protecting sensitive data from malicious actors.
![[CryptographyKB.png]]
## 2. A Brief [History of Cryptography](https://en.wikipedia.org/wiki/History_of_cryptography)
1. **Ancient Origins**
- Early examples include the **[Caesar cipher](https://en.wikipedia.org/wiki/Caesar_cipher)**, employed by Julius Caesar to shift letters in the Roman alphabet by a fixed number, making intercepted messages harder to read.
![[Caesar_cipher.png]]
- Other ancient civilizations used simple [substitution ciphers](https://en.wikipedia.org/wiki/Substitution_cipher) or transposition ciphers to ensure that only the intended recipients could interpret messages.
![[ROT13.png]]
2. **Evolution in the Middle Ages and Renaissance**
- Cryptanalysis (the art of breaking ciphers) began to appear alongside the development of more sophisticated cipher systems.
- Notable advancements: the **[Vigenère cipher](https://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher)**, which used a repeating keyword to encrypt messages, making it significantly harder to break than simple Caesar ciphers.
3. **Modern Cryptography (World War II Era)**
- Machines like the **[Enigma](https://en.wikipedia.org/wiki/Enigma_machine)** (used by Germany during WWII) introduced mechanical and electrical components to encryption.
![[Engima.jpg]]
- [Allied cryptanalysts](https://en.wikipedia.org/wiki/Cryptanalysis_of_the_Enigma), including the famous Alan Turing, helped break Enigma, marking one of the major turning points in both the war and cryptographic science.
4. **Post-WWII to the Digital Age**
- The emergence of computers drastically increased both the complexity and effectiveness of cryptographic techniques.
- 1976 saw the introduction of [public-key cryptography](https://en.wikipedia.org/wiki/Public-key_cryptography) by Whitfield Diffie and Martin Hellman, which revolutionized secure communications and set the stage for modern encryption algorithms.
![[Private_key_signing.svg]]
## 3. Current State of the Art
1. **Advanced Cryptographic Algorithms**
- The digital era has given rise to sophisticated algorithms capable of securing global communications, banking, e-commerce, and sensitive government data.
- Most commonly, these algorithms are standardized and regularly updated by organizations such as the [U.S. National Institute of Standards and Technology (NIST)](https://www.nist.gov/).
2. **Quantum-Safe Cryptography**
- As [[Quantum Computing|quantum computers]] advance, they could potentially break many of today’s widely used algorithms (particularly those based on factorization or discrete logarithms).
- Researchers are developing **[post-quantum cryptography (PQC)](https://en.wikipedia.org/wiki/Post-quantum_cryptography)** algorithms designed to remain secure against quantum attacks. Examples include latticed-based schemes like **[CRYSTALS-Kyber](https://pq-crystals.org/kyber/)** and **[CRYSTALS-Dilithium](https://pq-crystals.org/dilithium/)**.
3. **Zero-Knowledge Proofs and Privacy-Focused Cryptography**
- [Zero-knowledge proofs (ZKPs)](https://en.wikipedia.org/wiki/Zero-knowledge_proof) allow one party to prove they possess certain information without revealing the actual information.
- These technologies are increasingly used in blockchain and other privacy-centric applications.
## 4. Widely Used Cryptographic Algorithms
### 4.1 [Symmetric-Key Encryption](https://en.wikipedia.org/wiki/Symmetric-key_algorithm)
1. **[AES (Advanced Encryption Standard)](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard)**
- **Key Lengths:** 128, 192, or 256 bits.
- **Usage:** Standards in government, financial transactions, and secure data storage.
- **Security:** Considered extremely secure when implemented correctly; often used with Galois/Counter Mode (GCM) for authenticated encryption.
2. **[Triple DES (3DES)](https://en.wikipedia.org/wiki/Triple_DES)**
- An older standard based on repeating the Data Encryption Standard (DES) algorithm three times to bolster its security.
![[3des.png]]
- Slower and considered less secure compared to AES, but still found in some legacy systems.
### 4.2 Asymmetric-Key Cryptography ([Public-Key Cryptography](https://en.wikipedia.org/wiki/Public-key_cryptography))
1. **[RSA (Rivest–Shamir–Adleman)](https://en.wikipedia.org/wiki/RSA_(cryptosystem))**
- **Security Basis:** Relies on the difficulty of factoring large integers.
- **Typical Key Sizes:** 2048 bits and above for modern security requirements.
- **Use Cases:** Secure web browsing (TLS/SSL), email encryption, digital signatures.
2. **[ECC (Elliptic Curve Cryptography)](https://en.wikipedia.org/wiki/Elliptic-curve_cryptography)**
- **Security Basis:** Hardness of discrete logarithm problems on elliptic curves.
- **Key Size Efficiency:** Much smaller key sizes compared to RSA for equivalent security.
- **Popular Curves:** Curve25519, secp256k1 (used in Bitcoin), P-256, etc.
3. **[Diffie–Hellman (DH)](https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange) and [Elliptic Curve Diffie–Hellman (ECDH)](https://en.wikipedia.org/wiki/Elliptic-curve_Diffie%E2%80%93Hellman)**
- **Purpose:** Securely exchange cryptographic keys over a public channel.
- **Importance:** Forms the foundation of many secure communication protocols, including TLS/SSL.
![[DiffieHellman.png]]
### 4.3 [Hash Functions](https://en.wikipedia.org/wiki/Hash_function)
1. **[SHA Family (Secure Hash Algorithm)](https://en.wikipedia.org/wiki/Secure_Hash_Algorithms)**
- **Variants:** [SHA-1](https://en.wikipedia.org/wiki/SHA-1) (now largely deprecated), [SHA-2](https://en.wikipedia.org/wiki/SHA-2) (SHA-224, SHA-256, SHA-384, SHA-512), and [SHA-3](https://en.wikipedia.org/wiki/SHA-3).
![[SHA-2.png]]
- **Purpose:** Provide a unique digital fingerprint of data, crucial in integrity checks and digital signatures.
2. **[MD5](https://en.wikipedia.org/wiki/MD5)**
- **Note:** Was widely used but is no longer recommended for security-sensitive operations due to vulnerability to collision attacks.
3. **Others**
- Examples include **[BLAKE2](https://en.wikipedia.org/wiki/BLAKE_(hash_function)#BLAKE2)** and **[RIPEMD](https://en.wikipedia.org/wiki/RIPEMD)** which are used in various applications for integrity and authentication.
### 4.4 [Digital Signature](https://en.wikipedia.org/wiki/Digital_signature)
#### 4.4.1. **RSA Digital Signatures**
- The RSA algorithm can be used to produce primitive digital signatures, but these are not secure, so aren't used anymore.
#### 4.4.2. ECDSA
- [ECDSA (Elliptic Curve Digital Signature Algorithm)](https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm) offers strong security with smaller keys, used in blockchain platforms (e.g., [[XML Aficionado/Bitcoin|Bitcoin]]).
- Efficient in performance and storage requirements.
#### 4.4.3. Lamport Signatures
- A [Lamport Signature](https://en.wikipedia.org/wiki/Lamport_signature) is a method for constructing a [digital signature](https://en.wikipedia.org/wiki/Digital_signature "Digital signature"). Lamport signatures can be built from any cryptographically secure [one-way function](https://en.wikipedia.org/wiki/One-way_function "One-way function"); usually a [cryptographic hash function](https://en.wikipedia.org/wiki/Cryptographic_hash_function "Cryptographic hash function") is used.
- Although the potential development of [[Quantum Computing|quantum computers]] threatens the security of many common forms of cryptography, it is believed that Lamport signatures with large hash functions would still be secure in that event.
- Each Lamport key can only be used to sign a single message. However, many Lamport signatures can be handled by one [Merkle hash tree](https://en.wikipedia.org/wiki/Merkle_tree "Merkle tree"), thus a single hash tree key can be used for many messages, making this a fairly efficient digital signature scheme.
#### 4.4.4. Merkle Signatures
- In [hash-based cryptography](https://en.wikipedia.org/wiki/Hash-based_cryptography "Hash-based cryptography"), the **[Merkle signature scheme](https://en.wikipedia.org/wiki/Merkle_signature_scheme)** is a [digital signature scheme](https://en.wikipedia.org/wiki/Digital_signature "Digital signature") based on [Merkle trees](https://en.wikipedia.org/wiki/Merkle_tree "Merkle tree") (also called hash trees) and one-time signatures such as the [Lamport signature scheme](https://en.wikipedia.org/wiki/Lamport_signature "Lamport signature").
![[MerkleTree.png]]
- An advantage of the Merkle signature scheme is that it is believed to be resistant against attacks by [[Quantum Computing|quantum computers]]. The traditional [public key](https://en.wikipedia.org/wiki/Public-key_cryptography "Public-key cryptography") algorithms, could become insecure once an effective quantum computer can be built (due to [Shor's algorithm](https://en.wikipedia.org/wiki/Shor%27s_algorithm "Shor's algorithm")).
- The Merkle signature scheme, however, only depends on the existence of secure [hash functions](https://en.wikipedia.org/wiki/Hash_function "Hash function"). This makes the Merkle signature scheme very adjustable and resistant to quantum computer-based attacks (due to [Grover's algorithm](https://en.wikipedia.org/wiki/Grover%27s_algorithm) only providing a quadratic speedup, i.e. reducing the time-complexity of pre-image attacks on hash functions to $2^{n/2}$).
## 5. Outlook and Future Developments
1. **[Post-Quantum Cryptography (PQC)](https://en.wikipedia.org/wiki/Post-quantum_cryptography)**
- Researchers and standardization bodies (like NIST) are evaluating new algorithms that can resist quantum computer attacks.
- Adoption of these algorithms is expected to increase as [[Quantum Computing|quantum computing]] progresses.
2. **Multi-Party Computation and Homomorphic Encryption**
- Techniques that allow computation on encrypted data without decrypting it first, preserving privacy in cloud computing scenarios.
3. **Integration with Blockchain and Distributed Ledgers**
- Cryptographic methods will continue to play a central role in securing blockchain-based financial and contract systems.
## Conclusion
Cryptography is the silent guardian of our digital society. From ancient ciphers to cutting-edge quantum-resistant algorithms, it continues to evolve to address new threats and use cases. By understanding and properly implementing these cryptographic techniques, organizations and individuals can ensure the confidentiality, integrity, and authenticity of their data.
---
# References
- Wikipedia:
- [Cryptography](https://en.wikipedia.org/wiki/Cryptography)
- [History of Cryptography](https://en.wikipedia.org/wiki/History_of_cryptography)
- [Public-Key Cryptography](https://en.wikipedia.org/wiki/Public-key_cryptography)
- [Hash Functions](https://en.wikipedia.org/wiki/Hash_function)
- [Post-Quantum Cryptography (PQC)](https://en.wikipedia.org/wiki/Post-quantum_cryptography)
- [U.S. National Institute of Standards and Technology (NIST)](https://www.nist.gov/)