Safe Computing
CPT requirements and PPR Blog
Ian Manangan
Safe Computing Hacks & Homework Hacks
Popcorn Hack 1: Cookies
- Name:
user_session
- Value:
hTrkM5JdlI29MnSR2P
- Expiration Date:
2026-07-23T09:58:21.TRJ3
- Category: First-Party Cookie
Popcorn Hack 2: CAPTCHA
- The CAPTCHA contains 3 boxes:
- First: Square 3×1
- Second: Square 2×2
- Third: Square 3×2
MCQ Popcorn Hack 1: Multiple Choice Questions
- ✅ Multiple forms of identity verification before granting access
- ✅ Asymmetric Encryption
- ✅ Personally Identifiable Information
- ✅ Respecting privacy policies and obtaining user consent before collecting data
- ✅ Symmetric Encryption
- ✅ Verify the legitimacy of the email by contacting the bank directly through official contact methods
- ✅ A scam where an attacker tricks users into providing personal information by pretending to be a trustworthy entity
- ✅ The software could contain malware or viruses that compromise the computer’s security
- ✅ Even if the public key is known, only the private key can decrypt the message
- ✅ Alice’s public key
Code Popcorn Hack 2: Modified Caesar Cipher
import random
def caesar_cipher(text, shift, mode):
result = ""
for char in text:
if char.isalpha(): # Encrypts only letters
shift_amount = shift if mode == "encrypt" else -shift
new_char = chr(((ord(char.lower()) - 97 + shift_amount) % 26) + 97)
result += new_char.upper() if char.isupper() else new_char
else:
result += char # Keeps spaces and non-letter characters unchanged
return result
mode = input("Do you want to encrypt or decrypt? ").strip().lower()
message = input("Enter your message: ")
shift_input = input("Enter shift value (number of places to shift, or type 'random'): ").strip().lower()
if shift_input == "random":
shift = random.randint(1, 25)
print(f"Random shift value used: {shift}")
else:
shift = int(shift_input)
output = caesar_cipher(message, shift, mode)
print(f"Result: {output}")
import random
def caesar_cipher(text, shift, mode):
result = ""
for char in text:
if char.isalpha(): # Encrypts only letters
shift_amount = shift if mode == "encrypt" else -shift
new_char = chr(((ord(char.lower()) - 97 + shift_amount) % 26) + 97)
result += new_char.upper() if char.isupper() else new_char
else:
result += char # Keeps spaces and non-letter characters unchanged
return result
mode = input("Do you want to encrypt or decrypt? ").strip().lower()
message = input("Enter your message: ")
shift_input = input("Enter shift value (number of places to shift, or type 'random'): ").strip().lower()
if shift_input == "random":
shift = random.randint(1, 25)
print(f"Random shift value used: {shift}")
else:
shift = int(shift_input)
output = caesar_cipher(message, shift, mode)
print(f"Result: {output}")
Random shift value used: 13
Result: qnqql