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

  1. Multiple forms of identity verification before granting access
  2. Asymmetric Encryption
  3. Personally Identifiable Information
  4. Respecting privacy policies and obtaining user consent before collecting data
  5. Symmetric Encryption
  6. Verify the legitimacy of the email by contacting the bank directly through official contact methods
  7. A scam where an attacker tricks users into providing personal information by pretending to be a trustworthy entity
  8. The software could contain malware or viruses that compromise the computer’s security
  9. Even if the public key is known, only the private key can decrypt the message
  10. 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