Introduction to Cryptography
Review of Hashing
Using one or all of the tools/command, get the hash of juan.txt
md5deep64
certutil -hashfile
Get-FileHash
md5sum
Cryptography
Cryptography is the use of specialized codes and algorithms to secure information, making it unreadable to unauthorized individuals.
In law enforcement, it serves as a dual-edged sword: it’s used to protect sensitive data and evidence, but it can also be used by criminals to obfuscate or encrypt their communications and digital evidence, creating a major challenge for investigations.
It is commonly used for secure communications to prevent eavesdroppers from listening, and/or reading sensitive information.
Keywords
secure, encrypted, obfuscated, authorized
Digital Signature
A digital signature is a cryptographic “fingerprint” used to verify the authenticity and integrity of digital documents.
In law enforcement, it serves as a legally admissible method to prove that an electronic document, like an arrest warrant or evidence log, has not been tampered with and originated from a specific, verified source.
Keywords
verify, verified, authentic, authentication, integrity, untampered, non-repudiation
Cryptography is the use of specialized codes and algorithms to secure information, making it unreadable to unauthorized individuals.
The process of communication in the presence of adversaries.
Types of Cryptography
1. Symmetric-key
Uses a single, shared key for encryption and decryption.
Example - Caesar Cipher
https://cryptii.com/pipes/caesar-cipher
2. Asymmetric-key
Uses a pair of mathematically related keys - a Public Key for encryption and a Private Key for decryption.
Example 1 - Certificate Authorities
PNPKI - https://dict.gov.ph/pnpki
Example 2 - Decentralized PKI
DIDs (The Standard) - https://www.w3.org/TR/did-1.0/
Example 3 - Web of Trust
PGP, OpenPGP, GnuPG
https://www.progress.com/blogs/the-difference-between-pgp-openpgp-and-gnupg-encryption
GPG - Web of Trust
- Microsoft Endorsement - https://learn.microsoft.com/en-us/system-center/orchestrator/standard-activities/pgp-encrypt-file
- Windows Installer - https://www.gpg4win.org/get-gpg4win.htm
Tool Installation
Install GPG4Win using the Windows Install link above.
Generate your KeyPair
Open Terminal
on Windows, and go to C:\cert-ph
directory.
gpg --full-generate-key
- Type or select
9
forECC (sign and encrypt)
functionality, & press enter - Type or select
1
forCurve 25519
ECC algorith, & press enter - Type
1y
for1 year
key duration/expiry, & press enter
Identify your KeyID
gpg --list-keys --keyid-format long
[keyboxd] ———
pub ed25519/C317FBCB5B193D17 2025-09-26 [SC] [expires: 2026-09-26] F9603BC8A86CC5EE8CBBD2FBC317FBCB4B170D17 uid [ultimate] Juan de la Cruz jdelacruz@example.net sub cv25519/CE719CFDB2DD0736 2025-09-26 [E] [expires: 2026-09-26]
Extract your Public Key
gpg --armor --export {KeyID}
—–BEGIN PGP PUBLIC KEY BLOCK—–
mENFaNadhBYJKwYBBAHaRw8BAQdA0NQHsKJBpXrDy6DC2n01LLOi6R1m3vo4QKTI oKLiI4m0KlJheW1vbmQgT2xhdmlkZXMgPGFyZGllb2xhdmlkZXNAZ21haWwuY29t PoiZBBMWCgBBFiEE+WA82Khsxe6Mu9L7wxf7y1sXDRcFAmjWnYQCGwMFCQHhM4AF CwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgkQwxf7y1sXDRd2jAEAg6H4JKwh ZA+l8YyMXmCveNO6QWsTWFK63kHi+rj31q8BAPENOSGUcMugobzmEkeqogItrgjY hOfQmKx5XASwfIgFuDgEaNadhBIKKwYBBAGXVQEFAQEHQL88J9B5Bf9XrZYAivia 1Ek9gO6Tn7JgYkSB70/tqDB7AwEIB4h+BBgWCgAmFiEE+WA82Khsxe6Mu9L7wxf7 y1sXDRcFAmjWnYQCGwwFCQHhM4AACgkQwxf7y1sXDRezpgD/TI98JZMGtZeklb2U Wew7J8trhkKHXrPZvkHgXcZ77skBAOaxnPflXm8Pf4tpcT7Nh4Fi1G9G5fmKYk08 u2Bj9z8P =6GHj —–END PGP PUBLIC KEY BLOCK—–
Extract your Public Key to a File
gpg --armor --export {KeyID} > name.asc
Activity
Activity 1
ESTABLISHING YOUR WEB: Personal Emails
- Group yourselves into
4
, trusted buddies - Share to each other your personal emails
- Email to one another your Public Key, or your
.asc
file.
LOCAL WEB OF TRUST: Your Trusted Keys
- Download the Public Key shared to you.
- Import to your Web of Trust
gpg -i jdelacruz.asc
CHECK TRUSTED KEYS: Verify
- Verify that the trusted key has been imported correctly.
gpg --list-keys --keyid-format long
Activity 2
ENCRYPTING MESSAGES: Messages & Trusted Recipient
- Write down any sample message (non-sensitive) to a text file
- Encrypt the text file., and set intended recipient to you and 2 of your groupmate.
gpg -sea -r {KeyID} -r {Recipient_KeyID} file.ext
- The command above will create a file
file.ext.asc
- Email the file
file.ext.asc
to everyone on your group.
Activity 3
DECRYPTING MESSAGES: Only Trusted Can Decrypt
- Once you receive an email with encrypted attachment, download the attachment, and decrypt.
gpg -d file.ext.asc
ENCRYPTING LARGE FILES
- Encrypt the file. With a detached signature;
-b
option
gpg -bes -r {KeyID} -r {Recipient_KeyID} large_file.ext
- The command above will create a file
large_file.ext.asc
, this is thesignature_file
- If uploading on a hosting service, be sure to upload the
large_file.ext.asc
for recipient to validate the decryption
Note: large_file
should be the filename of your file. and ext
is the extension of your file.
DECRYPTING FILES
- Verify & Decrypt
gpg --version large_file.ext.asc large_file.ext
Info
The above commands will allow one to establish Confidentiality and Integrity of a file or data. The Availability of the public keys will discussed in a separated material.