PROJECTENGRAM

SECURITY

Security

Tags: #◇Computer Science #◇CSNETWK #◇Security #◇Conceptual


◇Overview

Network security encompasses several key principles: Confidentiality: Only the sender and intended receiver should understand the message contents (achieved via encryption). Authentication: Sender and receiver must confirm each other's identity. Message Integrity: Ensuring the message was not altered in transit. Access and Availability: Services must be accessible to legitimate users.

Malicious actors can perform various attacks, including eavesdropping, message insertion, impersonation (spoofing), hijacking connections, and Denial of Service (DoS).

Cryptography Types

  1. Symmetric Key Cryptography: Both sender and receiver share the same secret key.
    Examples: DES (Data Encryption Standard - 56-bit key), 3DES, and AES (Advanced Encryption Standard - 128, 192, or 256-bit keys).
    Pros: Very fast (AES is ~100x faster than RSA).
    Cons: Requires a secure way to establish the shared key beforehand.
  2. Public Key Cryptography: The receiver has a public key (known to everyone) and a private key (known only to them).
    To send a confidential message, the sender encrypts it using the receiver's public key. The receiver decrypts it using their private key.
    Example: RSA (Rivest-Shamir-Adleman).

The RSA Algorithm

RSA relies on the mathematical difficulty of factoring large numbers.

  1. Choose two large prime numbers pp and qq.
  2. Compute n=pqn = pq and z=(p−1)(q−1)z = (p-1)(q-1).
  3. Choose ee (where e<ne < n) such that it has no common factors with zz (ee and zz are relatively prime).
  4. Choose dd such that e⋅d−1e \cdot d - 1 is exactly divisible by zz (i.e., ed(modz)=1ed \pmod z = 1).
  5. Public Key: (n,e)(n, e)
  6. Private Key: (n,d)(n, d)

Because RSA exponentiation is computationally intensive, it is typically used only to securely exchange a symmetric session key. The faster symmetric key is then used for the actual data transmission.

Authentication and Message Integrity Authentication: Defeating playback attacks (where an intruder records and replays a packet) requires a nonce (a number used once in a lifetime). The sender must encrypt the nonce to prove they are live. Digital Signatures: Analogous to hand-written signatures. A sender signs a document by encrypting it with their private key. The receiver verifies it by decrypting with the sender's public key. Message Digests: A hash function (like MD5 or SHA-1) processes a message to produce a fixed-size fingerprint. It is computationally infeasible to find two messages with the same hash. A practical digital signature is formed by signing (encrypting) the message digest rather than the entire message. Certification Authorities (CA): To prevent a "man-in-the-middle" from distributing fake public keys, CAs bind public keys to specific entities. The CA issues a certificate containing the entity's public key, digitally signed by the CA's own private key.

◇Important Formulas

RSA Encryption:
c=me(modn)c = m^e \pmod n
Where mm is the plaintext message represented as an integer, and cc is the ciphertext.
RSA Decryption:
m=cd(modn)m = c^d \pmod n
Modular Arithmetic Properties:
(a(modn)×b(modn))(modn)=(a×b)(modn)(a \pmod n \times b \pmod n) \pmod n = (a \times b) \pmod n
(me(modn))d(modn)=med(modn)=m(m^e \pmod n)^d \pmod n = m^{ed} \pmod n = m

◇Worked Examples

Example 1: RSA Key Generation and Encryption

  1. Choose primes p=5p = 5 and q=7q = 7.
  2. Compute n=5×7=35n = 5 \times 7 = 35 and z=(5−1)(7−1)=24z = (5-1)(7-1) = 24.
  3. Choose e=5e = 5 (since 5 and 24 are relatively prime).
  4. Find dd such that 5d(mod24)=15d \pmod{24} = 1. Let's test values: 5×5=25(mod24)=15 \times 5 = 25 \pmod{24} = 1. So, d=5d = 5. (Wait, the notes used d=29d=29 because 29×5=145=6×24+129 \times 5 = 145 = 6 \times 24 + 1). Let's use d=29d = 29.
  5. Public key is (35,5)(35, 5), Private key is (35,29)(35, 29).
    Encryption: If message m=12m = 12:
    c=125(mod35)=248832(mod35)=17c = 12^5 \pmod{35} = 248832 \pmod{35} = 17
    Decryption:
    m=1729(mod35)=12m = 17^{29} \pmod{35} = 12

◇References & Navigation

CONFIRMATION // 理解度の確認

ACTIVE RECALL VERIFICATION

Select an answer to verify conceptual comprehension and reveal the technical rationale.

Q1

What are the core security properties of the CIA Triad plus Authentication and Non-Repudiation in network security?

Q2

How do Symmetric-Key Cryptography (e.g., AES) and Public-Key (Asymmetric) Cryptography (e.g., RSA, Diffie-Hellman) differ, and how are they combined in protocols like TLS?

Q3

To create a Digital Signature on a document mm that provides both sender authentication and message integrity, which key does Alice use to sign the cryptographic hash H(m)H(m), and which key does Bob use to verify it?

Q4

Why is sending an unkeyed cryptographic hash H(m)H(m) alongside a plaintext message ⟨m,H(m)⟩\langle m, H(m) \rangle insufficient to protect message integrity against an active Man-in-the-Middle attacker?

Q5

At which layers of the Internet protocol stack do TLS (Transport Layer Security), IPsec, and WPA2/WPA3 (802.11i) respectively operate?