Caesar

Hack-The-Boo-2024 Practice: Sekur Julius Writeup

Hack-The-Boo-2024 Practice: Sekur Julius Writeup

Challenge Overview

Challenge Name Category Difficulty Link
Sekur Julius Crypto Very Easy Link to Challenge

Description

Hidden deep in the forest was an ancient scroll, rumored to grant immense power to anyone who could read its shifting symbols. On Halloween, a curious traveler found the scroll, its letters strangely out of order. As they deciphered the message, the words slowly rearranged themselves, revealing a dark spell. But with the final shift, the traveler felt a cold presence behind them, whispering, "You were never meant to understand." The forest grew silent, but the spell was already cast.

Process

Upon downloading the assistive ZIP file, I found two files: output.txt and source.py.

Contents of output.txt

LTARDBT0ID0WPRZIWTQDD0ILDIWDJHPCSILTCINUDJG!

0IWXH0XH0P0EGDDU0DU0RDCRTEI0ID0EGDKT0NDJ0IWPI0IWT0RPTHPG0RXEWTG0XH0XCHTRJGT0CD0BPIITG0WDL0BPCN0IXBTH0NDJ0PEEAN0XI.
0IWT0HTRJGXIN0DU0P0IWDJHPCS0SXHIXCRI0HWXUIH0XH0TKTCIJPAAN0IWT0HPBT0PH0IWPI0DU0P0HXCVAT0HWXUI.
0TCDJVW0BJBQAXCV,0IPZT0NDJG0UAPV0PCS0TCYDN0IWT0GTHI0DU0IWT0RDCITHI.
0BPZT0HJGT0NDJ0LGPE0IWT0UDAADLXCV0ITMI0LXIW0IWT0WIQ0UAPV0UDGBPI0HTRJGXINDUPIWDJHPCSDGHTRJGXINDUPHXCVAT.

Contents of source.py

from random import choices 

def julius_encrypt(msg, shift): 
	ct = ''
	for p in msg:
		if p == ' ':
			ct += '0'
		elif not ord('A') <= ord(p) <= ord('Z'): 
			ct += p 
		else:
			o = ord(p) - 65
				ct += chr(65 + (o + shift) % 26) return ct 
				
def encrypt(msg, key): 
	for shift in key: 
		msg = julius_encrypt(msg, shift) 
	return msg 
	
msg = open('secret.txt').read().upper() secure_key = os.urandom(1337) 

with open('output.txt', 'w') as f: f.write(encrypt(msg, secure_key))