Learning Outcomes
Chapter 5. Code and Coding Schemes At the end of this lesson, you should be able to:
▪ Identify coding schemes in daily life and law enforcement
▪ Encode and decode information
▪ Apply coding for security and privacy
For Criminology Students ▪ Demonstrate honesty and integrity in using codes
Introduction
What is a Code? Encoding vs Decoding
▪ A code is a system of symbols, letters, numbers, or signals used to
represent information, instructions, or messages in a form that can ▪ Encoding
be understood by those who know the system. o Converts plaintext (information) → ciphertext (code)
▪ Used for o Uses rules or formulas
o Efficiency
o Secrecy ▪ Decoding
o Identification o Converts ciphertext → plaintext
▪ Example o Requires a key
o Police codes
o Barcodes & QR codes
o Encryption systems
Example (Caesar Cipher) Real-Life Encoding
▪ Used in basic encryption
▪ Encrypt the word “MATH” using Caesar Cipher Shift = +3 ▪ NBI encrypts suspect’s data
Letter Value +3 Result
M 12 12+3 = 15 P
▪ Police secure communications
A 0 0+3 = 3 D
T 19 19+3 = 22 W
▪ Protects sensitive information
H 7 7+3 = 10 K
▪ Resulting ciphertext is ”PDWK”
Caesar Cipher Wheel
1
Purpose of Coding
3. Identification
[Link] (Efficiency) • Unique codes identify individuals
• Shorter communication = faster response • Examples
• Example: “10-20” = Location o National ID (PSN)
o Faster than full sentence o Employee ID
o Account numbers
2. Security (Encryption)
4. Data Integrity
• Protects sensitive data
• Ensures data is not altered
• Used in
• Used in
o Banking
o Credit card check digit
o Law enforcement
o Detects typing errors
o Messaging apps
Coding Schemes in Everyday Life
Ethics in Coding We use codes daily
▪ Codes = digital evidence ▪ Shopping
▪ Must not be altered ▪ Payments
▪ Integrity is critical in criminology ▪ Government systems
1. Barcodes FYI: How to read a barcode?
▪ A series of black and white stripes The EAN-13 (European Article Number) standard, is composed of four distinct sections that
found on products identify the country, manufacturer, and specific item.
▪ Machine-readable Breakdown of the Digits
▪ 880 (GS1 Prefix / Country Code). These first three digits represent the Global Standard
Purpose: 1 (GS1) Member Organization where the company is registered. The prefix 880 specifically
▪ Inventory indicates South Korea.
▪ Pricing ▪ 22030 (Manufacturer Code). The next five digits uniquely identify the company that
registered the product. In this case, it identifies Dong-A, the Korean manufacturer of the
Barcode Math pen.
▪ 8365 (Product Item Number). These four digits are assigned by the manufacturer to
Steps: identify this specific product: the My Gel 0.5mm Pen in Black.
1. Multiply digits (1 & 3 pattern)
2. Add results ▪ 9 (Check Digit): The final digit is used by scanners to verify that the entire code was read
3. Get remainder (mod 10) correctly. It is calculated using a standard mathematical formula (the Modulo 10 algorithm)
4. Compute check digit
based on the preceding 12 digits
2
2. QR Codes 3. ASCII (American Standard Code for
Information Interchange II) & Unicode
▪ Are square, black-and-white barcodes that ▪ Converts letters → numbers
store more data ▪ Example:
▪ Can contain: o A = 65
o Links to website o n = 110
o Payments o Filipino "₱" peso sign = 20B1
o Contact info o The "ñ" in Filipino names = 00F1)
QR Code Advantage Importance of Unicode
• Works even if damaged • Supports all languages
• Uses error correction math (Reed-Solomon • Prevents data errors
Error Correction) • Example: “ñ” vs “n”
4. PAGASA Warning System 5. Morse Code
▪ Uses dots and dashes
▪ Uses Threshold Function based
▪ Example: SOS → ••• _ _ _ •••
on x (amount of rainfall in mm) and t (time
in hours). Morse Code Timing
Yellow: 7.5 ≤ x ≤ 15 per hour (Monitor). • Dot = 1 unit
Orange: 15 ≤ x ≤ 30 per hour (Alert). • Dash = 3 units
Red: x ≥ 30 per hour (Evacuate). • Word space = 7 units
▪ Provide real-time alerts for heavy rainfall,
SOS with a Flashlight
flooding, and landslide risks • The "S": Turn the light ON for 1 second, OFF for 1 second. Repeat 3 times.
▪ The If-Then" logic allows the NDRRMC to • The "O": Turn the light ON for 3 seconds, OFF for 1 second. Repeat 3 times.
trigger automated SMS alerts • The "S": Turn the light ON for 1 second, OFF for 1 second. Repeat 3 times.
• The Pause: You stay dark for 7 seconds before starting the first "S" again.
6. ZIP Codes & Mapping 7. Biometric Systems
▪ Uses geocoding that converts ▪ A security technology that authenticates or
postal codes into precise latitude identifies individuals by analyzing unique
and longitude coordinates. biological or behavioral traits, such as
address → coordinates fingerprints, facial features, iris patterns, or
▪ Used in crime mapping vein structure Automated Fingerprint Identification System (AFIS)
▪ PNP can identify ▪ Uses vector math to turn fingerprints or
"hotspots" human face into a set of coordinates
Converts physical features → numbers
(biometric template / feature vector)
o Fingerprint
Biometric Attendance System Fingerprint Recognition
o Facial Recognition
3
Coding Schemes in Criminology & Law Enforcement
1. PNP 10-Codes 2. Phonetic Alphabet
▪ Set of numerical signals, to maintain ▪ The NATO phonetic
quick and secure radio communication alphabet assigns 26 code words
during PNP operations (Alfa-Zulu) to the letters of the
▪ Help officers relay critical information English alphabet to minimize
(status updates, emergency requests, or communication errors over radio
crime reports) clearly and quickly or telephone
without clogging radio frequencies ▪ Avoids confusion
▪ Examples: ▪ Example
o 10-4 = Acknowledged (OK/Roger) o If a getaway car has the plate ABC 123,
the officer would command
o 10-20 = Location "Apprehend vehicle with plate Alfa-
o 10-33 = Emergency Bravo-Charlie, One-Two-Tree.
3. The LTO Number Coding Scheme 4. Vehicle Identification Number (VIN)
▪ A traffic-decongestion system in the ▪ A unique 17-digit alphanumeric code assigned to vehicles, acting
Philippines that restricts vehicles from as a "fingerprint" to identify the manufacturer, specifications,
major roads based on the last digit of and history.
their license plate ▪ Often referred to as the chassis number, located on the
▪ Uses a Modulo 10 function (one-in- dashboard, driver-side door, or engine firewall. You can find it
five rule) to determine prohibited on your Certificate of Registration (CR)
travel days ▪ Uses checksum calculation to verify authenticity, if the calculated
▪ Reduce traffic volume by 20%/day As of 2026, the coding hours in Metro Manila are from
morning rush hours 7:00 AM to 10:00 AM and evening rush check digit (9th digit) doesn't match the stamped one, the vehicle
▪ Example hours 5:00 PM to 8:00 PM, every Monday to Friday,
excluding weekends and official holidays of Philippines. is flagged as fraudulent
o If your vehicle plate number NAA 1234, 1234
(mod 10) =4, you cannot bring it during coding
▪ Philippine National Police - Highway Patrol Group (PNP-HPG)
hours every Tuesday uses this to detect "chopped" or carnapped vehicles
Digital Forensics 5. Hashing (Secure Hash Algorithm 256 – SHA 256)
▪ The science of identifying, collecting, preserving, analyzing, and ▪ Converts data into a fixed-length string that acts as a "digital
presenting digital evidence from devices like computers and mobile fingerprint."
phones, ensuring it remains admissible in legal proceedings If data changes → hash changes
▪ Collects digital evidence and ensures data integrity ▪ Example: The PNP Anti-Cybercrime Group (ACG) uses hashing to ensure
evidence integrity. Under the Rules on Electronic Evidence, digital files are
▪ Example only admissible in a Philippine court if their "hash value" at the trial matches the
o On October 24, 2025, authorities raided a condominium (an AI-equipped scam hub) in value recorded at the time of seizure, proving the evidence was not tampered
Malate, Manila, arresting 39 individuals including 8 Chinese and 1 Taiwanese nationals with (no planted evidence).
involved in organized romance and cryptocurrency investment fraud. The suspects used fake
profiles on dating apps (romance scams) to defraud victims (invest in fraudulent
cryptocurrency platforms), with over 200 items of digital evidence, such as laptops and SIM
cards, seized during the operation
4
6. Encryption (AES-256)
▪ Protects files and communication
▪ Use complex algorithms to "scramble" data into ciphertext.
▪ Only authorized parties with the correct decryption key can reverse
this process to access the original information.
▪ Example: Law enforcement uses the Advanced Encryption Standard to
protect internal databases like the National Crime Information System
(NCIS), preventing fugitives from being alerted to warrants.
7. Fingerprint Classification 8. Modus Operandi Codes
▪ The Henry Classification System is a 10- ▪ Classifies crime types
digit manual method for sorting and ▪ The NBI and PNP use codes to categorize criminals
indexing fingerprints. o Akyat-Bahay
▪ Assigns numerical values to patterns o Budol-Budol
like Loops, Whorls, and Arches o Salisi Gang
▪ Used in databases ▪ These acts are coded in databases to help investigators link different
o The AFIS (Automated Fingerprint Identification crime scenes to the same syndicate.
System) at Camp Crame uses this coding to
search millions of records in seconds. By
searching only within specific classification
codes, the system significantly increases
identification speed
Automated Fingerprint Identification System (AFIS) Room
Coding for Identification, Privacy , and Security
1. PhilSys Identification System 2. Biometric Matching
▪ The PhilSys uses tokenization process ▪ Compare live, captured biometric data (such as fingerprints, iris
(replaces sensitive data with secure codes), patterns, or facial features) against stored templates in a database to
a core security feature designed to protect identify or verify an individual.
a registrant's permanent identity number ▪ Uses probability to confirm identity by calculating the likelihood
by using a surrogate number for daily that that two sets of biometric features belong to the same person.
transactions. ▪ Examples
▪ The PhilSys uses a 12-digit PhilSys PSN (Permanent) o The Biometric Matching Score (similarity score) is a numerical value generated
Number (PSN) which is a highly sensitive, PCN (Public) by the PhilSys Automated Biometric Identification System (ABIS) to determine
permanent code for each citizen. To the degree of similarity between a person’s live biometric data (scanned during a
transaction) and the reference data stored in the PhilSys Registry.
protect the user, a 16-digit PhilSys Card o Police officers run a fingerprint through AFIS to generate a Candidate List of
Number (PCN) is printed on the physical the most likely matches based on similarity scores.
card
5
3. Encryption (using complex mathematical algorithms) 4. Redaction
▪ Encryption based on prime factorization is like a high-security evidence locker
▪ The process of permanently removing or obscuring sensitive,
that is mathematically impossible to pick. It is easy to lock (encrypt data), you just
multiply two massive prime numbers together, but nearly impossible to break confidential, or personal information from documents, images, or
open because reversing the math (prime factorization) to find the original primes videos before public release. It is widely used in legal, government,
would take a supercomputer billions of years. This mathematical "one-way and business sectors to protect privacy, intellectual property, or
street" keeps your private data and transactions safe. national security.
o In the context of credit card scam, this math allows EMV chips to act like an
undercover agent that never reveals its true identity. Instead of transmitting your ▪ Example
actual card number, the chip uses these prime numbers to generate a unique, one-time- o Juvenile Records. In cases involving minors, all identifying information—
use "cryptogram" for every transaction. This ensures that even if a criminal intercepts including full names, school details, and dates of birth—is typically redacted
the data during a purchase, the information is a useless string of code that expires to comply with strict privacy laws protecting youth.
immediately, making "sniffing" or cloning the data a forensic dead end o Digital Evidence. For body-worn camera footage, automated tools are often
o When PNP operatives use encrypted apps (Signal/Telegram), the "Key" is a massive used to blur the faces of uninvolved bystanders or obscure the license
prime. Even if telecommunications providers (Globe/Smart) intercept the signal, they plates of vehicles not involved in the crime.
see only "Mathematical Noise" (Ciphertext).
Ethics in Coding
5. One-Time Passwords (OTP) A. Integrity of Evidence
▪ OTP logic provides secure, short-lived authentication ▪ Digital fingerprints (Hash Codes) prove that evidence remains unchanged
by generating a temporary 4–8 digit code via SMS, from the crime scene to the courtroom.
email, or app. The system validates this code once, ▪ Integrity means reporting the exact hash value. Under the Cybercrime
then invalidates it, preventing replay attacks. Prevention Act, manipulating these codes is a grave offense. An honest
Common types include Time-based One-Time officer respects the Mathematical Chain of Custody, ensuring that
Password (TOTP, 30–120s). evidence is never "planted" or modified.
▪ TOTP are Time-based codes for secure transactions. o The investigator connects the suspect's hard drive to a hardware write-blocker. This
Algorithm: Code = Hash (Secret Key + Time). device allows data to be read but physically prevents any writing or modification to the
original drive.
o In GCash or Maya transactions, the code is only o During court hearing, if the defense attorney can show that a hash value was never
mathematically valid for 60 seconds. This prevents recorded at the scene or that the hash of the evidence presented in court does not
"Replay Attacks" where a criminal tries to reuse an old match the original police log, the evidence may be ruled inadmissible. The hash is
code to access your digital wallet. the "mathematical testimony" that the digital proof is exactly what was found at the
crime scene
B. Privilege Access C. Accuracy in Reporting
▪ Privileged access refers to administrative control over systems. Access to ▪ When technical experts provide testimony or justifications, they must
sensitive data (encrypted data) is a privilege, not a right. It must be used bridge the gap between complex mathematics and human understanding
only for official purposes. with absolute honesty.
▪ Relevant laws include ▪ In the context of criminology and law enforcement, accuracy in reporting
o Republic Act 10173, Republic Act 6713, Cybercrime Prevention Act of 2012 is not just an administrative duty; it is a legal safeguard under the Data
▪ Example Privacy Act (RA 10173).
o Sharing a photo of a seized personal document or a suspect's private digital files on a o Falsifying Technical Data. Intentionally inflating or "rounding up" forensic measurements, such as
group chat before they are presented as evidence is a crime (Unauthorized calculating a blood-alcohol content of 0.049% and testifying it was "definitely over the 0.05% limit“,
Disclosure) and a violation of the Data Privacy Act of 2012, leading to both criminal is a criminal act of Perjury and a violation of the Data Privacy Act of 2012, which demands
prosecution and administrative dismissal. absolute accuracy in the processing of sensitive personal and legal information.
o Investigators use trigonometry (sine, cosine, and tangent) to determine the angle of impact for
o IT administrators within police departments have the power to delete logs or modify
bloodstains or the trajectory of a bullet. If an officer testifies that a shooter was standing at a
records. Integrity in this role means resisting the urge to protect a colleague by "wiping" a specific height based on this math, they must be able to justify every measurement. If they "round
record or altering evidence to favor the prosecution up" numbers to make the evidence fit a specific theory of the crime, they have committed a major
ethical violation known as biased interpretation
6
D. Transparency
▪ While security often requires some level of "security through obscurity" (hiding
details to prevent attacks), there is a fine line between protection and unethical Thank You!
hiding
▪ In criminology and law enforcement, Transparency ensures that actions are
legally defensible, while Obfuscation (deliberately making something unclear) is
viewed as a "red flag" for corruption or human rights violations.
▪ Coding should be used to support justice, not conceal wrongdoing.
o If a police officer conducts a buy-bust operation but intentionally omits the exact time of
the inventory in the report to hide a 3-hour delay, they are practicing obfuscation. In
Philippine courts, this lack of transparency often results in the dismissal of the
case because the "Chain of Custody" is considered broken.
o In 2023, the PNP's ICT units emphasized that all body camera footage must be uploaded
to a centralized server where the "code" prevents any individual officer from deleting or
editing the footage. This is an example of using coding to support justice by ensuring
transparency.