Cybersecurity
Session 5
Data Protection: Documents, Files and Validation
Apply robust encryption tools to secure sensitive documents and files, ensure data
integrity, and implement validation best practices.
-Dr Shuchi Dhir
Know Your Facilitators
Dr Shuchi has over 15 years of experience teaching and mentoring, effectively
guiding graduate and postgraduate students in diverse computer science and
cybersecurity areas.
Dr Shuchi has completed her Master’s ([Link]) and doctorate in Philosophy (PhD) in
computer science. She has also earned a Bachelor’s and Master’s in Computer
Applications.
Dr Shuchi has taught Master's in Cybersecurity programs at renowned universities,
including the University of San Diego, Southern New Hampshire University (SNHU),
and Edith Cowan University.
Her teaching portfolio spans advanced topics such as network security,
cryptography, and incident response, equipping students with theoretical
knowledge and hands-on expertise in cybersecurity.
Dr Shuchi has made significant contributions to the cybersecurity field through
Dr Shuchi DHIR impactful research publications in areas such as biometrics and cryptography.
Regenesys Integrated Leadership & Management
Model
Regenesys Graduate Attributes
Ground Rules
Be On Time
Turn On Your Video (If Possible)
Stay on Mute
Use the Chat or “Raise Hand” Feature
Avoid Multitasking
Check Your Internet and Equipment
Log in with Your Name
Keep Distractions to a Minimum
Avoid Sharing Screens Without Permission
Be Respectful
Ask Relevant Questions
Follow the Host’s Instructions
Participate Actively
Stay Focused on the Topic
Do Not Record Without Permission
Keep the Content Confidential
Learning Objectives
Core Concepts Data Validation
Understand the CIA triad and distinguish between data at rest, in Validate data integrity and authenticity using cryptographic hashes and
rest, in transit, and in use. digital signatures.
Cryptography Basics Key Management
Distinguish between symmetric vs. asymmetric encryption, hashing Implement secure practices for managing keys, passwords, and recovery
hashing algorithms, and digital signatures. procedures.
Tool Selection Compliance & Best Practices
Select appropriate encryption tools for various environments (OS -native, Align with regulatory requirements (GDPR, HIPAA) and avoid common
(OS-native, Desktop, CLI, Cloud). security pitfalls.
Practical
Session Application
4: Data Protection 2
Apply hands-on encryption to files and folders, and implement
protection for Office/PDF documents.
File Verification with
Hashing & Digital Signatures
Master the practical skills to verify file authenticity, prevent malware infections,
and detect data tampering.
SECURITY INCIDENT CASE: #2016-MINT
Today's Practical Labs
The Linux Mint Compromise
1 Generate & Compare Hashes Hands-on with MD5 vs SHA-256 using command line tools.
In 2016, hackers compromised the Linux Mint website and replaced the official
2 Verify Digital Signatures Step-by-step verification using GPG and OpenSSL. ISO download link with a backdoored version containing the Tsunami botnet.
3 Real-World Application Apply these techniques to secure software downloads and code Thousands of users downloaded the infected OS.
and code commits.
# How it could be detected:
Official Hash: 6e7f...8a9b
Downloaded File: e4a1...2c3d
>> MISMATCH DETECTED
Simple hash verification would have alerted users immediately.
Module: SEC-101 // File Integrity Est. Time: 15 mins
Hashing Basics
Understanding the digital fingerprint of your data.
VISUAL CONCEPT: THE AVALANCHE EFFECT
What is a Hash?
A cryptographic hash function takes input data of any size and produces a
produces a fixed-length string of characters. It acts as a unique digital
digital fingerprint.
CORE PROPERTIES Hash Digest:
SHA-256
[Link] 185f8db3...2c3d
Content:Hell CO
Deterministic o MPL
LET
Same input always produces the exact same hash.
ELY
DIFF
MODIFIED FER
Avalanche Effect
ENT
Changing just 1 bit of data completely changes the hash. T
Hash Digest:
SHA-256
One-Way Function [Link] 9a2b4ec1...8f0e
Cannot reverse-engineer the original file from the hash. Content:Hell
llp
Algo Speed Use Case
MD5 Very Fast Legacy only. Insecure.
SHA-256 Fast Standard for security.
Hands-On: Generate Hashes
Native commands to create digital fingerprints on any OS.
Windows macOS Linux
Command Prompt Terminal -- -zsh user@ubuntu: ~
# Native Utility ([Link]) # Standard command (SHA-256) # Standard coreutils
C:\> certutil -hashfile [Link] SHA256 user@mac ~$ shasum -a 256 [Link] user@linux:~$ sha256sum [Link]
SHA256 hash of [Link]: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b785 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b785
e3b0c442...fc1c 2b855 [Link] 2b855 [Link]
CertUtil: -hashfile command completed successfully.
successfully.
# Legacy MD5 (Not Recommended) # Using OpenSSL (Universal)
user@mac ~$ md5 [Link] user@linux:~$ openssl dgst -sha256 file
SHA256(file)=
MD5 ([Link]) = d41d8cd98f00b204e9800998ecf8427e e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b785
PowerShell
2b855
# PowerShell Cmdlet
PS C:\> Get-FileHash .\[Link] -Algo SHA256
Algorithm Hash
SHA256 E3B0C4...
Verification Tip
Input File Hash Output
Always check the algorithm requested by the website. SHA-256 is the modern standard, while MD5 and SHA-1 are legacy formats.
Detecting Tampering
The 3-step process to validate file integrity manually.
1 Get Expected Hash INTEGRITY VERIFIED
Scenario A: The Good File
Obtain the official hash string from the trusted vendor website (always verify
(always verify it's HTTPS).
EXPECTED e3b0c44298fc1c149afbf4c8996fb924
VENDOR WEBSITE
SHA256: 3b0d...9af2 ACTUAL e3b0c44298fc1c149afbf4c8996fb924
Safe to install / execute.
2 Compute Local Hash
Run the hashing command on your downloaded file.
TAMPERING DETECTED
YOUR TERMINAL Scenario B: Corrupted or Hacked File
$ sha256sum [Link] 4c8e...771a [Link]
EXPECTED e3b0c44298fc1c149afbf4c8996fb924
ACTUAL e3b0c44298fc1c14 X fbf4c8996fb924
3 Compare Exactly
visually or programmatically check if strings match perfectly.
DO NOT OPEN. Delete immediately. $sha256sum -c tool.sha256
GUI Alternatives: QuickHash HashTab 7-Zip
Digital Signatures
Proving both integrity and authenticity in one step.
Workflow Visualization
What it Proves
Integrity
File hasn't been changed.
PUB
Authenticity LISH
1. Hash 2. Sign w/
a1b2...c3d4 Private Key
Ideally signed by the owner. ER .SIG
SIDE
Non-Repudiation [Link] Signature File
Sender cannot deny signing.
Internet / Download
THE KEY PAIR
MATCH
Private Key USE Authentic
3. Verify w/
Kept secret by publisher. Signs the R + Public Key
hash.
SIDE File Sig Math Check
FAIL
Tampered
Public Key
Shared with everyone. Verifies the
signature.
Critical: Always verify the Public Key fingerprint from a secondary channel (e.g., Twitter, Keybase).
Hands-On: Verify Signatures
Step-by-step commands to validate authenticity using GPG & OpenSSL. Linux macOS WSL/Git Bash
GPG (GnuPG) Verification OpenSSL Verification
Standard for Linux ISOs & software packages. Common for certificates and SSL/TLS checks.
1. Import Public Key Once per vendor Verify with Public Key (PEM)
gpg --keyserver hkps://[Link] --recv-keys 0xKEYID
openssl dgst -sha256 -verify [Link] -signature [Link] [Link]
# Output: public key "Linux Mint" imported
Verified OK
2. Verify Signature File .sig / .asc
Verify PKCS#7 / S/MIME
gpg --verify [Link] [Link]
openssl smime -verify -in msg.p7s -inform DER -content [Link]
gpg: Good signature from "Release Team"
Primary key fingerprint: 27DE B156...
NATIVE OS TOOLS
Windows (PowerShell) macOS (Terminal)
"WARNING: This key is not certified..."
This is normal if you haven't personally signed the key. Check the "Good signature" line and verify the Get-AuthenticodeSignature .\[Link]
codesign --verify --deep --strict [Link]
fingerprint manually.
Real-World Applications
Where hashing and signatures protect digital infrastructure daily. Infrastructure Security
CONSUMER SYSTEM DEVELOPMENT
Software Distribution Package Managers Code & Commit Signing
Essential for verifying OS images (ISOs), drivers, and Tools like APT, YUM, and NPM automatically verify GPG Developers sign Git commits and release tags to prove
cryptocurrency wallets to prevent backdoor injection. signatures of repository metadata before installation. authorship and prevent unauthorized code injection.
Linux Mint / Ubuntu Python Pip Git
$ sha256sum -c SHA256SUMS $ pip install --require-hashes -r [Link] $ git log --show-signature
COMMUNICATION
Container Supply Chain
# Verify image authenticity Secure Email
$ cosign verify --key [Link] [Link]/org/app:v1.0 PGP and S/MIME allow users to sign emails. This adds a "Digital
"Digital Seal" proving the sender's identity.
Verified
Modern cloud security uses "Sigstore" and "Cosign" to sign container
container images. This ensures that the code running in production
production (Kubernetes) matches exactly what was built in CI/CD. Signed & Encrypted
Identity Verified by
CI/CD.
OpenPGP
08. Summary & Cheat Sheet
Your pocket reference for secure file verification. Save for later
Key Takeaways Command Reference
Hash = Integrity
GENERATE HASH (SHA-256)
Answers: "Did the file change?" but not "Who sent it?"
Linux sha256sumfilename
Signature = Auth + Integrity
Answers: "Did the owner sign this?" + "Is it intact?"
macOS shasum -a 256filename
Avoid MD5 / SHA-1
Vulnerable to collision attacks. Use SHA-256 Win certutil -hashfilefilenameSHA256
instead.
PS Get-FileHashfilename-Algorithm SHA256
VERIFY SIGNATURES (GPG & OPENSSL)
Your Mission
GPG Import gpg --keyserverurl--recv-keysKEYID
Download a Linux ISO (e.g., Ubuntu).
GPG Verify gpg --[Link] [Link]
Find the SHA256SUMS file.
Verify the hash locally. OpenSSL openssl dgst -sha256 -[Link] data
Import the release team's GPG key.
Pro Tip: On Linux/Mac, you can pipe to verify: echo "hash filename" | sha256sum -c -
"Trust, but verify."