IIITK BetaLabs organized a CTF in collaboration with DefHawk on 7 Feb 2026. Below are detailed writeups for the 5 cryptography challenges.

Challenge 1: The Chef's Scrambled Receipt

File: 53cr37_n073.txt
Difficulty: Easy
Category: Cryptography
Resources: 53cr37_n073.txt | Challenge Guide

Description

A hex string is provided. Decode it to reveal the Base32 string. Solve the Base32 to get the flag.

Flag: CTK{1f_y0u_4r3_c0nfu53d_r34d_4g41n}

Challenge 2: The Exfiltrating Salad

File: evidence.pcap
Difficulty: Medium
Category: Forensics / Network Security / Cryptography
Resources: evidence.pcap | captured.txt

Description

A PCAP file containing network traffic. Analyze packets to find the particular TCP/IP stream dest. 192.168.48.40 port:8080 (looks like exfiltration activity). Visit IP in a browser to port 8080. Then try Gobuster for hidden directories or files."/backup" directory is discovered. Open the backup directory to find captured.txt (captured data from the exfiltration). Analyze captured.txt to find the flag. Hint given "common key" in the website. Solve by cribdragging.


Crib dragging is a classical cryptanalysis technique used to break XOR-based encryption, especially when: The same key (or keystream) is reused to encrypt multiple messages (for example: one-time pad reuse or stream cipher keystream reuse)

Solution

Flag: CTK{m4ny_71m3_p4d_15_br0k3n}

Challenge 3: The Chef’s Melancholy

File: salad.png
Difficulty: Medium
Category: Steganography / Cryptography
Resources: salad.png

Description

The gibberish text hints at Caesar cipher. "JAR{7o475_do47_5o3_541k}". Solve it using any Caesar cipher decoder or by manual shifting. You get the flag. "CTK{7h475_wh47_5h3_541d}"

An innocent-looking PNG image is also attached, which hides a secret message. Extract it using steganography techniques.

Solution

Common approach:

# Try openstego
openstego extract \ -sf salad.png \ -p "CTK{7h475_wh47_5h3_541d}"

Flag: CTK{0p3n_573g0_15_fun}

Challenge 4: The Chef’s "Optimized" RSA

File: output.txt
Difficulty: Hard
Category: Number Theory / Cryptanalysis
Resources: output.txt

Description

RSA ciphertext is given along with public parameters N and e. Decrypt it to find the flag.

Given:

Solution

To break RSA, we need to factor N or detect weak parameters:

from Crypto.Util.number import long_to_bytes

N = [large modulus]
e = 65537
ct = [ciphertext]

phi = (N - 1)
d = pow(e, -1, phi) # Modular inverse
plaintext = pow(ct, d, N)
flag = long_to_bytes(plaintext)
print(flag.decode()) # Output: CTK{0ne_pr1m3_15_4_r3c1p3_f0r_d1545t3r}

Flag: CTK{0ne_pr1m3_15_4_r3c1p3_f0r_d1545t3r}

Challenge 5: The Chef’s “Perfectly Repeated” Encryption

File: server.py
Difficulty: Hard
Category: Cryptanalysis / Oracle Attacks
Resources: server.py

Description

An AES ECB oracle server appends a flag to user input before encryption. Exploit ECB's deterministic nature to recover the flag byte-by-byte.

Server Behavior

payload = user_input + FLAG
ciphertext = AES_ECB_encrypt(pad(payload, 16))

Solution: ECB Byte-by-Byte Extraction

AES block size is 16 bytes. Each 16-byte block encrypts independently:

Attack Steps:

Python Exploitation: client.py

from pwn import *
import string
import time

# --- CONFIGURATION ---
HOST = '192.168.48.40'
PORT = 1337
BLOCK_SIZE = 16
# ---------------------
.
.
.

if __name__ == "__main__":
    solve()

Key Takeaways

BACK TO WRITEUPS ->