HyggeHalcyon
GithubLinkedIn
  • 🕊️whoami
  • 🚩CTFs
    • 2025
      • ARKAVIDIA Quals
      • TECHOMFEST Quals
    • 2024
      • BackdoorCTF
      • World Wide CTF
      • 7th Cyber Mimic Defense
      • TSA Cyber Champion
      • Cyber Jawara International
      • National Cyber Week Quals
      • COMPFEST 16 Finals
      • HackToday Finals
      • UIUCTF
      • TBTL CTF
      • BSidesSF CTF
      • UMD CTF
      • UMassCTF
      • b01lers CTF
      • AmateursCTF
      • UNbreakable International - Team Phase
    • 2023
      • HackToday CTF Quals
        • Vnote
        • TahuBulat
        • Rangkaian Digital
      • Tenable CTF
        • Skiddyana Pwnz and the Loom of Fate
        • Braggart
      • CiGITS
        • afafafaf
        • popping around shell
        • well_known
      • TJCTF
        • flip out
        • shelly
        • groppling-hook
        • formatter
        • teenage-game
      • SanDiegoCTF
        • money printer
        • turtle shell
      • DeadSec CTF
        • one punch
      • FindIT CTF Quals
        • Debugging Spiders
        • Everything Machine
        • Furr(y)verse
        • Bypass the Py
        • Joy Sketching in the Matrix
        • Detective Handal
        • I Like Matrix
        • CRYptograPI
        • Date Night
        • Web-Find IT
        • Mental Health Check
        • NCS Cipher
        • Discovered
  • 🔍NOTES
    • FSOP
      • Structures
      • GDB
      • Arbitrary Read/Write
      • Vtable Hijack
    • Heap Feng Shui
      • Libc Leak
    • Kernel Space
      • Privilege Escalation
      • Objects
      • Escaping Seccomp
    • V8
      • Documentation
      • TurboFan
      • SandBox (Ubercage)
  • 📚Resources
    • Cyber Security
      • General
      • Red Teaming
        • CheatSheet
        • Payload Database
        • Quality of Life
      • Binary Exploitation
        • Return Oriented Programming
        • File Structure Oriented Programming
        • Heap Exploitation
        • Linux Kernel Exploitation
        • Windows Exploitation
        • V8 Browser
      • Reverse Engineering
        • Windows Executable
        • Malware Analysis
        • Tools
      • Web Exploitation
      • Malware Development
      • Detection Engineering
      • Blockchain / Web3
      • Cryptography
    • Software Engineering
  • 📋Planning
    • Quick Notes
Powered by GitBook
On this page
  • Problem
  • Solution
  • Flag
  1. CTFs
  2. 2023
  3. FindIT CTF Quals

CRYptograPI

Problem

Description

A Ngawi Spy was arrested in Lempuyangan Railway Station while eating a bread. He was arrested becuse he wanted to deliver an encrypted secret message to another spy. It was known that the message is encrypted by bitwise operating the message with decimal digits of Pi. Can you decrypt the secret message?

Message.txt

75 5b 5f 12 4d 12 51 50 47 15 5b 58 42 5e 5b 46 12 18 60 5e 5b 45 14 5a 40 18 47 5a 52 19 53 5c 53 5f 02 14 77 50 59 55 7f 6d 70 6d 7f 48 44 06 53 04 7c 73 5c 69 0d 68 5e 0d 5a 0d 74 57 6d 67 03 45 54 05 5a 61 6f 0f 77 5f 02 70 04 50 44

Hints
  • How many bitwise operation do you know?

  • Pi has unending decimal digits...

Solution

Quite straightforward, we search up for the decimal digits up to the same length as the ciphertext. Then we XOR each digits with the corresponding hex values. Initially I was a bit confused since I XORed each of the ciphertext with int(pi[i]) but it doesn't work.

Solve.py
cipher = '755b5f124d12515047155b58425e5b461218605e5b45145a4018475a5219535c535f0214775059557f6d706d7f48440653047c735c690d685e0d5a0d74576d67034554055a616f0f775f0270045044'
pi = '1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502840'

byte_cipher = bytes.fromhex(cipher)
decoded = []

for i in range(len(byte_cipher)):
    decoded.append(byte_cipher[i] ^ ord(pi[i]))

print(''.join(chr(i) for i in decoded))

Flag

FindITCTF{s3b4IKnY4_j4n9An_T3rl4lU_9Eg4B4h}

PreviousI Like MatrixNextDate Night

Last updated 1 year ago

🚩