
Hashes and Certificates: Two Different Cryptographic Promises
Hashing and certificates both get filed under "cryptography," but they're answering two genuinely different questions. A hash answers: has this file changed since I last checked? A certificate, even a self-signed one, answers: can this connection actually be encrypted, and does the server claim to be who it says it is? Working through three labs in the same module, two on hashing, one on building a self-signed certificate, made that distinction concrete rather than abstract.
Hashing and certificates both get filed under "cryptography," but they're answering two genuinely different questions. A hash answers: has this file changed since I last checked? A certificate, even a self-signed one, answers: can this connection actually be encrypted, and does the server claim to be who it says it is? Working through three labs in the same module, two on hashing, one on building a self-signed certificate, made that distinction concrete rather than abstract.
Part 1: Watching a Hash Change in Real Time
The first lab used HashCalc to compute one-way hash values for a file, then deliberately modified that file to watch the hash change.
A one-way hash function takes an input of any size and compresses it down to a fixed-length output, typically somewhere between 128 and 256 bits depending on the algorithm. "One-way" is the operative word: you can't reconstruct the original file from its hash, and that's intentional. A hash isn't meant to store or encode the file's content, it's meant to produce a short, unique fingerprint that lets you verify the content hasn't changed, without needing to compare the entire file byte for byte.
After installing HashCalc, I created a simple text file, wrote "Hello World !!" into it, and pointed HashCalc at it, with MD5, SHA1, RIPEMD160, and CRC32 all selected simultaneously. Each algorithm produced a different hash value for the exact same content, a useful reminder that a hash is specific to the algorithm that generated it, not some universal fingerprint, different algorithms will never produce comparable output for the same input.
Then I made one small change to the file, adding the text "Modified File …!!!", and recalculated. Every single hash value changed completely, not just slightly, but entirely different output across all four algorithms. That's the actual property that makes hashing useful for integrity checking: even a tiny change to the input produces a dramatically different output. There's no "mostly the same" hash for a "mostly the same" file. A single changed character flips the hash as thoroughly as rewriting the entire document would.
That's the whole mechanism behind file integrity verification in practice: hash a file when you trust its state, store that hash somewhere safe, and recompute it later. If the hash matches, the content is provably unchanged. If it doesn't, something was modified, intentionally or not, and you know to investigate.
Part 2: Hashing at Scale, and Choosing Which Algorithms Matter
The second lab used a different tool, HashMyFiles, to compute hashes across an entire folder of files at once rather than one file at a time, which is a more realistic version of how hashing actually gets used operationally: verifying a whole directory of distributed files, not just a single document.
Before running anything, I went into the tool's hash type options and deliberately unchecked SHA-256, SHA-512, and SHA-384, leaving MD5, SHA1, and CRC32 selected instead.
That's worth pausing on, because it's a meaningful choice, not just a default. SHA-256 and its longer siblings are modern, cryptographically strong hash functions. MD5 and SHA1, by contrast, are both considered cryptographically broken for security purposes, both have known collision vulnerabilities, meaning it's possible (with enough computational effort) to deliberately construct two different files that produce the same hash. That completely defeats the purpose of using a hash to detect tampering, if an attacker can engineer a collision, they can swap in malicious content without the hash changing at all.
So why did this lab still demonstrate MD5 and SHA1? Because they remain genuinely useful for a narrower purpose: detecting accidental corruption or unintentional modification, like confirming a file transferred correctly or wasn't altered by an ordinary system error. They're fast, well-supported, and still perfectly adequate when you're not defending against a deliberate, resourced adversary trying to forge a collision. The lab's own material was explicit about this, noting that MD5 isn't collision-resistant and that newer algorithms like SHA-2 and SHA-3 are the better choice specifically for security-sensitive applications like digital signatures.
Running HashMyFiles against a sample folder returned every file's MD5, SHA1, and CRC32 values in one pass, a practical illustration of the real use case: sharing a batch of files alongside their hash values so the recipient can verify every file arrived intact, without needing cryptographic signing or certificate infrastructure at all.
Part 3: Building a Self-Signed Certificate
The third lab moved into a different part of cryptography entirely: enabling HTTPS on a web server using a self-signed SSL/TLS certificate, built and installed directly through IIS (Internet Information Services) on Windows.
I started by confirming the actual problem: browsing to a test site over HTTPS returned "This site can't be reached", because no certificate existed yet to establish an encrypted connection at all. HTTPS isn't just "HTTP but encrypted" as an afterthought, the certificate is the mechanism that makes the encrypted handshake possible in the first place. Without one, there's nothing for the browser to negotiate against.
In IIS Manager, under Server Certificates, I used the Create Self-Signed Certificate action, giving it a friendly name (
LuxuryTreats ) and confirming it would be stored in the Personal certificate store. IIS generated a public/private key pair and the certificate itself in a single step.Having the certificate exist wasn't enough on its own, it still needed to be bound to the actual site. Under the site's Bindings settings, I added a new binding: type HTTPS (which automatically set the port to 443, the standard HTTPS port), the specific IP the site was hosted on, the hostname (
www.luxurytreats.com ), and finally selected the LuxuryTreats certificate from the dropdown to associate it with that binding.After refreshing the site and reloading the page over HTTPS, the browser returned a very specific and expected warning: "Your connection is not private." That's not a malfunction, it's the browser correctly doing its job. A self-signed certificate is signed by the same entity that created it, with no trusted third-party Certificate Authority ever vouching for it. The browser has no way to confirm the certificate's claims are legitimate, so it flags the connection as unverified, exactly as it should. Clicking through the Advanced warning and choosing to proceed anyway got me to the site over a genuinely encrypted HTTPS connection, just one the browser (correctly) couldn't independently vouch for.
Why Self-Signed Certificates Are Useful and Limited in the Exact Same Way
The lab material framed this clearly: self-signed certificates are genuinely useful for testing environments precisely because of how certificate trust actually works. Verifying a certificate's legitimacy requires the recipient to be able to confirm the private key behind it without that key ever actually being disclosed, which is exactly what a real Certificate Authority's chain of trust accomplishes. A self-signed certificate skips that entire verification chain, which is fine, even desirable, for a local testing environment where you already know and trust the server you just stood up yourself. It becomes a liability the moment it's used for a real, public-facing service, because any visitor's browser has no legitimate way to confirm the site is actually who it claims to be, and training users to click through "not private" warnings as routine is itself a security problem.
What Connects All Three Labs
Stepping back, hashing and certificates solve adjacent but distinct problems, and seeing both in the same module makes the boundary between them clearer.
Hashing proves integrity, not identity. A matching hash tells you a file hasn't changed. It tells you nothing about who created the file or whether you should trust its origin in the first place. Hashing a malicious file and a legitimate file both work exactly the same way; the hash has no opinion on content, only on consistency.
Certificates establish both encryption and (when properly signed) identity. A certificate, properly issued by a trusted CA, does something hashing fundamentally can't: it lets a connecting party verify they're actually talking to the entity they intended to, not just that the data in transit hasn't been tampered with. A self-signed certificate keeps the encryption half of that promise while deliberately giving up the identity-verification half.
Algorithm choice is a real security decision in both cases. Choosing MD5/SHA1 over SHA-256 for a quick integrity check against accidental corruption is a reasonable, deliberate tradeoff. Using MD5 to sign something you need genuine, adversary-resistant security guarantees from is a mistake, the exact same algorithm, entirely different consequences depending on what you're actually defending against.
Warnings exist because the trust model is working correctly. The browser's "not private" message on a self-signed certificate isn't a glitch to route around, it's the system functioning exactly as designed, correctly declining to vouch for something it genuinely cannot verify.
Placed side by side, these three labs made something clear that's easy to blur together when "cryptography" gets treated as one broad topic: hashing and certificates are solving genuinely different problems, using genuinely different mechanisms, with genuinely different failure modes. A hash mismatch means content changed. A certificate warning means identity can't be verified. Confusing the two, or assuming either one is "covered" by the other, is exactly the kind of gap that leads to a false sense of security. Understanding what each one actually promises, and just as importantly, what it doesn't, is the real takeaway from working through both in the same sitting.
Read complete documentation here on my Github : https://github.com/devmuhakeem/Cryptography-and-PKI-One-Way-Hashing-and-Self-Signed-Certificates
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article