30 Mins

1. Core Principles of Cryptography & CIA Triad

The CIA Triad and Non-Repudiation

The CIA Triad is the foundational model for information security. Confidentiality ensures that data is accessible only by authorized parties. Integrity guarantees that data has not been altered in transit or at rest. Availability ensures that systems and data are accessible when needed.

Non-repudiation is the fourth pillar, providing proof of the origin and integrity of data, ensuring the sender cannot deny having sent a message.

To verify integrity in a real-world scenario, we use cryptographic hashes. You can use OpenSSL to generate a SHA-256 fingerprint of a file, ensuring its state remains consistent.

Security Operator Note: Think of the CIA triad as a stool; if one leg is missing, the security posture collapses.
Text
openssl dgst -sha256 document.txt
Cryptographic Architecture • Symmetric vs. Asymmetric Key Exchange Paradigm
Symmetric Cryptography (AES-256-GCM)

Single shared key used for both encryption and decryption. Ultra-fast performance suitable for streaming gigabytes of data.

KEY = [ 0x3F, 0x8A, ..., 0x99 ] (Shared Secret)
Asymmetric Cryptography (RSA-2048 / ECC)

KeyPair scheme: Public Key encrypts data, Private Key decrypts. Solves key distribution over public untrusted networks.

PUBLIC KEY (Share)
PRIVATE KEY (Secret)

Plaintext, Ciphertext, Keys, and Ciphers

Plaintext is the readable, unencrypted message. A cipher is the algorithm—the mathematical formula—used to perform encryption and decryption. The key is a secret piece of information that makes the cipher's output unique to the user.

The fundamental relationship is: Ciphertext = Encryption_Algorithm(Plaintext, Key).

Below is a simple XOR cipher simulation in Python. XORing plaintext with a repeating key is a classic (though weak) symmetric cipher technique.

Security Operator Note: Always remember that the algorithm is the 'lock design', while the key is the 'physical key' that fits it.
Python 3
def xor_cipher(data, key):
    return bytes([b ^ key[i % len(key)] for i, b in enumerate(data.encode())])

message = 'SecretData'
key = b'VOIDX'
encrypted = xor_cipher(message, key)
print(f'Ciphertext: {encrypted.hex()}')

Kerckhoffs's Principle & Shannon's Maxim

Kerckhoffs's Principle states that a cryptosystem should be secure even if everything about the system, except the key, is public knowledge. This is reinforced by Shannon's Maxim: 'The enemy knows the system.'

Security through obscurity is never a substitute for robust key management. If your security relies on hiding the algorithm, your system is fundamentally broken if the implementation is leaked.

The table below clarifies the distinction between algorithm secrecy and key management.

Security Operator Note: Never write your own cryptographic algorithm for production. Use established standards like AES.
FeatureDescription
AlgorithmThe public, peer-reviewed mathematical transformation.
KeyThe private, high-entropy variable securing the input.

Cryptographic Attack Types

Attackers use various methods to break cryptosystems. A Ciphertext-only attack involves having access to only the encrypted messages. A Known-plaintext attack occurs when the attacker has pairs of both plaintext and the resulting ciphertext.

A Chosen-plaintext attack is the most dangerous scenario, where the attacker can obtain the ciphertext for arbitrary plaintext of their choosing, often leading to the discovery of the underlying key.

You can simulate a simple bit-flipping attack on raw byte streams using Python to observe how integrity is compromised.

Security Operator Note: Chosen-plaintext attacks are why we use randomized Initialization Vectors (IVs) in modern block ciphers.
Python 3
original = bytearray(b'Admin:False')
# Flip a bit to change 'F' to 'T' for True
original[6] = original[6] ^ 0x05
print(f'Modified payload: {original.decode()}')

Knowledge Check

Ready to test your understanding of 1. Core Principles of Cryptography & CIA Triad?

Back