H(M) or MACs to verify that H(M_received) = H(M_sent).n, written as a ≡ b (mod n) if n divides (a - b).Z_n = {0, 1, ..., n-1}, preserving addition and multiplication closure under modulo operations.C = M^e mod n) and Diffie-Hellman key exchange.
C_i = (P_i + K_(i mod m)) mod 26, flattening letter-frequency spikes to defeat simple frequency analysis.K followed by plaintext characters: Key = (k_1, ..., k_m, p_1, p_2, ...), encrypting via C_i = (P_i + K_i) mod 26.C_i = E_K(P_i); identical plaintext blocks produce identical ciphertext blocks, preserving structural patterns and leaking statistical data.C_1 = E_K(P_1 ⊕ IV).y = f(x) is easy; inversion x = f^{-1}(y) is hard without key k, but efficient x = f^{-1}_k(y) with k.d.
h = H(M); provides preimage resistance, second-preimage resistance, collision resistance, and the strict avalanche effect.O(N^2) to O(N) by issuing encrypted tickets.Uptime = [MTBF / (MTBF + MTTR)] × 100%.gcd(a, b) is the largest positive integer dividing non-zero integers a and b without remainder.gcd(a, b) = 1. Computed via Euclidean algorithm: gcd(a, b) = gcd(b, a mod b).e requires gcd(e, φ(n)) = 1 to guarantee modular inverse d exists.
26! keyspace; highly vulnerable to frequency analysis because plaintext letter distributions are completely preserved in ciphertext.k = 3) and general mixed-alphabet substitution ciphers.
P is multiplied by secret key k modulo 26: C = (P × k) mod 26.k must be coprime to 26 (gcd(k, 26) = 1) to ensure inverse k-1 exists for decryption; yields φ(26) = 12 valid keys.k = 7, inverse is k-1 = 15 since (7 × 15) mod 26 = 1.
p is prime and a is any positive integer coprime to p (gcd(a, p) = 1), then ap - 1 ≡ 1 (mod p).ap ≡ a (mod p). Used to compute modular inverses: a-1 ≡ ap - 2 (mod p).(e, s) using public key y = g-x mod p, challenge e = H(M || gk mod p), and response s = (k + x × e) mod q.a modulo n is an integer x satisfying a · x ≡ 1 (mod n), denoted a-1.gcd(a, n) = 1, computed using the Extended Euclidean Algorithm.3-1 ≡ 9 as 3 × 9 = 27 ≡ 1 (mod 26); used in RSA key generation.
m plaintext letters simultaneously via matrix multiplication modulo 26.C = (P × K) mod 26 and decryption computes P = (C × K-1) mod 26, where key matrix K must satisfy gcd(det(K), 26) = 1.Ci = Pi ⊕ Ki; Decryption: Pi = Ci ⊕ Ki. Requires a truly random key at least as long as the plaintext, used strictly once.Oi = EK(Nonce || Counteri) produces ciphertext Ci = Pi ⊕ Oi. Supports parallel processing and random-access decryption without error propagation.φ(n) counts positive integers up to n coprime to n, where gcd(k, n) = 1.p, φ(p) = p - 1. For distinct primes p, q, φ(pq) = (p - 1)(q - 1).p = 7, q = 11, φ(77) = 6 × 10 = 60, used to calculate decryption exponent d.
(e, n) and private key (d, n) where n = p × q and d ≡ e-1 (mod φ(n)). Encryption: C = Me mod n; Decryption: M = Cd mod n.Stego = Cover ⊕ Message).m.ax ≡ b (mod m), with a, b ∈ ℤ and m > 0.x ≡ a-1b (mod m) when gcd(a, m) = 1.3x ≡ 4 (mod 7) gives x ≡ 6).
Ci = (Pi + Ki mod m) mod 26 and Pi = (Ci - Ki mod m) mod 26.L and R) and processed across repeated rounds.i: Li = Ri-1 and Ri = Li-1 ⊕ F(Ri-1, Ki).Kn to K1).SubBytes, ShiftRows, MixColumns, and AddRoundKey.S[0..255] and index pointers i, j.S; Pseudo-Random Generation Algorithm (PRGA) outputs keystream byte K, computing C = P ⊕ K.H making it computationally infeasible to find two distinct inputs producing the identical digest.x ≠ y such that H(x) = H(y).n-bit hash function offers O(2n/2) resistance against collision attacks.
+-------------------------------------------------------------+
| DATA PRIVACY (Governance & Policy) |
| - User Consent - Purpose Limitation - Data Retention |
+------------------------------+------------------------------+
| Mandates Technical Controls
v
+-------------------------------------------------------------+
| DATA CONFIDENTIALITY (Technical Security) |
| Plaintext Data ---> [ AES-256 / TLS 1.3 ] ---> Cipher |
+-------------------------------------------------------------+
| Dimension | Data Confidentiality | Data Privacy |
|---|---|---|
| Focus | Technical secrecy and access prevention | Ethical and lawful personal data handling |
| Enforcement | AES-256, TLS 1.3, strict RBAC | Consent notices, minimization policies |
| Example | Encrypting hospital EHR databases prevents unauthorized access. | Securing patient consent before sharing records with third parties. |
The Euclidean Algorithm computes the Greatest Common Divisor (GCD) of two positive integers a and b (where a ≥ b) based on the division algorithm:
The core property states that gcd(a, b) = gcd(b, r). The process repeats until the remainder becomes zero; the last non-zero remainder is the GCD.
Given integers: a = 210, b = 45.
The remainder reaches 0 at Step 3. The last non-zero remainder is 15.
[210, 45] ---> 210 = 45(4) + 30 ---> Remainder = 30
|
v
[45, 30] ---> 45 = 30(1) + 15 ---> Remainder = 15 (Last non-zero)
|
v
[30, 15] ---> 30 = 15(2) + 0 ---> Terminate (r = 0)
| Iteration (i) | Dividend (a) | Divisor (b) | Quotient (q) | Remainder (r) | Division Relation |
|---|---|---|---|---|---|
| 1 | 210 | 45 | 4 | 30 | 210 = 45(4) + 30 |
| 2 | 45 | 30 | 1 | 15 | 45 = 30(1) + 15 |
| 3 | 30 | 15 | 2 | 0 | 30 = 15(2) + 0 |
The Additive Cipher (Shift Cipher) is a monoalphabetic substitution cipher mapping characters in ℤ₂₆ (A = 0, B = 1, ..., Z = 25) using modular arithmetic:
C = (P + K) mod 26P = (C - K) mod 26 = (C - K + 26) mod 26CODE, Shift Key K = 9.Plaintext values: C = 2, O = 14, D = 3, E = 4.
Generated Ciphertext: LXMN
Ciphertext values: L = 11, X = 23, M = 12, N = 13.
Recovered Plaintext: CODE
| Plaintext Char | Value (P) | Encryption: (P + 9) mod 26 | Cipher Value (C) | Ciphertext Char | Decryption: (C - 9) mod 26 | Recovered Char |
|---|---|---|---|---|---|---|
| C | 2 | (2 + 9) mod 26 = 11 | 11 | L | (11 - 9) mod 26 = 2 | C |
| O | 14 | (14 + 9) mod 26 = 23 | 23 | X | (23 - 9) mod 26 = 14 | O |
| D | 3 | (3 + 9) mod 26 = 12 | 12 | M | (12 - 9) mod 26 = 3 | D |
| E | 4 | (4 + 9) mod 26 = 13 | 13 | N | (13 - 9) mod 26 = 4 | E |
Cipher Block Chaining (CBC) is a block cipher feedback mode (NIST SP 800-38A). Each plaintext block is XORed with the preceding ciphertext block prior to encryption under key K, eliminating ECB mode's pattern-leakage vulnerability.
[ CBC Encryption ] [ CBC Decryption ] P_1 P_2 C_1 C_2 | | | +-----+ | (+)<-IV (+)<--C_1 [D_K] | [D_K] | | | | v | v [E_K] [E_K] (+)<-IV (+)<--C_1 | | | | C_1 C_2 P_1 P_2
Cᵢ requires Cᵢ̋₁, preventing parallel encryption.Cᵢ corrupts plaintext Pᵢ and inverts 1 bit in Pᵢ⁺₁, self-recovering thereafter.| Feature | Operational Behavior | Impact |
|---|---|---|
| Block Alignment | Fixed blocks (e.g., 128-bit AES) | Requires PKCS#7 padding |
| Parallel Execution | Serial encryption, parallel decryption | Decryption scales with cores |
| Primary Use | IPsec ESP, BitLocker, TLS suites | Standard bulk symmetric cipher |
A Cryptographic Hash Function is a deterministic algorithm H: {0, 1}* → {0, 1}ⁿ compressing arbitrary-length input M into a fixed n-bit digest h = H(M) (NIST SP 800-107). It requires three cardinal security properties.
1. Pre-image Resistance: Given h ---> Infeasible to find M with H(M) = h 2. Second Pre-image Resistance: Given M_1 ---> Infeasible to find M_2 != M_1 with H(M_2) = H(M_1) 3. Collision Resistance: Given ∅ ---> Infeasible to find ANY M_1 != M_2 with H(M_1) = H(M_2)
h, finding input M with H(M) = h is computationally infeasible. Brute-force complexity is O(2ⁿ), protecting stored passwords.M₁, finding M₂ ≠ M₁ such that H(M₁) = H(M₂) is computationally infeasible. Complexity is O(2ⁿ), preventing document substitution.M₁ ≠ M₂ with H(M₁) = H(M₂) is computationally infeasible. Birthday Paradox reduces complexity to O(2ⁿ/²), preventing signature forgery.| Property | Given | Complexity | Attack Mitigated |
|---|---|---|---|
| Pre-image | Digest h |
O(2ⁿ) | Password cracking |
| Second Pre-image | Message M₁ |
O(2ⁿ) | Document substitution |
| Collision | None | O(2ⁿ/²) | Signature forgery (Birthday attack) |
A Digital Signature is an asymmetric cryptographic mechanism (NIST FIPS 186-5) binding an entity to digital data using private key PR and public key PU.
The sender signs digest S = E_PR(H(M)). The recipient decrypts S with public key PU and checks if decrypted hash h' matches local hash H(M).
[ SIGNING ]
Message (M) ---> [ Hash H ] ---> [ Sign with PR_Alice ] ---> Signature (S)
|
+----------------------- Transmit (M + S) --------------------------+
|
v
[ VERIFYING ]
Message (M) ---> [ Hash H ] ------------------------> Digest H(M)
| (Compare)
Signature (S) -> [ Decrypt with PU_Alice ] ---------> Digest H'
Check: H(M) == H' ? Valid : Invalid
PR_A needed to produce signature S.H(M) ≠ h') during verification.PR_A is held exclusively by them.| Security Service | Cryptographic Enabler | Primary Application |
|---|---|---|
| Authentication | Asymmetric key (PR_A) |
S/MIME, PGP email |
| Integrity | Cryptographic hash (SHA-256) | Software code signing |
| Non-Repudiation | Exclusive private key custody | Banking fund transfers (SWIFT) |
Under ITU-T X.800, a security mechanism is a technical process, algorithm, or device implementing one or more security services (confidentiality, integrity, authentication). X.800 divides mechanisms into specific protocol-layer mechanisms and pervasive management mechanisms.
[X.800 Specific Security Mechanisms]
Encipherment --> Confers Data Confidentiality
Digital Signature --> Guarantees Non-Repudiation
Access Control --> Enforces Entity Authorization
Data Integrity --> Detects Unauthorized Modification
Auth Exchange --> Verifies Communicating Identities
| Security Mechanism | Primary Method | Service Provided | Protocol Example |
|---|---|---|---|
| Encipherment | Symmetric / Asymmetric | Confidentiality | AES in TLS 1.3 |
| Digital Signature | Private key signing | Non-Repudiation | RSA in X.509 |
| Access Control | ACLs & tickets | Access Control | RADIUS / Firewalls |
| Data Integrity | Hashes & HMACs | Integrity | HMAC in IPsec AH |
| Auth Exchange | Challenge-response | Entity Authentication | Kerberos / CHAP |
Cryptanalysis is the study of mathematical principles for recovering plaintext or key without prior key knowledge. Modern cryptanalysis classifies attacks into an escalating hierarchy based on adversary access to ciphertexts, plaintexts, and cryptographic oracles.
Attacker Capability & Oracle Access:
[Ciphertext-Only] --> [Known-Plaintext] --> [Chosen-Plaintext] --> [Chosen-Ciphertext]
(Intercepted C) (Known P-C pairs) (Encryption Oracle) (Decryption Oracle)
(P, C), analyzing algebraic structures to deduce target key K.| Attack Type | Attacker Knowledge | Oracle Access | Primary Defense |
|---|---|---|---|
| Ciphertext-Only | Intercepted C only |
None (Passive) | Large keyspace & high entropy |
| Known-Plaintext | Known (P, C) pairs |
Historical capture | Strong non-linear S-boxes |
| Chosen-Plaintext | Chosen P and ciphertexts |
Encryption oracle | Randomized padding & IVs |
| Chosen-Ciphertext | Chosen C and plaintexts |
Decryption oracle | Authenticated encryption (AEAD) |
A Multiplicative Cipher is a substitution cipher over ℤ26. Encryption: C = (P × K) mod 26 with gcd(K, 26) = 1. Since gcd(5, 26) = 1, key K = 5 is valid. Decryption: P = (C × K-1) mod 26.
Mapping A=0, ..., Z=25 yields D=3, A=0, T=19, A=0 with key K = 5:
| Plaintext | Value (P) | (P × 5) |
Modulo 26 | Ciphertext |
|---|---|---|---|---|
| D | 3 | 3 × 5 = 15 | 15 mod 26 = 15 | P |
| A | 0 | 0 × 5 = 0 | 0 mod 26 = 0 | A |
| T | 19 | 19 × 5 = 95 | 95 mod 26 = 17 | R |
| A | 0 | 0 × 5 = 0 | 0 mod 26 = 0 | A |
Resulting Ciphertext: PARA
Find K-1 satisfying 5 × K-1 ≡ 1 (mod 26). Extended Euclidean Algorithm: 26 = 5(5) + 1 &implies; 1 = 26 - 5(5) &implies; 5(-5) ≡ 1 (mod 26). Since -5 ≡ 21 (mod 26), verify: 5 × 21 = 105 = 4(26) + 1 ≡ 1 (mod 26). Hence, K-1 = 21.
Decryption mapping for P=15, A=0, R=17, A=0 using K-1 = 21:
| Ciphertext | Value (C) | (C × 21) |
Modulo 26 | Plaintext |
|---|---|---|---|---|
| P | 15 | 15 × 21 = 315 | 315 mod 26 = 3 | D |
| A | 0 | 0 × 21 = 0 | 0 mod 26 = 0 | A |
| R | 17 | 17 × 21 = 357 | 357 mod 26 = 19 | T |
| A | 0 | 0 × 21 = 0 | 0 mod 26 = 0 | A |
Recovered Plaintext: DATA (Decryption verified).
Counter (CTR) mode (NIST SP 800-38A) turns a block cipher into a stream cipher. CTR encrypts successive counter values combined with a Nonce to produce a keystream, XORed with plaintext blocks without padding.
[Nonce | Counter 1] [Nonce | Counter 2] [Nonce | Counter i]
| | |
+-----------+ +-----------+ +-----------+
K>| Encrypt Ek| K>| Encrypt Ek| K>| Encrypt Ek|
+-----------+ +-----------+ +-----------+
| Keystream 1 | Keystream 2 | Keystream i
P1 --->(+) P2 --->(+) Pi --->(+)
| | |
Ciphertext C1 Ciphertext C2 Ciphertext Ci
(Decryption uses forward Ek: Pi = Ci XOR Keystream i)
Ti = Nonce || Counteri using forward block cipher Oi = EK(Ti).Ci = Pi ⊕ Oi and recovers Pi = Ci ⊕ Oi using forward cipher EK.i can be decrypted independently without processing preceding ciphertext blocks.| Dimension | Implementation | Advantage |
|---|---|---|
| Circuit Area | Forward cipher EK only | Halves silicon cost |
| Throughput | Parallel block processing | High pipeline speed |
| Error Impact | 1-bit error affects 1 plaintext bit | No error cascade |
| Security Rule | Unique (Nonce, Counter) pair | Prevents two-time pad leak |
A conventional signature is a physical, handwritten mark made with ink on paper signifying personal assent. A digital signature is a cryptographic construct using asymmetric cryptography that binds the signer's private key to a document hash digest, providing authenticity, integrity, and non-repudiation.
Conventional Signature:
[Physical Paper] ---> Written with Ink Pen ---> Subjective Visual Inspection
Digital Signature:
[Message M] ---> Hash H(M) ---> Encrypt with Private Key ---> Signature S
Verification:
Decrypt S with Public Key ---> H'; Compare H(M) == H' (Deterministic Match)
| Parameter | Conventional Signature | Digital Signature |
|---|---|---|
| Medium | Physical ink and paper | Asymmetric cryptography & hashing |
| Content Binding | Independent of document text | Unique to each message bitstring |
| Verification | Subjective visual inspection | Deterministic algorithmic check |
| Tamper Proof | Weak; requires forensic tests | Absolute; bit change breaks signature |
| Reusability | Signature pattern can be copied | Cannot be copied or transferred |
The Diffie–Hellman Key Agreement Protocol (1976) enables two parties (Alice and Bob) to establish a shared secret key over an insecure channel without transmitting the secret itself. Security relies on the hardness of the Discrete Logarithm Problem in finite cyclic groups ℤp*.
Public Parameters: Large prime p, Primitive root g modulo p
ALICE (Private X_A) BOB (Private X_B)
Compute: Y_A = (g ^ X_A) mod p Compute: Y_B = (g ^ X_B) mod p
|------------ Public Key Y_A ----------->|
|<----------- Public Key Y_B ------------|
Shared Secret Derivation: Shared Secret Derivation:
K = (Y_B ^ X_A) mod p K = (Y_A ^ X_B) mod p
= g ^ (X_A * X_B) mod p = g ^ (X_A * X_B) mod p
p and generator g.XA and publishes YA = gXA mod p; Bob chooses private XB and publishes YB = gXB mod p.K = (YB)XA mod p; Bob computes K = (YA)XB mod p. Both obtain gXAXB mod p.K without solving the Discrete Logarithm Problem.| Parameter | Alice Execution | Bob Execution |
|---|---|---|
| Domain Setup | Public agreement on prime p = 23, Generator g = 5 | |
| Key Pair | Private XA = 6 → YA = 56 mod 23 = 8 | Private XB = 15 → YB = 515 mod 23 = 19 |
| Shared Key (K) | K = 196 mod 23 = 2 | K = 815 mod 23 = 2 |
| Vulnerability | Vulnerable to MitM; authenticated using digital certificates (ECDHE) | |
Under ITU-T X.800 and RFC 4949, security architecture is organized into three tiers:
Security Goals (CIA Triad: Confidentiality, Integrity, Availability)
| (Enforced via Policies)
v
Security Services (Data Confidentiality, Data Integrity, Authentication)
| (Implemented via Algorithms)
v
Security Mechanisms (AES-256-GCM, SHA-256 HMAC, RSA / ECDSA Signatures)
| Security Goal | Security Service | Security Mechanism | Practical Example |
|---|---|---|---|
| Confidentiality | Connection Confidentiality | AES-256-GCM | Encrypting HTTPS application payloads. |
| Integrity | Connectionless Integrity | SHA-256 HMAC | Verifying packet authenticity in TLS. |
| Non-Repudiation | Origin Non-Repudiation | RSA / ECDSA | Legally signing electronic bank transfers. |
| Availability | Availability Service | Ingress Rate Limiting | Thwarting SYN flood volumetric DDoS attacks. |
In modular arithmetic and abstract algebra:
Integer Partitioning into Residue Classes modulo n = 5:
[0] = {..., -5, 0, 5, ...} [3] = {..., -2, 3, 8, ...}
[1] = {..., -4, 1, 6, ...} [4] = {..., -1, 4, 9, ...}
[2] = {..., -3, 2, 7, ...} Z_5 = {[0], [1], [2], [3], [4]}
Congruence Criterion: a ≡ b (mod n) <===> (a - b) = k·n, k ∈ Z
| Operation | Algebraic Rule | Calculation (n = 7) | Result |
|---|---|---|---|
| Residue | r = a mod n | −17 mod 7 | 4, since −17 = (−3)(7) + 4 |
| Congruence | n | (a − b) | 23 ≡ 2 (mod 7) | Valid: 7 | (23 − 2 = 21) |
| Addition | (a + b) mod n | (5 + 6) mod 7 | 11 mod 7 = 4 ∈ Z7 |
| Multiplication | (a × b) mod n | (4 × 5) mod 7 | 20 mod 7 = 6 ∈ Z7 |
Devised by Vernam (1917) and proven by Shannon (1949), the One-Time Pad (OTP) cipher provides information-theoretic security:
Encryption: Plaintext P : 0 1 0 0 1 0 0 0 ('H')
⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕
Random Key K : 1 1 0 1 0 1 1 0 (Shared Pad, |K| = |P|)
= = = = = = = =
Ciphertext C : 1 0 0 1 1 1 1 0
Decryption: C ⊕ K = (P ⊕ K) ⊕ K = P ⊕ (K ⊕ K) = P ⊕ 0 = P ('H')
| Requirement | Technical Objective | Vulnerability if Breached | Mitigation |
|---|---|---|---|
| True Randomness | Uniform probability across keys | PRNG seed cryptanalysis | Hardware noise sources |
| Length (|K| ≥ |P|) | Prevents periodic repetitions | Reduces to Vigenere cipher | 1:1 pad allocation |
| Zero Key Reuse | Preserves ciphertext independence | C1 ⊕ C2 leaks plaintext XOR | Single-use pad rule |
| Secure Destruction | Guarantees forward secrecy | Stored pads expose past traffic | Immediate register wipe |
Cipher Feedback (CFB) mode, specified in NIST SP 800-38A, converts a symmetric block cipher (e.g., AES) into a self-synchronizing stream cipher:
[CFB Encryption - Segment i] [CFB Decryption - Segment i]
+-------------------------+ +-------------------------+
| Shift Register (I_i) | | Shift Register (I_i) |
+-------------------------+ +-------------------------+
| |
v v
+-------------------+ +-------------------+
K -->| Block Cipher (E) | K --->| Block Cipher (E) | <-- Forward E
+-------------------+ +-------------------+
| |
v v
[Select MSB s-bits] [Select MSB s-bits]
| |
P_i ----->(+) C_i ----->(+)
| |
v v
C_i (Transmitted) P_i (Decrypted Plaintext)
| Parameter | CFB Mode Specification | Comparison with CBC | Operational Benefit |
|---|---|---|---|
| Cipher Routine | Forward EK for Encrypt & Decrypt | CBC requires both EK and DK | Reduces hardware footprint |
| Segment Unit (s) | s = 8 or s = 128 bits | CBC requires 128-bit blocks | Real-time terminal streams |
| IV Requirement | Unique, unpredictable nonce | Static IV enables replays | Unique session keystreams |
| Error Recovery | Self-syncs after b clean bits | Stream ciphers lose sync | Robust over noisy links |
The Chinese Remainder Theorem (CRT) is a central theorem of modular arithmetic and public-key cryptography:
System of Congruences: Ring Isomorphism:
x ≡ a_1 (mod m_1)
x ≡ a_2 (mod m_2) Z_M <========> Z_m1 × Z_m2 × ... × Z_mk
: x <--------> (a_1, a_2, ..., a_k)
x ≡ a_k (mod m_k) [Single Large Mod] [Fast Parallel Moduli]
------------------------------------------------------------------------------------
Formula Steps: 1. M = ∏ m_i 2. M_i = M / m_i 3. y_i = (M_i)^(-1) mod m_i
4. x = [ ∑ (a_i · M_i · y_i) ] mod M
| Application | Implementation Role | Benefit / Speedup | Numerical Example |
|---|---|---|---|
| RSA Decryption | Computes cd mod n via p and q | Speeds up private key ops ≈ 4× | Decomposes 2048-bit math to 1024-bit |
| Secret Sharing | Asmuth-Bloom threshold scheme | Any k of n shares recover secret | Modular shares S mod mi |
| RNS Hardware | Residue Number System arithmetic | Carry-free parallel computation | High-speed DSP signal filters |
| Calculation Example | Solve x ≡ 2 (mod 3), x ≡ 3 (mod 5) | M=15; M1=5,y1=2; M2=3,y2=2 | x = (20 + 18) mod 15 = 8 |
Security analysis of digital signature schemes (KeyGen, Sign, Verify) is formalized under the Goldwasser-Micali-Rivest (GMR) model:
+---------------------------------------------------------------------------------+
| DIGITAL SIGNATURE ATTACK TAXONOMY (GMR MODEL) |
+---------------------------------------------------------------------------------+
| |
v (By Adversary Goal) v (By Adversary Access)
+---------------------------------------+ +-------------------------------------+
| 1. Total Break: | | 1. Key-Only Attack: |
| Recovers private signing key K_pr | | Only public key K_pub available |
| 2. Universal Forgery: | | 2. Known-Message Attack: |
| Constructs efficient signing code | | Possesses valid (m_i, σ_i) pairs |
| 3. Selective Forgery: | | 3. Generic Chosen-Message: |
| Forges signature for target msg | | Queries fixed list of messages |
| 4. Existential Forgery: | | 4. Adaptive Chosen-Message (CMA): |
| Forges valid pair for arbitrary m | | Queries oracle dynamically |
+---------------------------------------+ +-------------------------------------+
| Attack / Forgery | Severity | Mechanism / Attack Vector | Standard Defense |
|---|---|---|---|
| Total Break | Critical | Mathematical factorization (n = pq) | Sufficient key length (≥ 2048-bit RSA) |
| Universal Forgery | Severe | Algorithmic inversion without key | Provably secure reductions |
| Selective Forgery | High | Collision or preimage exploitation | Cryptographic hashing (SHA-256) |
| Existential Forgery | Moderate | Homomorphic algebraic relations | Randomized padding (RSA-PSS) |
| Adaptive CMA | Severe | Iterative signing oracle queries | Deterministic nonces (RFC 6979) |
According to NIST SP 800-12, information security preserves the confidentiality, integrity, and availability of information systems. Pervasive connectivity and escalating cyber threats make robust security essential to safeguard organizational assets, maintain regulatory compliance, and ensure stakeholder trust.
Adversarial Threats ──▶ [Security Controls: Crypto / Auth / Firewall] ──▶ [CIA Triad Enforced]
| Security Dimension | Primary Objective | Threat Mitigated | Standard Control |
|---|---|---|---|
| Confidentiality | Prevent unauthorized disclosure. | Eavesdropping, packet sniffing. | AES encryption, access control. |
| Integrity | Ensure data authenticity. | Tampering, message alteration. | SHA-256 hashing, HMAC signatures. |
| Availability | Ensure uninterrupted access. | DoS attacks, server outages. | Redundancy, load balancing. |
Standardized by NIST in FIPS PUB 197, AES is a symmetric block cipher based on Rijndael. It encrypts 128-bit blocks across three versions differing in key length, round count, and expanded key words.
128-bit Plaintext ──▶ [Initial Round] ──▶ [Rounds 1 to Nr-1] ──▶ [Final Round] ──▶ 128-bit Ciphertext
| Version | Key Size | Rounds | Expanded Words | Application |
|---|---|---|---|---|
| AES-128 | 128 bits | 10 | 44 words (11 keys) | Standard web traffic. |
| AES-192 | 192 bits | 12 | 52 words (13 keys) | Corporate networks. |
| AES-256 | 256 bits | 14 | 60 words (15 keys) | Military defense. |
In DES (NIST FIPS PUB 46-3), the key schedule derives sixteen 48-bit subkeys (K1 to K16) from a 64-bit master key to parameterize each Feistel round.
64-bit Key ──▶ [PC-1] ──▶ (C0, D0: 28b each) ──▶ [Circular Left Shifts] ──▶ [PC-2] ──▶ 48-bit Ki
| Stage | Input Size | Output Size | Operation |
|---|---|---|---|
| PC-1 | 64 bits | 56 bits | Drops 8 parity bits. |
| Shift-1 | 28 bits × 2 | 28 bits × 2 | Left shift by 1 bit. |
| Shift-2 | 28 bits × 2 | 28 bits × 2 | Left shift by 2 bits. |
| PC-2 | 56 bits | 48 bits | Selects 48-bit Ki. |
Integer factorization decomposes a composite integer n into non-trivial prime factors (n = p * q). In asymmetric cryptography (e.g., RSA), system security depends on the computational hardness of factoring large integers.
Composite Modulus (n) ──▶ [Special-Purpose: Trial Div / Fermat / Pollard] OR [General-Purpose: QS / GNFS]
| Method | Category | Time Complexity | Optimal Target |
|---|---|---|---|
| Trial Division | Special-purpose | O(sqrt(p)) | Small prime divisors (p < 10^6). |
| Fermat's Method | Special-purpose | O(abs(x - sqrt(n))) | Primes p, q close to sqrt(n). |
| Pollard's Rho | Special-purpose | O(p^(1/2)) | Medium factors (p <= 2^60). |
| GNFS | General-purpose | Sub-exponential | Standard RSA moduli (>= 2048 bits). |
Defined in ITU-T X.509 and RFC 5280, an X.509 digital certificate is an ASN.1 structured credential binding an entity's identity to their public key via a trusted Certificate Authority (CA) digital signature.
Certificate ──▶ [TBSCertificate (Fields & Extensions)] ──▶ [Algorithm ID] ──▶ [CA Digital Signature]
| Field | ASN.1 Element | Purpose | Example |
|---|---|---|---|
| Version | version |
Syntax specification. | v3 (integer 2). |
| Serial Number | serialNumber |
Revocation management. | Unique CA identifier. |
| Issuer DN | issuer |
Signing CA identity. | CN=DigiCert CA. |
| Validity | validity |
Operating timeframe. | NotBefore / NotAfter. |
| Signature | signatureValue |
CA digital signature. | Encrypted hash digest. |
Standardized in ANSI X9.62, ECDSA provides digital signatures matching RSA-3072 security, based on the hardness of the Elliptic Curve Discrete Logarithm Problem (ECDLP).
Signing: (m, d) ──▶ Point P = k*G ──▶ Signature (r, s)
Verification: (Signature, m, Q) ──▶ Point P' = u1*G + u2*Q ──▶ Check: x1' mod n == r
| Step | Signer Operation | Verifier Operation |
|---|---|---|
| Digest | Compute e = H(m). | Compute e = H(m). |
| Nonce | Pick random secret k. | Compute w = s^(-1) mod n. |
| Point | Point P = k * G. | Point P' = u1 * G + u2 * Q. |
| Tuple | Output (r, s). | Verify if x1' mod n == r. |
A matrix is a rectangular array of numbers or algebraic expressions arranged in m rows and n columns (order m × n). In cryptography, matrices defined over modular rings (ℤ26) and finite Galois fields (GF(28)) are essential for polygraphic substitution (Hill cipher) and linear diffusion (AES MixColumns).
+-----------------------------+
| Cryptographic Matrix Family |
+--------------+--------------+
|
+---------------+------------+------------+---------------+
| | | |
[Square Matrix] [Identity Matrix] [Invertible Matrix] [Diagonal Matrix]
m = n I * A = A det(A) != 0 a_ij = 0 (i!=j)
[3 2] [1 0] gcd(det, 26)=1 [5 0]
[5 7] [0 1] A * A^-1 = I [0 3]
K = [[3, 2], [5, 7]].A × I = I × A = A; serves as the neutral multiplicative baseline.gcd(det(A), 26) = 1 in ℤ26), guaranteeing an inverse A-1 for decryption.aij = 0 for i ≠ j), enabling decoupled element-wise modular multiplication.AT swaps rows with columns; a symmetric matrix satisfies A = AT, used in reversible key-mixing operations.| Matrix Type | Defining Mathematical Property | Cryptographic Role | Concrete Example |
|---|---|---|---|
| Square | Row count equals column count (m = n) | Block cipher key spaces | K = [[3, 2], [5, 7]] |
| Identity | aii = 1, aij = 0 (i ≠ j) |
Neutral operation verification | I2 = [[1, 0], [0, 1]] |
| Invertible | det(A) ≠ 0 and gcd(det(A), m) = 1 |
Decryption key derivation | K × K-1 ≡ I (mod 26) |
| Diagonal | aij = 0 for all i ≠ j |
Decoupled parallel scaling | diag(5, 3) in GF(28) |
A linear congruence of the form ax ≡ b (mod m) admits a unique solution modulo m if and only if gcd(a, m) = 1. Under the multiplicative inverse method, we find the modular inverse a-1 (mod m) such that a × a-1 ≡ 1 (mod m), and multiply both sides to obtain x ≡ a-1 × b (mod m).
[Given: 7x ≡ 9 (mod 26)]
|
v
[Check gcd(7, 26) = 1] --------------> [1 | 9 => Unique Solution Exists]
|
v
[Extended Euclidean Algorithm] ------> [Backtracking yields 7^-1 ≡ 15 mod 26]
|
v
[Multiply: x ≡ 9 * 15 (mod 26)] -----> [x = 135 mod 26 = 5]
|
v
[Verification: 7 * 5 = 35 ≡ 9 mod 26] -> [Confirmed Unique Solution: x = 5]
gcd(7, 26) using the Euclidean division algorithm:
gcd(7, 26) = 1 and 1 | 9, a unique incongruent solution exists in ℤ26.
-11(7) ≡ 1 (mod 26). Because -11 ≡ 15 (mod 26), we have 7-1 ≡ 15 (mod 26) [check: 7 × 15 = 105 = 4(26) + 1].
135 = 26(5) + 5. Hence, x ≡ 5 (mod 26).
x = 5 into the original congruence:
| Stage | Formula / Operation | Computed Value | Mathematical Role |
|---|---|---|---|
| Solvability Test | gcd(7, 26) via Euclidean division |
gcd = 1 |
Guarantees unique solution |
| Modular Inverse | Extended Euclidean back-substitution | 7-1 ≡ 15 (mod 26) |
Cancels coefficient 7 |
| Root Extraction | x ≡ 9 × 15 = 135 mod 26 |
x = 5 |
Primary root in ℤ26 |
| Verification | 7(5) = 35 mod 26 |
35 ≡ 9 (mod 26) |
Confirms algebraic correctness |
The Rail Fence Cipher (zigzag cipher) is a classical transposition cipher in which plaintext characters are written diagonally downward and upward across k parallel imaginary lines (“rails”) in an oscillating wave. Ciphertext is subsequently extracted by reading row by row from top to bottom, altering letter positions without changing letter identity.
Plaintext Index: 0 1 2 3 4 5 6 7 8 9
Plaintext Char: H E L L O W O R L D
Rail 1 (Even): H . . . L . . . O . . . O . . . L . --> H L O O L
. / . / . / . / .
Rail 2 (Odd): . E . . . L . . . W . . . R . . . D --> E L W R D
Extracted Ciphertext: H L O O L E L W R D
P = "HELLOWORLD" contains N = 10 characters. For depth k = 2:
N = 10, depth k = 2:
⌈10/2⌉ = 5 characters: [H, L, O, O, L].
⌊10/2⌋ = 5 characters: [E, L, W, R, D].
| Rail Level | Assigned Index Positions | Character Stream | Segment Length |
|---|---|---|---|
| Rail 1 (Top) | 0, 2, 4, 6, 8 | H, L, O, O, L | 5 characters |
| Rail 2 (Bottom) | 1, 3, 5, 7, 9 | E, L, W, R, D | 5 characters |
| Ciphertext | Rail 1 + Rail 2 concatenation | HLOOLELWRD |
10 characters |
| Plaintext | Interleaved rail reconstruction | HELLOWORLD |
10 characters |
Output Feedback (OFB) mode is an authenticated confidentiality mode of operation (standardized in NIST SP 800-38A) that converts a symmetric block cipher into a synchronous stream cipher. It generates a continuous sequence of pseudo-random keystream blocks by iteratively encrypting the previous cipher output, which is subsequently bitwise XORed with plaintext blocks.
Initialization Vector (IV)
|
v
+-----------------+
Key (K) --->| Block Encrypt E |
+-----------------+
|-------------------+ (Internal Feedback)
v |
Keystream Block (O1) |
| |
Plaintext (P1) ------->(X) |
| v
v +-----------------+
Ciphertext (C1) | Block Encrypt E | <--- Key (K)
+-----------------+
|
v
Keystream Block (O2)
|
Plaintext (P2) ------> (X)
|
v
Ciphertext (C2)
O0 = IV, Oj = EK(Oj-1). Generation is completely decoupled from plaintext and ciphertext streams.Cj = Pj ⊕ Oj; decryption performs identical XOR operations Pj = Cj ⊕ Oj using only the forward encryption function EK.C1 ⊕ C2 = P1 ⊕ P2).| Operational Dimension | OFB Mode Specification | Cryptographic Benefit |
|---|---|---|
| Cipher Classification | Synchronous stream cipher emulator | Encipher arbitrary bit-lengths without padding |
| Decryption Engine | Forward block encryption EK |
Eliminates inverse decryption circuitry |
| Error Extension | Isolated to flipped bit (0-bit propagation) | Ideal for error-prone noisy satellite/RF links |
| Pre-processing | Full keystream offline generation allowed | Zero encryption delay on data transmission |
Whirlpool is an iterated cryptographic hash function designed by Vincent Rijmen and Paulo S. Barreto, standardized in ISO/IEC 10118-3. It operates on arbitrary message inputs of length up to 2256 − 1 bits and produces a fixed 512-bit message digest using a dedicated 512-bit block cipher inside a Miyaguchi-Preneel compression scheme.
Message (M) ---> [Pad: '1' + '0's + 256-bit Length] ---> 512-bit Message Blocks (M_i)
|
Intermediate Hash (H_0 = IV = 0^512) |
| |
v v
+---------------+ +---------------+
| W Block Cipher| <===== Key: H_{i-1} | W Block Cipher|
+---------------+ +---------------+
| |
+-----> (X) <--- H_{i-1} +-----> (X)
| |
v v
(X) <--- M_i Digest
| (512-bit)
v
H_i (Miyaguchi-Preneel: H_i = E_{H_{i-1}}(M_i) ⊕ H_{i-1} ⊕ M_i)
SubBytes (8 × 8 S-box substitution), ShiftColumns, MixRows (MDS diffusion), and AddRoundKey.Hi = EHi-1(Mi) ⊕ Hi-1 ⊕ Mi, offering provable security against collision attacks.| Architectural Parameter | Whirlpool Specification | Cryptographic Significance |
|---|---|---|
| Output Digest Size | 512 bits (64 bytes) | Equal to SHA-512, standardized under ISO/IEC 10118-3 |
| Message Block Size | 512 bits (arranged as 8 × 8 state) | Processed iteratively via Miyaguchi-Preneel compression |
| Internal Rounds | 10 iterative rounds | Square-cipher lineage with optimal MDS matrix diffusion |
| Security Resistance | 256-bit collision, 512-bit preimage | Robust resistance against all known analytical attacks |
Secure/Multipurpose Internet Mail Extensions (S/MIME), standardized in RFC 8551, is an IETF industry standard protocol providing end-to-end cryptographic security services for electronic messaging. Built on the Cryptographic Message Syntax (CMS) and X.509 Public Key Infrastructure, it protects MIME message entities across untrusted intermediate SMTP relays.
SENDER RECEIVER
+---------------+ +---------------+
| Email Content | | Email Content |
+-------+-------+ +-------^-------+
| |
v |
[Digital Signature] (Sender Private Key) ---- SHA-256 / RSA/ECDSA --> [Verify Signature]
| |
v |
[Symmetric Encryption] (Session Key K_s) ---- AES-256-CBC ----------> [Decrypt Content]
| ^
v |
[Session Key Encryption] (Receiver PubKey) -- RSA / ECDH -----------> [Decrypt K_s]
| |
+=============> SMTP Relay Network (Untrusted) ===============+
EnvelopedData).multipart/signed, application/pkcs7-mime), securing headers and timestamps.| Security Service | Cryptographic Mechanism | CMS Object / Algorithm Standard |
|---|---|---|
| Confidentiality | Symmetric payload encryption + Key wrapping | EnvelopedData / AES-256, RSA-OAEP |
| Integrity | Cryptographic message hashing | SignedData / SHA-256, SHA-512 |
| Authentication | Sender private key digital signature | SignedData / RSA, ECDSA, Ed25519 |
| Non-Repudiation | X.509 PKI certificate chain binding | X.509 v3 hierarchical CA verification |
[ PASSIVE ATTACK: Eavesdropping & Monitoring ]
Sender Alice ------------ Transmission ------------> Receiver Bob
|
v (Intercepts / Reads)
Attacker Eve (No data change)
[ ACTIVE ATTACK: Tampering & Impersonation ]
Sender Alice ----> [ Attacker Mallory: Alters / Drops / Forges ] ----> Receiver Bob
| Dimension | Passive Attacks | Active Attacks |
|---|---|---|
| Data Impact | Zero modification; data remains untouched | Data altered, injected, deleted, or blocked |
| Security Goal | Breaches confidentiality and privacy | Breaches integrity, availability, authenticity |
| Detection | Very difficult (leaves no network traces) | Feasible (detected via logs and hashes) |
| Primary Defense | Prevention via robust encryption (AES) | Detection via MACs, digital signatures, IDS |
| Examples | Packet sniffing (Wireshark), wiretapping | Man-in-the-Middle, replay, TCP SYN flood |
64-bit Plaintext Block
|
v
[Initial Permutation (IP)]
|
+-------------+-------------+
| |
L_0 (32 bits) R_0 (32 bits)
| |
| +-------------+ |
| | Round Funct |<---+--- Subkey K_1 (48 bits)
| | F(R, K) | |
v +------+------+ |
(XOR) <-----------+ |
| |
\-------------\ /-----------/ (32-bit Swap)
X
/-------------/ \-----------\
| |
L_1 (32 bits) R_1 (32 bits)
: :
: [ Rounds 2 to 16 ] :
| |
L_16 (32 bits) R_16 (32 bits)
| |
\------------- -----------/ (Pre-output Swap)
X
/------------- -----------\
| (R_16 || L_16) |
+-------------+-------------+
|
v
[Inverse Initial Permutation IP^-1]
|
v
64-bit Ciphertext Block
| Parameter | DES Standard Specification |
|---|---|
| Block Size | 64 bits (Plaintext and Ciphertext) |
| Key Size | 64-bit raw key (8 parity bits discarded) → 56-bit effective key |
| Rounds | 16 identical Feistel iterations |
| Subkey Size | 48 bits per round (derived via PC-1, circular shifts, PC-2) |
| S-Boxes | 8 non-linear substitution boxes (each maps 6 bits → 4 bits) |
128-bit Plaintext -> [ AddRoundKey (K_0) ]
|
+---------------------+---------------------+
| STANDARD ROUND (Rounds 1 to Nr-1) |
| |
| 1. [ SubBytes ] (Non-linear S-box GF) |
| v |
| 2. [ ShiftRows ] (Row Byte Permutation)|
| v |
| 3. [ MixColumns ] (Matrix Mult GF(2^8)) |
| v |
| 4. [ AddRoundKey ] (Bitwise XOR with K_r)|
+---------------------+---------------------+
|
v
+-------------------------------------------+
| FINAL ROUND (Round Nr) |
| [SubBytes] -> [ShiftRows] -> [AddRoundKey]|
| (MixColumns is omitted) |
+---------------------+---------------------+
|
v
128-bit Ciphertext Block
| Transformation | Mathematical Basis | Cryptographic Role | Inverse Operation |
|---|---|---|---|
| SubBytes | Inversion in $GF(2^8)$ + Affine transformation | Confusion (Non-linear mapping) | InvSubBytes (Inverse S-box) |
| ShiftRows | Cyclical byte shift left by row index ($r$) | Intra-column Diffusion | InvShiftRows (Shift right) |
| MixColumns | Matrix multiplication modulo $(x^4 + 1)$ in $GF(2^8)$ | Inter-byte Diffusion across columns | InvMixColumns (Mult by $d(x)$) |
| AddRoundKey | Bitwise XOR ($\oplus$) with 128-bit subkey | Key Dependency | AddRoundKey (Self-inverse) |
+-----------------------------------------------------------------+
| KEY GENERATION PHASE |
| Select primes p, q ----> Modulus n = p*q, phi(n) = (p-1)*(q-1)|
| Select public exponent e: gcd(e, phi(n)) = 1 |
| Compute private exponent d: d * e = 1 mod phi(n) |
| Public Key: PU = {e, n} Private Key: PR = {d, n} |
+-------------------------------+---------------------------------+
|
+------------------+------------------+
| |
v v
+-------------------------------+ +-----------------------------+
| ENCRYPTION (Sender) | | DECRYPTION (Receiver) |
| Plaintext M (where M < n) | | Ciphertext C |
| Public Key {e, n} | | Private Key {d, n} |
| Formula: C = M^e mod n | | Formula: M = C^d mod n |
| | | | ^ |
| v | | | |
| Ciphertext C -------------+---+--------------+ |
+-------------------------------+ +-----------------------------+
| Component | Notation | Mathematical Definition | Access |
|---|---|---|---|
| Primes | $p, q$ | Two large prime numbers | Secret |
| Modulus | $n$ | $n = p \times q$ | Public |
| Euler Totient | $\phi(n)$ | $\phi(n) = (p - 1)(q - 1)$ | Secret |
| Public Key | $PU$ | $\{e, n\}$ where $\gcd(e, \phi(n)) = 1$ | Public |
| Private Key | $PR$ | $\{d, n\}$ where $d \equiv e^{-1} \pmod{\phi(n)}$ | Secret |
Arbitrary-Length Input Message M (Length L bits)
|
v
[ Padding & Length Append (MD-Strengthening) ]
|
v
Padded: M_1 || M_2 || ... || M_t (b bits each)
|
+-----------------------+-----------------------+
| | |
v v v
+-------+ +-------+ +-------+
| M_1 | | M_2 | | M_t |
+---+---+ +---+---+ +---+---+
| | |
v v v
+---+ +---+ +---+
IV ->| f |---- H_1 --------->| f |---- H_2 ...------>| f |---- H_t
+---+ +---+ +---+ |
v
[ Final Map g ]
|
v
n-bit Digest
| Metric | SHA-256 | SHA-512 | MD5 |
|---|---|---|---|
| Block Size ($b$) | 512 bits | 1024 bits | 512 bits |
| Digest Size ($n$) | 256 bits | 512 bits | 128 bits |
| Length Field | 64-bit integer | 128-bit integer | 64-bit integer |
| Compression Logic | 64 rounds of non-linear logic | 80 rounds of non-linear logic | 64 rounds of modular logic |
| Collision Resistance | Secure (No collisions) | Secure (No collisions) | Broken (Collisions found) |
[SENDER: Alice]
Message M --------------+------------------------------------+
| |
v |
[ Hash Function H ] |
| |
v |
Digest h = H(M) |
| |
v |
[ Encrypt with Private Key PR_A ] |
| |
v |
Signature S |
| |
+=================> (M, S) =========+
|
v
[RECEIVER: Bob]
Message M ------------------> [ Hash H ] -------------> Digest h'
|
Signature S -> [ Decrypt with Public Key PU_A ] ------> Digest h''
|
v
[ Match h' == h''? ]
/ \
YES v v NO
[ Valid Signature ] [ Invalid ]
| Service | Cryptographic Enforcement | Mitigated Attack |
|---|---|---|
| Data Integrity | Hash comparison ($h' \stackrel{?}{=} h''$) reveals bit changes | Tampering and alteration in transit |
| Authentication | Sender's public key $PU_A$ validates private key origin | Impersonation and spoofing |
| Non-Repudiation | Private key $PR_A$ is unique to the sender | False denial of document authorship |
| Efficiency | Asymmetric operations restricted to short hash digest | Computational overhead on large files |
+------------------------------------+
| KEY DISTRIBUTION CENTER (KDC) |
| +-------------+ +--------------+ |
| | Auth Server | | Ticket-Grant | |
| | (AS) | | Server (TGS) | |
| +------+------+ +-------+------+ |
+---------|-----------------|--------+
| |
(1) AS_REQ | |
+--------------------+ |
| |
v (2) AS_REP: K_{c,tgs} + TGT |
+------------------+ |
| | (3) TGS_REQ: TGT + Auth_c |
| +----------------------------+
| |
| |<---------------------------+
| CLIENT (C) | (4) TGS_REP: K_{c,v} + ST
| |
| | (5) AP_REQ: ST + Auth_c
| +----------------------------+
| | |
| |<---------------------------+
| | (6) AP_REP: Mutual Auth |
+------------------+ v
+---------------------------+
| APPLICATION SERVER (V) |
+---------------------------+
| Token | Encrypted Under | Contents | Security Role |
|---|---|---|---|
| Ticket-Granting Ticket (TGT) | $K_{tgs}$ (TGS Secret Key) | Client ID, $K_{c,tgs}$, IP, Lifetime | Authorizes client to request service tickets without re-prompting password |
| Service Ticket (ST) | $K_v$ (Server Secret Key) | Client ID, $K_{c,v}$, IP, Lifetime | Authorizes client access to designated network application server $V$ |
| Authenticator | Session Key ($K_{c,tgs}$ or $K_{c,v}$) | Client ID, Current Timestamp | Proves ticket bearer possesses session key; defeats replay attacks |
| Mutual Auth Reply | $K_{c,v}$ (Service Session Key) | Timestamp + 1 | Proves to client that server legitimately decrypted the Service Ticket |
The Extended Euclidean Algorithm is an extension of the classical Euclidean division algorithm. In addition to calculating the Greatest Common Divisor (gcd(a, b)) of two positive integers a and b, it computes integers x and y satisfying Bézout's Identity: a × x + b × y = gcd(a, b). In modern asymmetric cryptography, this algorithm is fundamental for computing modular multiplicative inverses during key generation (such as calculating the RSA private key exponent d ≡ e-1 (mod φ(n))).
Forward Division Steps:
Step 1: 81 = 57 * 1 + 24 ==> Quotient q1 = 1, Remainder r1 = 24
Step 2: 57 = 24 * 2 + 9 ==> Quotient q2 = 2, Remainder r2 = 9
Step 3: 24 = 9 * 2 + 6 ==> Quotient q3 = 2, Remainder r3 = 6
Step 4: 9 = 6 * 1 + 3 ==> Quotient q4 = 1, Remainder r4 = 3
Step 5: 6 = 3 * 2 + 0 ==> Quotient q5 = 2, Remainder r5 = 0
Last non-zero remainder: r4 = 3 ==> gcd(81, 57) = 3
To express gcd(81, 57) = 3 as a linear combination of 81 and 57, we perform systematic back-substitution starting from Step 4:
6 = 24 - 2 × 9, substitute for 6:
9 = 57 - 2 × 24, substitute for 9:
24 = 81 - 1 × 57, substitute for 24:
Rearranging into standard linear combination form gives:
Thus, the Bézout coefficients are x = -7 and y = 10.
| Index (i) | Quotient (qi) | Remainder (ri) | Coefficient (si) | Coefficient (ti) | Linear Combination: 81si + 57ti |
|---|---|---|---|---|---|
| 0 | — | 81 | 1 | 0 | 81(1) + 57(0) = 81 |
| 1 | — | 57 | 0 | 1 | 81(0) + 57(1) = 57 |
| 2 | 1 | 24 | 1 | -1 | 81(1) + 57(-1) = 24 |
| 3 | 2 | 9 | -2 | 3 | 81(-2) + 57(3) = 9 |
| 4 | 2 | 6 | 5 | -7 | 81(5) + 57(-7) = 6 |
| 5 | 1 | 3 | -7 | 10 | 81(-7) + 57(10) = 3 |
| 6 | 2 | 0 | 19 | -27 | 81(19) + 57(-27) = 0 |
Verification Check: 81(-7) + 57(10) = -567 + 570 = 3. The linear combination holds with exact mathematical equality.
The ITU-T Recommendation X.800 (Security Architecture for OSI) defines a systematic, international framework for identifying security requirements and selecting protocols in networked environments. Under X.800, a security service is a processing or communication capability provided by a protocol layer of an open system to ensure adequate security of systems and data transfers. X.800 formally defines five essential categories of security services.
+-----------------------------------------------------------------------+
| ITU-T X.800 OSI SECURITY SERVICES TAXONOMY |
+-----------------------------------------------------------------------+
|
+-------------------------+-------------------------+
| | |
+---------v---------+ +---------v---------+ +---------v---------+
| 1. AUTHENTICATION | | 2. ACCESS CONTROL | | 3. CONFIDENTIALITY|
| - Peer Entity | | - Prevent | | - Connection |
| - Data Origin | | Unauthorized | | - Connectionless |
+---------+---------+ | Resource Use | | - Selective Field |
| +---------+---------+ | - Traffic Flow |
| | +---------+---------+
+---------v---------+ +---------v---------+ |
| 4. DATA INTEGRITY | | 5. NON-REPUDIATION| |
| - With Recovery | | - Proof of Origin | |
| - Without Recov. | | - Proof of Deliv. |<--------------+
+-------------------+ +-------------------+
| Security Service | Primary Objective | Enabling Cryptographic Mechanism | Representative Protocol |
|---|---|---|---|
| Authentication | Confirm entity and message identity | Digital signatures, authentication exchanges, nonces | TLS Handshake, Kerberos |
| Access Control | Prevent unauthorized resource access | Access control lists, tokens, firewalls | RADIUS, IEEE 802.1X |
| Data Confidentiality | Prevent passive eavesdropping | Symmetric / asymmetric encipherment, padding | AES in TLS 1.3, IPsec ESP |
| Data Integrity | Detect unauthorized data modification | Cryptographic hash functions, HMACs | IPsec AH, SHA-256 |
| Non-Repudiation | Prevent denial of transmission/receipt | Digital signatures, trusted timestamping/notarization | X.509 PKI, PGP / S/MIME |
Invented by Charles Wheatstone in 1854 and popularized by Lyon Playfair, the Playfair Cipher is a classical polygraphic digraphic substitution cipher. Unlike monoalphabetic ciphers that substitute single letters individually, Playfair encrypts pairs of letters (digraphs) simultaneously using a 5×5 grid formed by a keyword. This digraphic substitution expands the alphabet space from 26 letters to 26 × 26 = 676 possible pairs, greatly flattening single-letter frequency distribution. By convention, I and J share a single cell.
The given 5×5 key matrix constructed with keyword MONARCHY is:
Col 1 Col 2 Col 3 Col 4 Col 5
Row 1: M O N A R
Row 2: C H Y B D
Row 3: E F G I/J K
Row 4: L P Q S T
Row 5: U V W X Z
Digraph Preparation Rules:
BALLOON into pairs. The first pair is BA.LL. Identical letters within a pair must be separated by inserting a filler letter (typically X), yielding LX.OON. Pairing continues with LO, followed by ON.Applying the standard Playfair transformation rules to each digraph:
B is at (Row 2, Col 4) and A is at (Row 1, Col 4). Both lie in Column 4. Under the same-column rule, each letter shifts down cyclically: B becomes I (Row 3, Col 4) and A becomes B (Row 2, Col 4). Thus, BA → IB.L is at (Row 4, Col 1) and X is at (Row 5, Col 4). Forming the opposite corners of their rectangle, L maps to U (Row 5, Col 1) and X maps to S (Row 4, Col 4). Thus, LX → US.L is at (Row 4, Col 1) and O is at (Row 1, Col 2). Forming the opposite rectangle corners, L maps to M (Row 1, Col 1) and O maps to P (Row 4, Col 2). Thus, LO → MP.O is at (Row 1, Col 2) and N is at (Row 1, Col 3). Both lie in Row 1. Under the same-row rule, each letter shifts right cyclically: O becomes N (Row 1, Col 3) and N becomes A (Row 1, Col 4). Thus, ON → NA.Concatenating the ciphertext digraphs:
Decryption reverses each transformation: shift upward for same column, shift leftward for same row, and reverse corner coordinates for rectangles:
IB (Same Col) → Shift up: I → B, B → A → BAUS (Rectangle) → Corner lookup: U → L, S → X → LXMP (Rectangle) → Corner lookup: M → L, P → O → LONA (Same Row) → Shift left: N → O, A → N → ONReconstructed text: BALXLOON. Dropping the filler letter X between identical letters recovers the original plaintext: BALLOON.
| Digraph Pair | Geometric Rule | Coordinates (Row, Col) | Ciphertext Output |
|---|---|---|---|
| BA | Same Column (Col 4) | (2,4) and (1,4) → shift down | IB |
| LX | Rectangle Rule | (4,1) and (5,4) → opposite corners | US |
| LO | Rectangle Rule | (4,1) and (1,2) → opposite corners | MP |
| ON | Same Row (Row 1) | (1,2) and (1,3) → shift right | NA |
The Miller–Rabin Primality Test is a randomized, probabilistic primality testing algorithm essential for generating large prime numbers in public-key cryptosystems (such as RSA and Diffie–Hellman). It relies on two foundational number-theoretic principles: Fermat's Little Theorem (an-1 ≡ 1 (mod n) for prime n) and the fact that in a prime field ℤn, the only square roots of 1 modulo n are 1 and -1 ≡ n - 1. If any non-trivial square root of 1 is discovered, n is unconditionally composite.
+-----------------------------+
| Input: Odd integer n > 2 |
| Decompose: n - 1 = 2^k * m|
+--------------+--------------+
|
v
+-----------------------------+
| Pick random base a in [2,n-2|
| Compute x = a^m mod n |
+--------------+--------------+
|
+-----------+-----------+
| x == 1 or x == n - 1 ?|
+-----+-----------+-----+
YES| |NO
v v
+-------------+ +-------------------------+
| Round PASS | | Loop r = 1 to k-1: |
| (Probably | | x = x^2 mod n |
| Prime) | | if x == n - 1 -> PASS |
+-------------+ | if x == 1 -> COMPOS.
+------------+------------+
|
+------------v------------+
| Reached end without n-1 |
| Return: DEFINITELY |
| COMPOSITE |
+-------------------------+
n > 2, write n - 1 = 2k × m, where m is an odd integer and k ≥ 1 by factoring out all factors of 2.a such that 2 ≤ a ≤ n - 2.x ≡ am (mod n) using modular exponentiation. If x ≡ 1 (mod n) or x ≡ n - 1 (mod n), candidate n passes this round (it is probably prime).x ≠ 1 and x ≠ n - 1, square x repeatedly for r = 1, 2, ..., k - 1:
x ≡ x2 (mod n).
x ≡ n - 1 (mod n), candidate n passes this round.
x ≡ 1 (mod n), then the previous value of x was a non-trivial square root of 1, proving n is definitely composite.n - 1, n is declared definitely composite (base a is a compositeness witness).n is composite, the probability of passing a round is at most 1/4. Testing across t independent random bases reduces the false prime probability to at most (1/4)t = 2-2t, which is negligible for t = 64.Example: Test n = 61 with base a = 2:
Decompose: 61 - 1 = 60 = 22 × 15 &implies; k = 2, m = 15.
Compute: x = 215 (mod 61). Since 26 = 64 ≡ 3, 212 ≡ 9, 215 = 9 × 8 = 72 ≡ 11 (mod 61).
Next square: x = 112 = 121 ≡ 60 ≡ -1 ≡ n - 1 (mod 61).
Since x ≡ n - 1, n = 61 passes the test and is certified probably prime.
| Evaluation Metric | Miller–Rabin Primality Test | Fermat Primality Test |
|---|---|---|
| Core Foundation | Fermat's Theorem + Non-trivial square roots of 1 | Fermat's Little Theorem alone (an-1 ≡ 1) |
| Carmichael Numbers | Immune: reliably detects all Carmichael composites | Fails completely: Carmichael numbers pass all coprime bases |
| Worst-Case Error Bound | At most (1/4)t for t rounds |
Can approach 1 for Carmichael numbers |
| Time Complexity | O(t × log3 n) bit operations |
O(t × log3 n) bit operations |
Formulated by Taher Elgamal in 1985, the ElGamal Cryptosystem is an asymmetric public-key encryption scheme based on the Diffie–Hellman key exchange principle. Its mathematical security relies on the intractability of the Discrete Logarithm Problem (DLP) in finite cyclic groups: given a large prime p, a generator α, and y ≡ αx (mod p), it is computationally infeasible to compute private key x = logα y. ElGamal is a probabilistic cryptosystem: encrypting identical plaintexts produces completely different ciphertexts due to an ephemeral random key k.
Alice (Receiver) Bob (Sender)
+--------------------+ +--------------------+
| 1. Key Generation | | 2. Encryption |
| - Prime p, gen α | | - Plaintext M < p |
| - Private key: x | | - Ephemeral key: k |
| - Public: y=α^x%p | | - c1 = α^k mod p |
| - Publish (p, α, y)|---------(p, α, y)------->| - K = y^k mod p |
+--------------------+ | - c2 = (M * K) % p |
+---------+----------+
|
+--------------------+ |
| 3. Decryption |<------- Ciphertext (c1, c2)--------+
| - K = (c1)^x mod p |
| - K^-1 mod p |
| - M = (c2*K^-1)%p |
+--------------------+
p and a primitive root (generator) α modulo p.
x uniformly at random such that 1 < x < p - 1.
y ≡ αx (mod p).
PK = (p, α, y); Private Key is SK = x.M in the range 0 ≤ M ≤ p - 1.
k such that 1 < k < p - 1 and gcd(k, p - 1) = 1.
c1 ≡ αk (mod p).
K ≡ yk ≡ (αx)k ≡ αxk (mod p).
c2 ≡ (M × K) (mod p).
C = (c1, c2).x and received c1 to recover shared secret: K ≡ (c1)x ≡ (αk)x ≡ αkx (mod p).
K-1 (mod p) using the Extended Euclidean Algorithm.
M ≡ (c2 × K-1) (mod p) ≡ (M × K × K-1) ≡ M (mod p).Example: Let p = 11, α = 2. Private key x = 3 &implies; y = 23 (mod 11) = 8. Public key is (11, 2, 8).
• Encrypt: Plaintext M = 5, choose ephemeral k = 4.
c1 = 24 (mod 11) = 16 ≡ 5 (mod 11).
K = 84 (mod 11) = 4096 ≡ 4 (mod 11).
c2 = (5 × 4) (mod 11) = 20 ≡ 9 (mod 11). Ciphertext is (c1, c2) = (5, 9).
• Decrypt: K = 53 (mod 11) = 125 ≡ 4 (mod 11). Inverse 4-1 (mod 11) = 3 (since 4 × 3 = 12 ≡ 1).
M = (9 × 3) (mod 11) = 27 ≡ 5 (mod 11). Plaintext 5 is recovered exactly.
| Characteristic | ElGamal Cryptosystem | RSA Cryptosystem |
|---|---|---|
| Hardness Problem | Discrete Logarithm Problem (DLP) | Integer Factorization Problem (IFP) |
| Ciphertext Expansion | 2× Expansion: 2 ciphertext integers (c1, c2) per block | 1× Expansion: 1 ciphertext integer per block |
| Cipher Nature | Randomized / Probabilistic (ephemeral k) |
Deterministic (requires OAEP padding) |
| Ephemeral Key Hazard | Reusing k completely compromises plaintext |
No ephemeral key in standard RSA |
The RSA Digital Signature Scheme is an asymmetric cryptographic mechanism providing authenticity, data integrity, and non-repudiation. Built on the mathematical foundations of the RSA algorithm, it inverts the traditional encryption paradigm: only the private key holder can create a signature, whereas any party holding the signer's public key can verify its validity. Under the modern Hash-then-Sign paradigm, the signer signs a fixed-length cryptographic hash digest h = H(M) rather than the raw message, eliminating existential forgery and ensuring computational efficiency.
Signer (Alice) Verifier (Bob)
+-------------------------+ +-------------------------+
| Message M | | Received (M, S) |
+------------+------------+ +----+---------------+----+
| | |
v v v
[ Cryptographic Hash ] [ Same Hash H ] [ RSA Verification ]
h = H(M) h' = H(M) h_rec = S^e mod n
| | |
v | |
[ RSA Signing Op ] | |
S = h^d mod n v v
| +-------------------------------+
v | Compare: h' == h_rec ? |
Transmit (M, S) ------------------------------>| YES: Signature ACCEPTED |
| NO: Signature REJECTED |
+-------------------------------+
p and q.
n = p × q and Euler's totient φ(n) = (p - 1)(q - 1).
e such that 1 < e < φ(n) and gcd(e, φ(n)) = 1 (typically e = 65537).
d ≡ e-1 (mod φ(n)) using the Extended Euclidean Algorithm.
VK = (e, n); Private Signing Key is SK = (d, n).M using a secure hash function (e.g., SHA-256): h = H(M).
S using private exponent d:
S ≡ hd (mod n).
(M, S) is transmitted to the verifier.(M', S') and obtains authentic public key (e, n).
h' = H(M').
e:
hrec ≡ (S')e ≡ (hd)e ≡ hed ≡ hkφ(n)+1 ≡ h (mod n).
hrec == h', signature is authenticated (valid); otherwise, it is rejected.Raw ("textbook") RSA signatures are vulnerable to mathematical attacks such as multiplicative forgery (where S1 × S2 = (M1 × M2)d). Modern implementations mandate RSA-PSS (Probabilistic Signature Scheme, PKCS#1 v2.2), which adds randomized salt and masking to achieve provable cryptographic security.
| Security Dimension | Textbook RSA Signature | Standard RSA-PSS (RFC 8017) |
|---|---|---|
| Input Formulation | Raw unpadded message / digest | Cryptographic hash with randomized salt & mask |
| Homomorphic Attack | Vulnerable to algebraic manipulation | Provably secure: immune to chosen-message forgery |
| Verification Speed | Fast (small public exponent e = 65537) |
Fast (small public exponent e = 65537) |
| Standard Deployment | Insecure / Deprecated | Industry standard in TLS 1.3, S/MIME, X.509 PKI |
The Transport Layer Security (TLS) Handshake Protocol (RFC 5246 / RFC 8446) is the primary control protocol in the TLS framework, executing above TCP before any application data is transferred. It is responsible for three core security objectives: algorithm negotiation (agreeing on protocol version and Cipher Suite), mutual or server authentication (validating X.509 public-key certificates), and secure key establishment (generating shared session secrets while resisting eavesdropping and man-in-the-middle attacks).
Client Server
| |
| --------------------- 1. ClientHello ---------------------------> | Phase 1:
| | Capabilities
| <-------------------- 2. ServerHello ---------------------------- | Negotiation
| <-------------------- 3. Certificate ---------------------------- |
| <-------------------- 4. ServerKeyExchange (Optional) ----------- | Phase 2:
| <-------------------- 5. CertificateRequest (Optional) ---------- | Server Auth &
| <-------------------- 6. ServerHelloDone ------------------------ | Key Exchange
| |
| --------------------- 7. Certificate (Optional) ----------------> |
| --------------------- 8. ClientKeyExchange ---------------------> | Phase 3:
| --------------------- 9. CertificateVerify (Optional) ----------> | Client Auth &
| -------------------- 10. ChangeCipherSpec ----------------------> | Pre-Master Secret
| -------------------- 11. Finished (Encrypted) ------------------> |
| |
| <------------------- 12. ChangeCipherSpec ----------------------- | Phase 4:
| <------------------- 13. Finished (Encrypted) ------------------- | Switch to Encrypted
| | Session
|<=================== Secure Application Data Flow ================>|
ClientHello: Client transmits highest supported TLS version, 32-byte ClientRandom (RC), Session ID, and supported Cipher Suites (e.g., TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256).
ServerHello: Server selects protocol version, sends 32-byte ServerRandom (RS), and picks the active Cipher Suite.Certificate: Server provides its X.509 digital certificate chain containing its public key.
ServerKeyExchange: Sent if ephemeral Diffie–Hellman key exchange is chosen, containing signed DH parameters.
CertificateRequest: (Optional) Sent if server requires mutual client authentication.
ServerHelloDone: Signals completion of the server's hello phase.Certificate: (Optional) Client sends its X.509 certificate if requested.
ClientKeyExchange: Client sends key material. For RSA, client generates a 48-byte Pre-Master Secret (PMS) encrypted with server's public key; for ECDHE, it sends ephemeral public DH parameters.
CertificateVerify: (Optional) Signs previous handshake messages with client private key to prove ownership.
ChangeCipherSpec: Notifies server that subsequent packets will be encrypted under negotiated session keys.
Finished: First encrypted verification message containing a MAC of all prior exchanges.MS = PRF(PMS, "master secret", RC || RS).
MS, encryption keys, MAC keys, and IVs are derived.
ChangeCipherSpec and an encrypted Finished message, after which secure application traffic begins.| Handshake Phase | Primary Messages Exchanged | Cryptographic Objective | Generated Parameter |
|---|---|---|---|
| Phase 1: Capabilities | ClientHello, ServerHello |
Cipher suite & protocol version negotiation | ClientRandom, ServerRandom |
| Phase 2: Server Auth | Certificate, ServerKeyExchange, ServerHelloDone |
Authenticate server identity & provide DH parameters | Server public key, Server DH parameters |
| Phase 3: Client Key | ClientKeyExchange, ChangeCipherSpec, Finished |
Deliver Pre-Master Secret (PMS) & verify key derivation | Pre-Master Secret (PMS), Client Handshake Hash |
| Phase 4: Completion | ChangeCipherSpec, Finished |
Switch to symmetric authenticated encryption | Master Secret (MS), Symmetric Session Keys |
In modular matrix arithmetic and polygraphic ciphers (such as the Hill Cipher), computing the modular inverse of a key matrix M modulo 26 is required to decrypt ciphertext blocks into plaintext (P = C · M-1 mod 26).
For a 2 × 2 matrix M = [[a, b], [c, d]], the modular inverse M-1 exists if and only if:
The matrix inverse formula is: M-1 = det(M)-1 · adj(M) mod 26, where adj(M) = [[d, −b], [−c, a]] mod 26.
Given Matrix M = [[3, 3], [2, 5]]
|
v
[Step 1: Compute Determinant] -----> det(M) = (3*5) - (3*2) = 15 - 6 = 9
|
v
[Step 2: Test Invertibility] ------> gcd(9, 26) = 1 (Coprime, Inverse Exists)
|
v
[Step 3: Multiplicative Inverse] --> 9 * d = 1 (mod 26) ==> det(M)^-1 = 3
|
v
[Step 4: Formulate Adjugate] ------> adj(M) = [[5, -3], [-2, 3]] = [[5, 23], [24, 3]] (mod 26)
|
v
[Step 5: Scalar Modulo Product] ---> M^-1 = 3 * adj(M) = [[15, 69], [72, 9]] = [[15, 17], [20, 9]] (mod 26)
|
v
[Step 6: Mathematical Proof] ------> M * M^-1 = [[105, 78], [130, 79]] = [[1, 0], [0, 1]] = I (mod 26)
| Calculation Stage | Mathematical Formula | Intermediate Value | Modulo 26 Result | Cryptographic Role |
|---|---|---|---|---|
| Determinant det(M) | ad − bc = (3)(5) − (3)(2) | 15 − 6 = 9 | 9 | Validates non-singularity |
| Coprimality Test | gcd(det(M), 26) | gcd(9, 26) | 1 | Confirms matrix is invertible in ℤ26 |
| Modular Inverse det-1 | 9 · x ≡ 1 mod 26 | Extended Euclid | 3 | Scalar factor for adjugate matrix |
| Adjugate Matrix adj(M) | [[d, −b], [−c, a]] | [[5, −3], [−2, 3]] | [[5, 23], [24, 3]] | Transpose of cofactor matrix |
| Inverse Matrix M-1 | det-1 · adj(M) | [[15, 69], [72, 9]] | [[15, 17], [20, 9]] | Decryption key for Hill cipher blocks |
| Identity Verification | M · M-1 mod 26 | [[105, 78], [130, 79]] | [[1, 0], [0, 1]] | Confirms exact decipherability |
In network security architecture (formalized under ITU-T Recommendation X.800 and RFC 4949), security threats are categorized into Passive Attacks and Active Attacks based on their interaction with communications channels and system resources:
+-----------------------------------------------------------------------------------+
| Taxonomy of Active Network Attacks |
+-----------------------------------------------------------------------------------+
| 1. Masquerade (Identity Spoofing) |
| [Attacker Eve] ======(Forged Credentials / IP)======> [Target Server] |
| (Eve fraudulently adopts Alice's privileged identity to gain unauthorized access) |
| |
| 2. Replay Attack |
| [Alice] ---(Auth Token)---> [Eve Intercepts & Stores] |
| | |
| +====(Retransmit Token Later)===> [Bank] |
| |
| 3. Modification of Messages |
| [Alice] ----("Pay $100 to Bob")----> [Eve Alters] |
| | |
| +----("Pay $10,000 to Eve")--> [Bank]
| |
| 4. Denial of Service (DoS / DDoS) |
| [Botnet Zombies] ======(SYN Flood / Volumetric Traffic)======> [Target Host] |
| (Target server buffers saturate; legitimate service requests are dropped) |
+-----------------------------------------------------------------------------------+
{"Item": "Insulin", "Qty": 10} to {"Item": "Insulin", "Qty": 500} before forwarding it. Countered via HMAC and digital signatures.
| Attack Category | Compromised Goal | Modus Operandi | Real-World Scenario | Primary Countermeasure |
|---|---|---|---|---|
| Masquerade | Authenticity & Access Control | Faking credentials, ARP/IP headers, or tokens | IP spoofing to bypass perimeter firewall access lists | Multi-Factor Authentication (MFA), Mutual TLS, 802.1X |
| Replay Attack | Integrity & Freshness | Sniffing valid auth packets and retransmitting later | Retransmitting captured e-banking fund transfer packets | Cryptographic Nonces, Session Timestamps, Sequence Numbers |
| Modification | Data Integrity & Authenticity | Splicing, altering, or delaying payload data | Man-in-the-Middle alteration of transaction values | Hash-based Message Authentication Codes (HMAC), Digital Signatures |
| Denial of Service | System Availability | Flooding system resources, buffers, or bandwidth | TCP SYN Flooding or DNS Amplification DDoS attack | SYN Cookies, Rate Limiting, Anycast Scrubbing Centers, WAF |
The Vigenère Cipher, formulated by Giovan Battista Bellaso in 1553 and later attributed to Blaise de Vigenère, is a classic polyalphabetic substitution cipher:
Plaintext Block (L = 10) : D A T A S E C U R E
Plaintext Numeric (0..25) : 3 0 19 0 18 4 2 20 17 4
+ + + + + + + + + +
Repeating Key "MATH" : M A T H M A T H M A
Key Numeric (0..25) : 12 0 19 7 12 0 19 7 12 0
= = = = = = = = = =
Sum Modulo 26 : 15 0 12 7 4 4 21 1 3 4
Ciphertext Letters : P A M H E E V B D E
Given Plaintext P = DATASECURE (length N = 10), Keyword K = MATH (length m = 4). Repeating keyword generates keystream: MATHMATHMA.
Encryption Process (Ci = (Pi + Ki) mod 26):
Generated Ciphertext: PAMHEEVBDE
Decryption Process (Pi = (Ci − Ki + 26) mod 26):
Recovered Plaintext: DATASECURE
| Index i | Plaintext Pi | Pi Val | Key Ki | Ki Val | Encryption (Pi + Ki) mod 26 | Ciphertext Ci | Decryption (Ci − Ki + 26) mod 26 | Recovered Pi |
|---|---|---|---|---|---|---|---|---|
| 0 | D | 3 | M | 12 | (3 + 12) = 15 | P | (15 − 12) = 3 | D |
| 1 | A | 0 | A | 0 | (0 + 0) = 0 | A | (0 − 0) = 0 | A |
| 2 | T | 19 | T | 19 | (19 + 19) mod 26 = 12 | M | (12 − 19 + 26) = 19 | T |
| 3 | A | 0 | H | 7 | (0 + 7) = 7 | H | (7 − 7) = 0 | A |
| 4 | S | 18 | M | 12 | (18 + 12) mod 26 = 4 | E | (4 − 12 + 26) = 18 | S |
| 5 | E | 4 | A | 0 | (4 + 0) = 4 | E | (4 − 0) = 4 | E |
| 6 | C | 2 | T | 19 | (2 + 19) = 21 | V | (21 − 19) = 2 | C |
| 7 | U | 20 | H | 7 | (20 + 7) mod 26 = 1 | B | (1 − 7 + 26) = 20 | U |
| 8 | R | 17 | M | 12 | (17 + 12) mod 26 = 3 | D | (3 − 12 + 26) = 17 | R |
| 9 | E | 4 | A | 0 | (4 + 0) = 4 | E | (4 − 0) = 4 | E |
Cryptanalytic Note: Although historically considered unbreakable (le chiffre indéchiffrable), Charles Babbage and Friedrich Kasiski (1863) cracked Vigenère by identifying repeated ciphertext n-grams to deduce keyword length m, reducing it to m monoalphabetic Caesar ciphers solved via frequency analysis. William Friedman later formalized key-length deduction using the Index of Coincidence (IC).
The Feistel Cipher Structure, designed by IBM cryptographer Horst Feistel in the early 1970s (originating in Lucifer and standardized in DES), is an architectural framework for designing symmetric block ciphers:
Input Block (2w bits)
|
+--------+--------+
| |
v v
Left Half L_{i-1} Right Half R_{i-1}
| |
| |--------+
| | |
| v v
| +--------------+
| | Round Fxn F | <--- Round Key K_i
| | F(R, K) |
| +--------------+
| |
v |
( + ) <-----------------+ (Bitwise XOR)
|
| |
+----------+----------+
| (Cross Swap)
x
+----------+----------+
| |
v v
L_i = R_{i-1} R_i = L_{i-1} XOR F(R_{i-1}, K_i)
Input Parameters: Input Block = 1010 0110 (8 bits total); Left Half L0 = 1010, Right Half R0 = 0110; Round Subkey K1 = 0011; Round Function F(R, K) = R ⊕ K.
Step-by-Step Computational Round Execution:
0110 ⊕ 0011
01012
01102
1010 ⊕ 0101
11112
0110 11112
0110, R1 = 1111) with subkey K1 = 0011:
01102
1111 ⊕ (0110 ⊕ 0011) = 1111 ⊕ 0101 = 10102
1010 01102 perfectly.
| Design Parameter | Cryptographic Significance | Standard Practical Value (e.g., DES) | Impact on Security and Performance |
|---|---|---|---|
| Block Size (2w) | Granularity of data processed per cycle | 64 bits (DES), 128 bits (Twofish) | Larger block sizes prevent codebook and birthday attacks, slightly slowing execution. |
| Key Size | Cryptographic strength against brute force | 56 bits (DES), 128/256 bits (Modern) | Larger key size increases work factor (2k) to prevent exhaustive search attacks. |
| Number of Rounds (n) | Multiplicity of confusion/diffusion iterations | 16 rounds (DES), 16–32 rounds (Blowfish) | More rounds resist differential and linear cryptanalysis; 16 rounds is standard. |
| Subkey Generation | Key scheduling complexity | 48-bit subkeys generated per round | Highly complex key schedules increase resistance against slide and related-key attacks. |
| Round Function F | Engine of non-linearity and bit permutation | S-boxes + P-boxes | Greater complexity and avalanche properties yield higher cryptanalytic resistance. |
| Symmetric HW/SW | Execution efficiency across hardware/software | Identical encryption/decryption logic | Minimizes gate count on VLSI chips and instruction footprint in software. |
Elliptic Curve Cryptography (ECC), proposed independently by Neal Koblitz and Victor S. Miller in 1985, is an advanced public-key cryptosystem based on the algebraic structure of elliptic curves defined over finite fields:
y2 ≡ x3 + ax + b mod p
together with an ideal point at infinity 𝒪 serving as the group additive identity element.4a3 + 27b2 ≢ 0 mod p
This ensures the cubic polynomial has distinct roots, guaranteeing the curve has no cusps or self-intersections, so a unique tangent line exists at every point. y ^
| .---.
| / \ Curve: y^2 = x^3 + ax + b
| / \
P *-------/---------\------------------ Secant Line through P, Q
| \ / \
| \ / \
| \/ * Q
------------------+----+----------------\------------------> x
| \ \
| \ * -R (Third intersection point)
| \ |
| \ | (Vertical Reflection across x-axis)
| \ v
| \ * R = P + Q
| '---'
| Feature Dimension | Elliptic Curve Cryptography (ECC) | Rivest-Shamir-Adleman (RSA) | Architectural Advantage of ECC |
|---|---|---|---|
| Mathematical Problem | Elliptic Curve Discrete Logarithm (ECDLP) | Integer Factorization Problem (IFP) | ECDLP has no sub-exponential attack algorithms |
| NIST Equivalent Key Size | 256 bits | 3072 bits | 12x reduction in key length for identical security |
| High Security Key Size | 384 bits | 7680 bits | 20x key size savings at ultra-high security levels |
| Computational Overhead | Low processing power; fast scalar ops | High processing power; large modular exp | Ideal for constrained IoT, smartcards, and mobile |
| Bandwidth & Storage | Extremely compact signatures and keys | Large certificates, signatures, and keys | Reduces network payload and handshake latency |
| Power Consumption | Minimal battery drain | Significant battery and CPU utilization | Essential for battery-operated wireless devices |
Pretty Good Privacy (PGP), created by Phil Zimmermann in 1991 and standardized by the IETF under RFC 4880 (OpenPGP), is a hybrid cryptosystem providing end-to-end confidentiality, data integrity, non-repudiation, and authentication for email and file storage:
+---------------------------------------------------------------------------------------------------+
| PGP PRIVATE KEY RING |
+---------------------+-------------+------------------+-----------------------------+--------------+
| Timestamp | Key ID | Public Key | Encrypted Private Key | User ID |
| (Creation Date/Time)| (Low 64-bit)| (RSA/DSA/ECDSA) | (Symmetric Encrypted via PW)| (Name & Mail)|
+---------------------+-------------+------------------+-----------------------------+--------------+
+---------------------------------------------------------------------------------------------------+
| PGP PUBLIC KEY RING |
+-------------+--------+------------+-------------+---------+---------------+-------------+---------+
| Timestamp | Key ID | Public Key | Owner Trust | User ID | Key Signatures| Sig Trust | Key Leg |
| (Entry date)| (64-bit|(Public Key | (Assigned by|(Email & | (Certifying | (Trust in | (Trust |
| | of Pub)| parameters)| local user) | Name) | signatures) | signer) | Score) |
+-------------+--------+------------+-------------+---------+---------------+-------------+---------+
Alice <alice@example.com>).| Architectural Dimension | PGP Private Key Ring | PGP Public Key Ring |
|---|---|---|
| Purpose | Stores local user's own key pairs | Stores public keys of communicating associates |
| Confidentiality Level | High sensitivity; private keys are passphrase-encrypted | Public data; keys are unencrypted and shareable |
| Trust Evaluation | Not applicable (local owner is implicitly trusted) | Dynamic calculation of Key Legitimacy via Web of Trust |
| Lookup Mechanism | Indexed by 64-bit Key ID to decrypt incoming session keys | Indexed by User ID or Key ID to encrypt and verify |
| Database Operations | Rare additions (only when generating new key pairs) | Frequent additions (importing contacts' public keys) |
Standardized by the IETF in RFC 4301, Internet Protocol Security (IPsec) is a comprehensive suite of cryptographic protocols operating at the Network Layer (OSI Layer 3) of the TCP/IP protocol stack:
Original IP Packet:
+-------------------+----------------------+---------------------------+
| Original IP Header| Transport Header | Application Data Payload |
| (Src: A, Dst: B) | (TCP / UDP) | |
+-------------------+----------------------+---------------------------+
ESP Transport Mode Packet:
+-------------------+------------+-------------------+-----------------+-------------+-----------+
| Original IP Header| ESP Header | TCP / UDP Header | Application Data| ESP Trailer | ESP Auth |
+-------------------+------------+-------------------+-----------------+-------------+-----------+
|<- SPI, Seq |<------------- ENCRYPTED ----------->| Pad, NextHdr|<-- MAC ---|
|<---------------------- AUTHENTICATED ------------------------->|
ESP Tunnel Mode Packet:
+---------------+------------+-------------------+------------+-----------------+-------------+-----------+
| New IP Header | ESP Header | Original IP Header| TCP Header | Application Data| ESP Trailer | ESP Auth |
| (GateA->GateB)| (SPI, Seq) | (HostA -> HostB) | (Port) | (Payload) | | (MAC/ICV) |
+---------------+------------+-------------------+------------+-----------------+-------------+-----------+
|<---------------------- ENCRYPTED ---------------->|
|<------------------------------- AUTHENTICATED ---------------->|
| Evaluation Dimension | IPsec Transport Mode | IPsec Tunnel Mode |
|---|---|---|
| Typical Deployment | End-to-end host-to-host communications | Site-to-site VPNs & Remote access client-to-gateway |
| Protected Portion | Upper-layer payload only (TCP/UDP + Data) | Entire original IP packet (Header + Payload) |
| IP Header Handling | Preserves original IP header intact | Encapsulates original header; adds New Outer IP Header |
| IP Address Privacy | None; source & destination IPs exposed to routers | High; internal IP addresses hidden behind gateway IPs |
| Packet Overhead | Minimal (only ESP header, trailer, and ICV added) | Higher (adds 20-byte New IP Header plus ESP fields) |
| Host Configuration | Every participating host must run IPsec software | Executed entirely by boundary security gateways |
| NAT Traversal (NAT-T) | Challenging; original TCP/IP checksums break | Handled seamlessly via UDP encapsulation (port 4500) |
| Processing Overhead | Lower CPU overhead on endpoints | Centralized cryptographic processing on VPN gateways |
A linear Diophantine equation ax + by = c with integer coefficients has integer solutions if and only if d = gcd(a, b) divides c (d | c).
For 21x + 14y = 35, we compute gcd(21, 14) via Euclidean algorithm:
21 = 1 × 14 + 7
14 = 2 × 7 + 0 ⇒ d = gcd(21, 14) = 7
Since 35 / 7 = 5, 7 | 35 holds true. Thus, the equation possesses infinitely many integer solutions.
Dividing by d = 7 yields coprime equation 3x + 2y = 5, where gcd(3, 2) = 1.
Extended Euclidean Algorithm gives: 3(1) + 2(-1) = 1.
Multiplying by 5 gives 3(5) + 2(-5) = 5.
By inspection, setting x = 1 yields 3(1) + 2(1) = 5.
(x0, y0) = (1, 1)21(1) + 14(1) = 21 + 14 = 35
For 3x + 2y = 5 and base solution (1, 1), the general solution for parameter t ∈ ℤ is:
x(t) = x0 + (b / d)t = 1 + 2ty(t) = y0 - (a / d)t = 1 - 3t
Proof: 21(1 + 2t) + 14(1 - 3t) = 21 + 42t + 14 - 42t = 35. Parameter t cancels identically, confirming all integer pairs are valid solutions.
| Parameter | x = 1 + 2t | y = 1 - 3t | Evaluation: 21x + 14y |
|---|---|---|---|
| t = -1 | -1 | 4 | 21(-1) + 14(4) = 35 |
| t = 0 | 1 | 1 | 21(1) + 14(1) = 35 (Base Solution) |
| t = 1 | 3 | -2 | 21(3) + 14(-2) = 35 |
| t = 2 | 5 | -5 | 21(5) + 14(-5) = 35 |
A square matrix A has a multiplicative inverse A-1 if and only if its determinant is non-zero (det(A) ≠ 0). When det(A) = 1, the matrix is unimodular, ensuring its inverse contains purely integer entries without modular fraction division.
A = [ [2, 1],
[1, 1] ]
Determinant Calculation: det(A) = (ad - bc) = (2 × 1) - (1 × 1) = 2 - 1 = 1.
Since det(A) = 1 ≠ 0, matrix A is non-singular and strictly invertible across ℝ, ℤ, and ℤ26.
By classical matrix inversion theory: A-1 = (1 / det(A)) × adj(A).
For a 2×2 matrix, the adjugate matrix swaps main diagonal elements and negates off-diagonal elements:
adj(A) = [ [ d, -b],
[-c, a] ] = [ [ 1, -1],
[-1, 2] ]
Substituting det(A) = 1:
A-1 = (1 / 1) × [[1, -1], [-1, 2]] = [[1, -1], [-1, 2]].
Correctness requires confirming that both products yield identity matrix I2:
[[2, 1], [1, 1]] × [[1, -1], [-1, 2]] = [[2 - 1, -2 + 2], [1 - 1, -1 + 2]] = [[1, 0], [0, 1]] = I2.[[1, -1], [-1, 2]] × [[2, 1], [1, 1]] = [[2 - 1, 1 - 1], [-2 + 2, -1 + 2]] = [[1, 0], [0, 1]] = I2.
Both products strictly evaluate to I2, validating the calculated inverse.
| Property | Value | Cryptographic Role |
|---|---|---|
| Determinant | det(A) = 1 | Unit determinant avoids fraction reduction; preserves discrete lattice volume. |
| Inverse Matrix | [[1, -1], [-1, 2]] | Acts as the exact decryption transformation in polygraphic block ciphers. |
| Modulo 26 Role | gcd(1, 26) = 1 | Invertible in Z26; enables Hill cipher decipherment without scaling factors. |
Triple DES (TDEA / 3DES, ANSI X9.52, NIST SP 800-67) was developed to remediate standard DES vulnerabilities caused by its 56-bit key space. Double DES was rejected because Diffie and Hellman proved it vulnerable to Meet-in-the-Middle (MitM) attacks, reducing security from 2112 to 257 operations.
To defeat MitM attacks while maintaining backward compatibility, 3DES uses an Encrypt-Decrypt-Encrypt (EDE) sequence:
C = EK3(DK2(EK1(P)))P = DK1(EK2(DK3(C)))K1 = K2 = K3, the middle decryption cancels the first encryption (EK(DK(EK(P))) = EK(P)), executing single DES.Two-Key Triple DES (EDE2 - 112 bits, Keys: K1, K2, K1):
P ──▶ [DES Encrypt K1] ──▶ [DES Decrypt K2] ──▶ [DES Encrypt K1] ──▶ C
C ──▶ [DES Decrypt K1] ──▶ [DES Encrypt K2] ──▶ [DES Decrypt K1] ──▶ P
Three-Key Triple DES (EDE3 - 168 bits, Keys: K1, K2, K3):
P ──▶ [DES Encrypt K1] ──▶ [DES Decrypt K2] ──▶ [DES Encrypt K3] ──▶ C
C ──▶ [DES Decrypt K3] ──▶ [DES Encrypt K2] ──▶ [DES Decrypt K1] ──▶ P
K3 = K1 (112 key bits). Advanced chosen-plaintext attacks reduce effective security to ~80 bits. Deprecated by NIST after 2015.K1 ≠ K2 ≠ K3 (168 key bits). MitM attacks require 2112 operations, providing 112-bit effective security.232 blocks (~32 GB) risks Sweet32 collision attacks, prompting replacement by AES.| Parameter | Single DES | Two-Key 3DES (EDE2) | Three-Key 3DES (EDE3) | AES-128 |
|---|---|---|---|---|
| Key Length | 56 bits | 112 bits | 168 bits | 128 bits |
| Effective Security | 56 bits (Insecure) | ~80 bits (Deprecated) | 112 bits (Legacy) | 128 bits (Secure) |
| Block Size | 64 bits | 64 bits | 64 bits | 128 bits |
| Internal Rounds | 16 Feistel rounds | 48 Feistel rounds | 48 Feistel rounds | 10 SPN rounds |
| NIST Status | Withdrawn (1999) | Deprecated (2015) | Retired (2023) | Active Standard |
Invented by Lester S. Hill in 1929, the Hill Cipher is a polygraphic substitution cipher that encrypts blocks of letters simultaneously using modular linear algebra over ℤ26. Letters are mapped using standard indexing: A = 0, B = 1, C = 2, …, Z = 25.
C = (K × P) mod 26, where P is a plaintext vector and K is an invertible key matrix.P = (K-1 × C) mod 26, requiring modular inverse matrix K-1.K is invertible modulo 26 if and only if gcd(det(K), 26) = 1.
Given key matrix K = [[3, 3], [2, 5]]. Evaluating determinant:
det(K) = (3 × 5) - (3 × 2) = 15 - 6 = 9.
Since gcd(9, 26) = 1, K is invertible in ℤ26. Finding modular multiplicative inverse of 9 modulo 26:
9d ≡ 1 (mod 26) ⇒ 9 × 3 = 27 = (1 × 26) + 1 ≡ 1 (mod 26) ⇒ det(K)-1 = 3 (mod 26).
adj(K) = [ [ 5, -3],
[-2, 3] ] ≡ [ [ 5, 23],
[24, 3] ] (mod 26)
K^-1 = 3 × [ [ 5, 23],
[24, 3] ] = [ [15, 69],
[72, 9] ] ≡ [ [15, 17],
[20, 9] ] (mod 26)
Verification: K × K-1 = [[3, 3], [2, 5]] × [[15, 17], [20, 9]] = [[105, 78], [130, 79]] ≡ [[1, 0], [0, 1]] (mod 26).
Numerical mapping: H → 7, I → 8 ⇒ P = [[7], [8]].
C = (K × P) mod 26 = [ [3, 3], × [ [7],
[2, 5] ] [8] ] (mod 26)
c1 = (3 × 7) + (3 × 8) = 21 + 24 = 45 ≡ 45 - 26 = 19 (mod 26) → T
c2 = (2 × 7) + (5 × 8) = 14 + 40 = 54 ≡ 54 - 52 = 2 (mod 26) → C
Ciphertext Output: "TC".
Numerical mapping: T → 19, C → 2 ⇒ C = [[19], [2]].
P = (K^-1 × C) mod 26 = [ [15, 17], × [ [19],
[20, 9] ] [ 2] ] (mod 26)
p1 = (15 × 19) + (17 × 2) = 285 + 34 = 319 ≡ 319 - 312 = 7 (mod 26) → H
p2 = (20 × 19) + (9 × 2) = 380 + 18 = 398 ≡ 398 - 390 = 8 (mod 26) → I
Recovered Plaintext: "HI" (exact polygraphic reconstruction verified).
Introduced by Michael O. Rabin in 1979, the Rabin cryptosystem is an asymmetric scheme based on modular squaring (quadratic residues). It is provably equivalent to integer factorization: solving c ≡ m2 (mod n) without prime factors is computationally identical to factoring n = pq. Unlike RSA, Rabin's factoring equivalence is mathematically proven. Encryption requires a single modular squaring, but decryption produces four ambiguous roots requiring disambiguation.
KeyGen: Primes p, q ≡ 3 (mod 4) ──▶ Public: n = pq, Private: (p, q)
Encryption: Message m (with redundancy) ──▶ c = m^2 mod n ──▶ Ciphertext c
Decryption: c ──▶ Roots mod p, q ──▶ Chinese Remainder Theorem ──▶ 4 Roots ──▶ Plaintext m
p, q with p ≡ 3 (mod 4) and q ≡ 3 (mod 4).n = p × q.n; Private Key is (p, q).m (m = data || redundancy).c = m2 mod n.O(k2)).p and q: mp = c(p+1)/4 mod p, mq = c(q+1)/4 mod q.yp × p + yq × q = 1.n via Chinese Remainder Theorem:
r1 = (yp × p × mq + yq × q × mp) mod n, r2 = n - r1,
r3 = (yp × p × mq - yq × q × mp) mod n, r4 = n - r3.m.| Feature | Rabin | RSA | ElGamal |
|---|---|---|---|
| Hard Problem | Quadratic Residues / Factoring | RSA Problem | Discrete Logarithm |
| Factoring Equivalence | Provably equivalent | Not proven | Unrelated |
| Encryption Speed | Ultrafast (1 squaring) | Fast (e = 65537) | Slow (2 exponentiations) |
| Decryption Mapping | 4-to-1 (requires padding) | 1-to-1 bijection | 1-to-1 bijection |
The Secure Hash Algorithm (SHA) family includes cryptographic hash standards developed by NIST under FIPS PUB 180 and FIPS PUB 202. Hash functions compress arbitrary-length inputs into fixed-length digests, satisfying three properties:
h to find original message m.m2 ≠ m1 producing identical digest H(m1).m1, m2 with identical digest.Merkle-Damgård (SHA-0, SHA-1, SHA-2):
Message ──▶ [Pad & Split Blocks] ──▶ [Compression f (IV)] ──▶ [f] ──▶ Fixed Digest
Sponge Construction (SHA-3 / Keccak):
Message ──▶ [Pad & Split Blocks] ──▶ [XOR with Rate r] ──▶ [Keccak-f] ──▶ [Extract Digest]
263.1 operations). Completely deprecated.Ch, Maj) and rotations (Σ, σ). Fully secure.| Algorithm | Digest | Block Size | Word Size | Rounds | Collision Status |
|---|---|---|---|---|---|
| SHA-0 | 160 bits | 512 bits | 32 bits | 80 | Broken (Withdrawn 1995) |
| SHA-1 | 160 bits | 512 bits | 32 bits | 80 | Broken (Collided 2017) |
| SHA-256 | 256 bits | 512 bits | 32 bits | 64 | Fully Secure (Standard) |
| SHA-512 | 512 bits | 1024 bits | 64 bits | 80 | Fully Secure (High Assurance) |
| SHA3-256 | 256 bits | 1088 bits (rate) | 64 bits | 24 | Fully Secure (Sponge) |
Public-Key Infrastructure (PKI), defined under ITU-T Recommendation X.509 and RFC 5280, is an integrated system of hardware, software, policies, and cryptographic protocols that creates, manages, distributes, and revokes digital certificates. Asymmetric cryptography lacks inherent ownership proof, risking man-in-the-middle impersonation. PKI solves this by binding public keys to verified entities (users, servers, organizations) through digitally signed X.509 certificates.
┌───────────────────────────┐
│ Root CA │ (Self-signed Trust Anchor)
└─────────────┬─────────────┘
│ Issues Intermediate Cert
▼
┌───────────────────────────┐
│ Intermediate CA │ (Operational Signer)
└──────┬─────────────┬──────┘
1. CSR Request │ │ Issues Cert
┌───────────────┘ ▼
▼ ┌───────────┐
┌─────────────┐ │ Repository│ ◀── CRL / OCSP Updates
│ RA │ │(LDAP/HTTP)│
└──────┬──────┘ └─────┬─────┘
│ 2. Verify Identity │ 5. Validate Path
▼ ▼
[End Entity / Server] ────────▶ [Relying Party / Browser]
(Subscriber) 4. Present Cert (TLS)
| Lifecycle Stage | Responsible Entity | Core Procedure | Security Control |
|---|---|---|---|
| 1. Key Generation | Subscriber | Generates asymmetric key pair; creates CSR (PKCS#10). | Private key never leaves secure local storage (HSM/TPM). |
| 2. Identity Vetting | Registration Authority | Vets applicant identity and domain control. | Prevents unauthorized spoofing and fraudulent issuance. |
| 3. Certificate Signing | Certificate Authority | Binds identity with public key and signs with CA private key. | CA signature guarantees tamper-proof authenticity. |
| 4. Chain Validation | Relying Party | Validates hierarchical signatures recursively up to Root CA. | Cryptographic signature chain establishes trust. |
| 5. Revocation Check | Relying Party / OCSP | Queries OCSP or checks CRL for revoked status. | Immediate termination of trust for compromised keys. |
[Given: (1) x + y = 1 (mod 5) and (2) 2x + y = 4 (mod 5)]
|
v
[Subtract Eq (1) from Eq (2)] ----> (2x + y) - (x + y) = 4 - 1 mod 5
|
v
[Eliminates y] ------> x = 3 mod 5 ===> x ≡ 3 (mod 5)
|
v
[Back-Substitute x=3 in Eq (1)] --> 3 + y = 1 mod 5
|
v
[Solve for Residue y] --------> y = -2 = 3 mod 5 ===> y ≡ 3 (mod 5)
|
v
[Verification in System] ---------> 3 + 3 = 6 ≡ 1 (mod 5) [TRUE]
2(3) + 3 = 9 ≡ 4 (mod 5) [TRUE]
The complete integer solution family across ℤ is given parametrically by x = 3 + 5k1 and y = 3 + 5k2 for all k1, k2 ∈ ℤ.
| Equation | Substitution (x = 3, y = 3) | Modular Evaluation | Target Value | Status |
|---|---|---|---|---|
| (1) x + y ≡ 1 (mod 5) | 3 + 3 = 6 | 6 mod 5 = 1 ⇒ 6 ≡ 1 | 1 | Verified |
| (2) 2x + y ≡ 4 (mod 5) | 2(3) + 3 = 9 | 9 mod 5 = 4 ⇒ 9 ≡ 4 | 4 | Verified |
| Inverse Check: A−1b | [4, 1; 2, 4] × [1; 4] mod 5 | [8; 18] mod 5 = [3; 3] | [3; 3] | Unique |
Plaintext: D(3) A(0) T(19) A(0)
| | | |
Multiply (x 5): 15 0 95 0
Add Shift (+ 8): 23 8 103 8
Modulo 26: 23 8 25 8
Ciphertext: X(23) I(8) Z(25) I(8) ===> "XIZI"
===========================================
Inverse Key Derivation: 5^-1 = 21 mod 26 (since 5 * 21 = 105 = 4*26 + 1 ≡ 1)
Subtract Shift (- 8): 15 0 17 0
Multiply (x 21): 315 0 357 0
Modulo 26: 3 0 19 0
Decrypted Plaintext: D(3) A(0) T(19) A(0) ===> "DATA"
| Plaintext | P | (5P + 8) | C = Mod 26 | Ciphertext | (C − 8) | 21(C − 8) | Mod 26 | Decrypted |
|---|---|---|---|---|---|---|---|---|
| D | 3 | 23 | 23 | X | 15 | 315 | 3 | D |
| A | 0 | 8 | 8 | I | 0 | 0 | 0 | A |
| T | 19 | 103 | 25 | Z | 17 | 357 | 19 | T |
| A | 0 | 8 | 8 | I | 0 | 0 | 0 | A |
Initial Key: W[0] W[1] W[2] W[3] (Round 0 Key)
| | | |
v v v v
+-------+ +-------+ +-------+ +-------+
| W[i-4]| | W[i-3]| | W[i-2]| | W[i-1]|
+---+---+ +---+---+ +---+---+ +---+---+
| |
| For i % 4 == 0: v
| +---------+
| | RotWord | [b0,b1,b2,b3] -> [b1,b2,b3,b0]
| +----+----+
| v
| +---------+
| | SubWord | S-Box Substitution
| +----+----+
| v
| +---------+
| | XOR Rcon| Rcon[i/4] = [RC[j], 0, 0, 0]
| +----+----+
| |
v v
(XOR) <------------------------------ g(W[i-1])
|
v
W[i] (For i % 4 != 0: W[i] = W[i-4] XOR W[i-1])
| AES Cipher Variant | Key Size (Bits / Words) | Rounds (Nr) | Expanded Words / Bytes | Words per Subkey | Rcon Consumed |
|---|---|---|---|---|---|
| AES-128 | 128 bits / 4 words | 10 rounds | 44 words / 176 bytes | 4 words (128 bits) | 10 constants (RC[1..10]) |
| AES-192 | 192 bits / 6 words | 12 rounds | 52 words / 208 bytes | 4 words (128 bits) | 8 constants (RC[1..8]) |
| AES-256 | 256 bits / 8 words | 14 rounds | 60 words / 240 bytes | 4 words (128 bits) | 7 constants (RC[1..7]) |
+-----------------------------------+
| RSA Attack Vector Taxonomy |
+-----------------+-----------------+
|
+--------------------+----------------+-------------------+--------------------+
| | | |
v v v v
[Factorization Attacks] [Low Exponent Attacks] [Protocol Attacks] [Side-Channel Attacks]
- General Number Field - Hastad's Broadcast (e=3) - Homomorphic CCA Multi- - Timing Analysis
Sieve (GNFS) - Wiener's Attack (d < n^0.25) plicative Attack - Power Analysis (DPA)
- Fermat's (|p-q| small)- Boneh-Durfee (d < n^0.292) - Bleichenbacher Oracle - Bellcore CRT Faults
| Attack Class | Exploit Mechanism | Vulnerability Root Cause | Standard Countermeasure |
|---|---|---|---|
| Factorization | GNFS / Fermat | Modulus < 2048 bits; |p − q| too small | 2048/4096-bit keys; strong prime spacing |
| Small Public Exponent | Hastad's Broadcast / CRT | e = 3 across multiple recipients | Set e = 65537 (216 + 1); OAEP padding |
| Small Private Exponent | Wiener's / Boneh-Durfee | d < n0.292 chosen for speed | Enforce full-length private exponents (d > n0.5) |
| Chosen-Ciphertext | Bleichenbacher / Malleability | Deterministic or PKCS#1 v1.5 padding | Enforce RSA-OAEP (RFC 8017) |
| Side-Channel / Fault | Timing / Bellcore CRT fault | Data-dependent runtime; unverified CRT | Cryptographic blinding; constant-time ALUs |
[Input Message M] ---> [Padding & Length Append] ---> 1024-bit Blocks M_1, M_2...
|
Initial Hash H0 (512-bit) v
| +--------------------+
+----------------------------------->| 80-Round Engine |<-- Wt, Kt
+---------+----------+
|
v
Hash H1 = H0 + Regs (mod 2^64)
-------------------------------------------------------------------------------
Single Round Logic:
T1 = h + Sigma1(e) + Ch(e, f, g) + Kt + Wt (mod 2^64)
T2 = Sigma0(a) + Maj(a, b, c) (mod 2^64)
New Regs: a = T1 + T2, b = a, c = b, d = c, e = d + T1, f = e, g = f, h = g
| Parameter | Specification Value | Cryptographic Role |
|---|---|---|
| Input Message Size | < 2128 bits | Arbitrary length payload capacity |
| Block Size | 1024 bits (16 × 64-bit words) | Iterative compression processing unit |
| Word Size | 64 bits | Native 64-bit register arithmetic operations |
| Rounds per Block | 80 rounds | Diffusion and confusion iterations |
| Output Digest Size | 512 bits (64 bytes) | 256-bit collision security bound |
KEY GENERATION:
Select prime p, primitive root g mod p, private key x in [2, p-2]
Compute public key y = g^x mod p ---> Public: (p, g, y), Private: x
|
SIGNING (Alice): | VERIFICATION (Bob):
Input: Hash m = H(M), Private Key x Input: m = H(M), Signature (r, s), (p, g, y)
1. Pick random secret nonce k: 1. Verify bounds:
gcd(k, p-1) = 1 0 < r < p AND 0 < s < p-1
2. Compute r = g^k mod p 2. Compute test values:
3. Compute k^-1 mod (p-1) v1 = g^m mod p
4. Compute signature s: v2 = (y^r * r^s) mod p
s = k^-1 * (m - x*r) mod (p-1) 3. Accept if v1 ≡ v2 (mod p),
Output Signature: (r, s) Else Reject
| Metric | ElGamal Digital Signature | RSA Digital Signature |
|---|---|---|
| Hardness Problem | Discrete Logarithm Problem (DLP) over ℤp* | Integer Factorization Problem (n = p × q) |
| Signature Output | Pair (r, s), 2 × modulus size | Single integer s = md mod n, 1 × modulus size |
| Nature | Probabilistic (randomized via nonce k) | Deterministic (requires randomized PSS padding) |
| Nonce Vulnerability | Catastrophic: nonce reuse reveals private key x | Not applicable (no per-message nonce used) |
| Successor Standard | NIST DSA and ECDSA (FIPS 186) | RSA-PSS (RFC 8017) |
AH Header Format (RFC 4302 - IP Protocol 51):
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Next Header(8)| Payload Len(8)| RESERVED(16) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Security Parameters Index (SPI) (32) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Sequence Number (Anti-Replay) (32) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Integrity Check Value (ICV) (Variable length) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
ESP Packet Format (RFC 4303 - IP Protocol 50):
[ESP Header: SPI (32) | Sequence Number (32)] (Plaintext)
[Payload Data (TCP + App Data)] --- ENCRYPTED
[Padding (0-255B) | Pad Len (8) | Next Hdr (8)] --- SCOPE (ESP Trailer)
[Integrity Check Value (ICV)] --- AUTHENTICATED SCOPE (Header to Trailer)
| Feature | Authentication Header (AH) | Encapsulating Security Payload (ESP) |
|---|---|---|
| RFC Standard | RFC 4302 | RFC 4303 |
| IP Protocol Number | 51 | 50 |
| Confidentiality (Encryption) | No (Plaintext payload) | Yes (AES-GCM, AES-CBC, ChaCha20) |
| Data Origin Authentication | Yes (HMAC over payload + immutable IP header) | Yes (HMAC over ESP Header, Payload, Trailer) |
| Anti-Replay Protection | Yes (Sliding window sequence numbers) | Yes (Sliding window sequence numbers) |
| Outer IP Header Protection | Yes (Authenticates immutable fields) | No (Outer IP header unprotected) |
| NAT Traversal | Incompatible (NAT breaks ICV) | Compatible (NAT-T over UDP 4500) |
| Primary Use Case | Legacy router integrity checks | Modern IPsec VPNs, Remote Access |