Crittography CheatSheet

Published by lu122131 on

🧠 CHEATSHEET: Cryptography

πŸ“Š 1. The 3 Pillars at a Glance

RSA / ED25519
Asymmetric Algorithm

Core Purpose: Key exchange and Digital Signatures.
Length: RSA 4096 bits / ED25519 256 bits.
Metaphor: The mailbox system (Public slot vs Private key).

AES-256
Symmetric Algorithm

Core Purpose: Fast encryption for large files and data bulk.
Length: 256-bit key.
Metaphor: High-security safe with a single shared combination key.

SHA-256
Cryptographic Hash

Core Purpose: Integrity check and unique digital fingerprinting.
Length: Output is always locked at 256 bits.
Metaphor: The kitchen blender (Bake the cake, but you can’t unbake it).

πŸ”‘ 2. The Asymmetric Key Mechanism

Golden Rule: They form an inseparable pair. What one key locks, only the other can unlock. It is a strictly one-way street.

πŸ”’ Encryption (Guarantees Secrecy/Privacy)

Encryption: Performed using the recipient’s Public Key. The data becomes unreadable.
Decryption: Performed using your own Private Key.
Side effect: The sender becomes blind to the text one millisecond after encryption. They cannot decrypt their own message.

βœ’οΈ Digital Signature (Guarantees Authenticity/Integrity)

Signing: Pass the file through the blender (SHA-256) βž” get the Hash βž” lock it with your own Private Key.
Verifying: Recipient receives the payload βž” recalculates the Hash βž” uses the sender’s Public Key to verify the seal.
Note: If even a single bit of the file is changed, the hash output collapses completely (Avalanche Effect).

πŸ“Ά 3. Bidirectional Communication (RX / TX) Between A and B

To establish secure transmission, a dual asymmetric track is required:

  • TX Channel (From A to B): A encrypts for B using B’s Public Key. B decrypts using their Private Key.
  • RX Channel (From B to A): B responds to A using A’s Public Key. A decrypts using their Private Key.
⚑ Real-World Optimization (Hybrid Cryptography – HTTPS/SSH)

Asymmetric keys are computationally slow. They are only used during the initial split seconds (Handshake) to exchange the symmetric key:


A generates a temporary AES-256 key βž” Encrypts it with B's Public Key βž” B decrypts it with their Private Key.
From that millisecond onward, they use only AES-256 for data transmission (secure, lightweight, and instant).

🦹 4. The Real Weakest Links (Where Hackers Actually Attack)

Hackers do not attack the pure mathematics of AES-256 (requires too much energy). They target environment loopholes:

  • πŸ”Ή Private Key Theft: Deploying malware or Trojans on the victim’s PC to harvest the key directly from the hard drive or memory storage.
  • πŸ”Ή Man-in-the-Middle (MitM): An attacker intercepts the handshake sequence and hands A a fake public key while pretending to be B. (Resolved via HTTPS Certificates).
  • πŸ”Ή Timing Attacks: Measuring the CPU processing time down to the nanosecond to guess whether the secret key bits are 0s or 1s. (Mitigated by constant-time execution).

🌌 5. The Quantum Future

πŸ’₯ Shor’s Algorithm

A specialized quantum routine capable of resolving prime factorization (RSA) and discrete logarithms (ECC). It converts an exponentially difficult problem into a linear one, breaking traditional asymmetric frameworks in seconds. It uses quantum superposition and the Quantum Fourier Transform (QFT) to isolate hidden periods. It requires massive, stable quantum systems that are not yet production-ready.

πŸ›‘οΈ PQC (Post-Quantum Cryptography)

The upcoming defense standards drop prime numbers and curves completely. They replace them with the architectural complexity of multi-dimensional matrix lattices, which quantum workflows cannot bypass.

  • ML-KEM (formerly Kyber): Used for secure key exchange mechanisms (already live across Chrome and Signal).
  • ML-DSA (formerly Dilithium): Used to create future-proof quantum-resistant digital signatures.

Command to generate hybrid SSH keys (Present + Quantum Future):

ssh-keygen -t mlkem768-ed25519


lu122131

Luca Bortolotti Lentsch Engineer And Photographer From Lombardia Currently Around the World #lu122131ph

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *