--- Day 7: Forgot Password? ---
"Finally," you whisper to yourself, after sneaking into a quiet corner of the hotel's server room. For the first time in days, no one is shouting about urgent crises or imminent disasters. You take a sip of cocoa, watching the steam rise in lazy spirals. Maybe, just maybe, you'll have a peaceful evening. The gentle glow of monitor screens, the rhythmic blinking of status lights - this is exactly the kind of calm you've been craving.
Before you can finish your cocoa, Patch bursts into the room, frantically searching between monitors and under desks. She spots you, and you realise that the short break you had is certainly over. "We're locked out of the system!" Patch exclaims.
You suspect this might be a classic case of PICNIC (Problem In Chair, Not In Computer), but after listening to Patch, it becomes clear situation is more serious than usual. The hackers' attack has disrupted critical naughty-nice infrastructure. However, this should be a simple fix - just enter the password and restart the system.
"Ok, what's the password?" you ask.
"Duh," says Patch, rolling her eyes. "That's what I'm trying to tell you - we're locked out! If we knew the password, we wouldn't be locked out! The elves haven't restarted the system in so long that nobody can remember the password."
The system in question operates the essential Naughty or Nice List, making it vital to Christmas operations. Without access, there's no way to ensure that only those worthy of a Christmas treat are properly rewarded. You'll need to hack into the system to recover the data.
Thankfully, the elves planned for exactly this scenario: they use a password manager. Unfortunately, they used the same master password for the password manager as they did for the naughty-nice machine itself - which means you're still locked out.
"I've managed to pull together what the elves can remember about the master password," Patch explains. She hands you a document, with some information hastily scrawled on it. It reads:
HJPAdditionally, Patch recalls one crucial detail: the decrypted text should contain the actual password somewhere in its contents - after all, that's what password managers are for.
Can you decrypt the information in the password manager to allow Patch to unlock the system?
The elf password manager uses a unique encryption scheme to store passwords securely. The encryption process is as follows:
master_password[(row + column) % master_password.length] to each cell in the grid. Use 0-indexed rows and columns.Using the information that Patch can recall, decrypt the text stored in the password manager. Give your answer in upper case, without spaces or punctuation.
Example encryption process:
Input: abc DEF ghi JKL mn
After step 1: ABCDEFGHIJKLMN
After step 2:
A B C D
L M N E
K X X F
J I H G
After step 3:
G J I H
D A B C
E L M N
F K X X
After step 4:
6 9 8 7
3 0 1 2
4 11 12 13
5 10 23 23
Encryption master psasword numeric representation (using password SECRET=18 4 2 17 4 19):
18 4 2 17
4 2 17 4
2 17 4 19
17 4 19 18
After step 5:
24 13 10 24
7 2 18 6
6 2 16 6
22 14 16 15
After step 6:
Y N K Y
H C S G
G C Q G
W O Q P
Result: YNKYGGPQOWGHCSQC