Edison Mucllari 2025 cybersecurity, encryption, TLS, HTTPS, VPN, hashing, PKI, digital signatures, confidentiality, integrity, authentication

Understanding the Pillars of Cybersecurity: Protocols, Primitives, and Trust

Cybersecurity Blog image

Introduction: Core Principles of Cybersecurity

What is Cybersecurity?
Cybersecurity is the practice of protecting systems, networks, and programs from digital attacks. These cyberattacks are usually aimed at accessing, changing, or destroying sensitive information; extorting money from users; or interrupting normal business processes. At its heart, cybersecurity is built on a few fundamental principles: **Confidentiality**, **Integrity**, and **Authentication**, often referred to as the "CIA Triad". Other important concepts include **Anti-Replay** and **Non-Repudiation**.

The CIA Triad and Beyond

  • Confidentiality: This ensures that information is accessible only to those authorized to have access. It's about preventing unauthorized disclosure of data.
    Example: Encrypting your emails so only the intended recipient can read them.
  • Integrity: This ensures the accuracy and completeness of data. It prevents unauthorized modification or destruction of information.
    Example: Using a checksum or hash to verify a downloaded file hasn't been tampered with.
  • Authentication: This confirms the identity of a user, process, or device. It ensures that the entity claiming to be who they are is indeed that entity.
    Example: Logging into a website with a username and password.
  • Anti-Replay: This protects against malicious re-transmission of a valid data transmission. Attackers might capture a valid login request and "replay" it to gain unauthorized access. Anti-replay mechanisms prevent this by using timestamps or nonces (numbers used once).
    Example: In secure protocols, each message might include a unique sequence number or timestamp to detect and reject duplicate or out-of-order messages.
  • Non-Repudiation: This ensures that a party cannot deny having sent or received a message. It provides undeniable proof of the origin and integrity of data.
    Example: Digital signatures provide non-repudiation, proving that a specific person signed a document and that the document hasn't changed since.

The Five Pillars of Cybersecurity

Security Principle What It Does Primary Technology Real-World Example
🔒 Confidentiality Keeps your secrets secret - only authorized people can see your information Encryption
(Scrambles data so only the right people can read it)
When you send a private message on WhatsApp, it's encrypted so only you and your friend can read it
🛡️ Integrity Ensures your data hasn't been tampered with or corrupted Hashing
(Creates a unique "fingerprint" for data)
When you download software, you can check its hash to make sure it wasn't modified by hackers
🔑 Authentication Proves you are who you say you are PKI & Digital Certificates
(Digital IDs that verify identity)
When you log into your bank account with username/password, or when websites show that green padlock
🔄 Anti-Replay Prevents hackers from copying and reusing your login attempts Timestamps & Nonces
(Unique numbers or time stamps)
Your credit card has a security code that changes - old codes can't be reused
📝 Non-Repudiation Provides undeniable proof of who sent what and when Digital Signatures
(Digital equivalent of handwritten signatures)
When you digitally sign a contract, you can't later deny that you signed it
---

Secure Communication Protocols

SSL/TLS: The Foundation of Web Security

What are SSL and TLS?
SSL (Secure Sockets Layer) and its successor, TLS (Transport Layer Security), are cryptographic protocols designed to provide communication security over a computer network. They are the backbone of secure internet communication. SSL was first developed by Netscape in 1995, and TLS 1.0 was defined in 1999 as an upgrade to SSL 3.0. Modern web browsers and applications primarily use TLS, though the term "SSL" is still commonly used to refer to these technologies collectively.

They establish an encrypted link between a server and a client (e.g., a web server and a web browser), ensuring that all data passed between them remains private and integral.
How TLS Works (Simplified Handshake):
  1. Client Hello: The client sends a "Client Hello" message to the server, listing its supported TLS versions, cipher suites (encryption algorithms), and a random number.
  2. Server Hello: The server responds with a "Server Hello," choosing the best TLS version and cipher suite supported by both, its own random number, and its digital certificate.
  3. Authentication (Certificate Exchange): The client verifies the server's digital certificate (checking its validity, trust chain to a CA). This step authenticates the server's identity.
  4. Key Exchange: Using asymmetric encryption (often RSA or Diffie-Hellman, as discussed previously), the client and server exchange pre-master secret information securely. Both parties then use this, along with the random numbers, to generate a shared symmetric "master secret" key.
  5. Cipher Spec Change & Finished: Both parties send "Change Cipher Spec" and "Finished" messages, signaling that all subsequent communication will be encrypted using the newly derived symmetric key.
  6. Secure Data Transfer: Encrypted data can now flow securely between the client and server using the agreed-upon symmetric key.

HTTPS: Secure Web Browsing

What is HTTPS?
HTTPS (Hypertext Transfer Protocol Secure) is simply the secure version of HTTP, the protocol over which data is sent between your browser and the website you're connecting to. The 'S' at the end stands for 'Secure', meaning all communications between your browser and the website are encrypted using SSL/TLS.

When you see `https://` in a website's URL and a padlock icon in your browser's address bar, it indicates that your connection to that site is secure. This protects your data (like login credentials, credit card numbers, or personal information) from eavesdropping and tampering by malicious third parties as it travels across the internet.

SSL VPN: Secure Remote Access

What is SSL VPN?
An SSL VPN (Virtual Private Network) provides secure remote access to a private network (like a company's internal network) over a public network (the internet) using SSL/TLS protocols. Unlike traditional IPsec VPNs that often require specialized client software, SSL VPNs are typically accessed via a web browser, making them very flexible and easy to deploy for remote users.

They create a secure, encrypted tunnel through which remote users can access internal network resources as if they were physically connected to the office network.
---

Key Players in Online Security

  • Client: This refers to your device (e.g., laptop, smartphone) and the software (e.g., web browser, email client) that initiates a secure connection or requests a resource.
  • Server: This is the computer system that hosts resources (e.g., websites, applications, files) and responds to client requests. It holds the private keys for its digital certificates.
  • Certificate Authority (CA): A CA is a trusted third-party organization that issues and manages digital certificates. Their primary role is to verify the identity of individuals, organizations, and servers and bind them to their public keys. Browsers and operating systems come pre-installed with a list of trusted CAs, forming the foundation of trust in online communication. Without CAs, it would be difficult to verify if a website or server is legitimate.
---

Cryptographic Primitives: The Building Blocks

Hashing: Ensuring Data Integrity

What is Hashing?
Hashing is a process that takes an input (or 'message') of any length and returns a fixed-size string of bytes, typically a short, unique alphanumeric code, called a **hash value** or **message digest**. It's a one-way function, meaning it's computationally infeasible to reverse the process and get the original input from the hash value.
Key Properties of Hash Functions:
  • One-Way (Preimage Resistance): Given a hash value $h$, it's impossible to find an input $x$ such that $H(x) = h$.
  • Collision Resistance: It's computationally infeasible to find two different inputs $x$ and $y$ such that $H(x) = H(y)$.
  • Deterministic: The same input will always produce the same hash output.
  • Fixed Output Size: Regardless of input size, the output hash will always be of a fixed length (e.g., 256 bits for SHA-256).

Hashing Algorithms: Popular hashing algorithms include:
  • MD5 (Message-Digest Algorithm 5): Once widely used, but now considered cryptographically broken due to known collision vulnerabilities. Not recommended for security purposes.
  • SHA-256 (Secure Hash Algorithm 256): Part of the SHA-2 family, it produces a 256-bit (64-character hexadecimal) hash value. Widely used and considered secure for most applications.
  • SHA-3 (Secure Hash Algorithm 3): The latest standard from NIST, offering a different underlying construction than SHA-2, providing an alternative strong hash function.
Collisions: A hash collision occurs when two different inputs produce the exact same hash output. While designed to be extremely rare, if a collision can be deliberately found, it undermines the integrity property of the hash function, as a malicious actor could substitute an original message with a fraudulent one that has the same hash. This is why algorithms like MD5 are no longer considered secure for integrity checks.
How Hashing Ensures Data is Not Modified:
Imagine you download a software file. The publisher provides the file along with its SHA-256 hash value.
  1. You download the file.
  2. You compute the SHA-256 hash of the downloaded file on your local machine.
  3. You compare your computed hash with the hash provided by the publisher.
If the two hash values match, it's highly probable that the file you downloaded is exactly as the publisher intended, and hasn't been modified or corrupted during transit. If they don't match, the file has been altered or corrupted.

Conceptually: $$H(\text{Original Data}) = \text{Original Hash}$$ $$H(\text{Downloaded Data}) = \text{Computed Hash}$$ $$\text{If } \text{Original Hash} = \text{Computed Hash}, \text{ then Data Integrity is Maintained}$$

Beyond Hashing: Ensuring Authenticity with MACs

The Problem with Hashing Alone (The Man-in-the-Middle Attack)
While hashing is great for detecting accidental corruption, it can't stop a deliberate attacker like Eve who sits between Bob and Alice.

Imagine this:
  1. Bob wants to send the message "Pay me $100" to Alice. He hashes it and sends both the message and the hash.
  2. Eve intercepts the message. She can't use the original message, but she can create a new one: "Pay Eve $1000".
  3. Since the hashing algorithm (like SHA-256) is public, Eve simply calculates a new hash for her malicious message.
  4. Eve sends her new message and its new hash to Alice.
  5. Alice receives the message and the hash. She computes the hash of the message she received, and it matches the hash Eve sent. To Alice, everything looks perfectly fine, and she pays Eve.
The integrity check passed, but the message was still successfully tampered with. This is because the hash only proves the message wasn't altered since it was last hashed, not that it came from the original sender (Bob).

MAC and HMAC: Adding a Secret Ingredient

To solve this, we use a Message Authentication Code (MAC). A MAC is like a hash, but it's created using two inputs: the message itself and a secret key that only the sender and receiver know.

A common type of MAC is an HMAC (Hash-based Message Authentication Code). It uses a standard hash function (like SHA-256) but combines it with the secret key to provide both data integrity and authenticity.
Conceptual Formula:
Simple Hash: $$ \text{Hash} = H(\text{Message}) $$ HMAC: $$ \text{HMAC} = H(\text{Secret Key} + \text{Message}) $$ (Note: This is a simplified representation. The actual HMAC process is more complex to prevent certain attacks, but this illustrates the core idea.)

Symmetric and Asymmetric Encryption

Symmetric Encryption: Single Key Simplicity
In symmetric encryption, the same secret key is used for both encrypting plaintext into ciphertext and decrypting ciphertext back into plaintext. It's like having a single lock and key for a box; anyone with that key can both lock and unlock it.

Process: 1. Alice and Bob agree on a secret key. 2. Alice uses this key to encrypt her message. 3. Alice sends the ciphertext to Bob. 4. Bob uses the *same* key to decrypt the ciphertext and read the message.

Example: AES (Advanced Encryption Standard) is the most widely used symmetric encryption algorithm today, employed in everything from Wi-Fi security to file encryption.

Pros: Very fast and efficient, suitable for encrypting large amounts of data.
Cons: The main challenge is the **key distribution problem** – how do Alice and Bob securely share this secret key over an insecure channel without an eavesdropper intercepting it?
Asymmetric Encryption: Public and Private Keys
Asymmetric encryption, also known as **public-key cryptography**, uses a pair of mathematically linked keys: a **public key** and a **private key**. Data encrypted with one key can only be decrypted by the other key in the pair.

Process: 1. Alice generates a public/private key pair. She keeps her private key secret and shares her public key with anyone who wants to send her an encrypted message. 2. Bob wants to send a secret message to Alice. He uses Alice's **public key** to encrypt the message. 3. Bob sends the ciphertext to Alice. 4. Alice uses her **private key** (which only she possesses) to decrypt the ciphertext and read the message.

Example: RSA (Rivest-Shamir-Adleman) is a widely used asymmetric encryption algorithm, often used for secure key exchange and digital signatures.

Pros: Solves the key distribution problem as the public key can be freely shared. Enables digital signatures and secure key exchange.
Cons: Much slower and more computationally intensive than symmetric encryption, making it unsuitable for encrypting large volumes of data directly.
---

Hybrid Encryption

The Best of Both Worlds: Hybrid Encryption
In real-world applications, we combine the strengths of both symmetric and asymmetric encryption to create a hybrid encryption system. This approach solves the key distribution problem while maintaining the speed needed for large data transfers.

Here's how it works:
  1. Initial Setup: Both Bob and Alice have their own public/private key pairs for asymmetric encryption
  2. Key Generation: Bob generates a random symmetric key (like an AES key) for fast encryption
  3. Secure Key Exchange: Bob encrypts this symmetric key using Alice's public key and sends it to her
  4. Key Recovery: Alice receives the encrypted symmetric key and decrypts it using her private key since she is the only one who can decrypt because she has the private key- now they both have the same symmetric key!
  5. Fast Communication: For all subsequent data exchange, they use the shared symmetric key for lightning-fast encryption/decryption

Why This Works So Well:
  • 🔐 Security: The symmetric key is safely exchanged using unbreakable asymmetric encryption
  • Speed: Large amounts of data are encrypted using fast symmetric algorithms
  • 🛡️ Scalability: No need to pre-share keys - public keys can be distributed openly
Real Encryption Process - Bob and Alice Key Exchange
Watch the Process: This animation shows Bob and Alice performing hybrid encryption - asymmetric encryption for key exchange, followed by symmetric encryption for data communication.

Establishing Trust and Secret Sharing

Signatures and Key Exchange

While symmetric encryption is fast for data, and asymmetric encryption solves key distribution, they often work together. Asymmetric encryption is commonly used to securely exchange a symmetric key (e.g., during the TLS handshake), which is then used for the bulk of the secure communication. This is why **key exchange** is a critical component – it allows two parties to agree on a secret key without directly transmitting it.

Furthermore, asymmetric encryption is crucial for **digital signatures**, providing a way to verify the authenticity and integrity of messages or documents.

PKI: Public Key Infrastructure

What is a PKI?
A PKI (Public Key Infrastructure) is a system of hardware, software, policies, and procedures that manages the creation, distribution, use, storage, and revocation of digital certificates and public-key encryption. Its primary purpose is to bind public keys with verifiable identities of individuals, organizations, or devices, thereby enabling secure communication and transactions in a large-scale network environment.

Key Components of a PKI:
  • Certificate Authority (CA): The trusted entity that issues digital certificates.
  • Registration Authority (RA): Verifies the identity of certificate applicants on behalf of the CA.
  • Digital Certificates: Electronic documents that link a public key to an identity, issued by a CA.
  • Certificate Revocation Lists (CRLs) / Online Certificate Status Protocol (OCSP): Mechanisms to check if a certificate has been revoked before its expiration date.

Digital Signatures: Proving Authenticity and Integrity

What are Digital Signatures?
A digital signature is a cryptographic mechanism used to verify the authenticity and integrity of a digital message or document. It's essentially a mathematical scheme for demonstrating the authenticity of a digital message or document. A valid digital signature gives a recipient reason to believe that the message was created by a known sender (authenticity), and that it has not been altered in transit (integrity). It also provides **non-repudiation**.
How Digital Signatures Work:
  1. Sender (Signer) Action:
    1. The sender (e.g., Alice) first generates a hash of the document she wants to sign.
    2. Alice then encrypts this hash using her **private key**. This encrypted hash is the digital signature.
    3. Alice sends the original document along with the digital signature to the recipient (e.g., Bob).
  2. Recipient (Verifier) Action:
    1. Bob receives the document and the digital signature.
    2. Bob uses Alice's **public key** to decrypt the digital signature, recovering the original hash that Alice generated.
    3. Bob independently generates a hash of the received document.
    4. Bob compares the hash he computed with the hash he recovered from the signature. If they match, the signature is valid, confirming:
      • Authenticity: The signature came from Alice (because only her private key could create it).
      • Integrity: The document hasn't been altered since Alice signed it (because any change would result in a different hash).
      • Non-Repudiation: Alice cannot credibly deny having signed the document.

The mathematical operation for signing and verifying often involves modular arithmetic, similar to asymmetric encryption itself, but applied to the hash of the message. For example, using RSA: $$ \text{Signature} = (\text{Hash of Message})^d \pmod{n} $$ Where $d$ is the sender's private exponent and $n$ is their public modulus. To verify: $$ \text{Recovered Hash} = (\text{Signature})^e \pmod{n} $$ Where $e$ is the sender's public exponent.
---

Conclusion: An Interconnected Web of Security

Think of cybersecurity as a well-orchestrated team where each member has a specific job:

  • 🔒 Encryption keeps your secrets safe
  • 🛡️ Hashing detects if anything was tampered with
  • 🔑 PKI makes sure everyone is who they claim to be
  • 🌐 TLS/HTTPS creates secure communication channels
  • 📝 Digital signatures provide undeniable