
Boss: The Cipher Sphinx

Deep under Lantern Harbor lies the Signal Vault. Its door is guarded by the Cipher Sphinx, who speaks only in riddles.
"Bring me my riddle's answer," she purrs, "and prove it is true."
She hands you a packet of letters and a long fingerprint. The packet is wrapped in base64. Inside is a shift cipher with an unknown key. The fingerprint is the SHA-256 of the real message, so you can prove you cracked it correctly.
Assignment
shift_text and score are ready for you.
unwrap(packet)opens the base64 envelope: decode the packet withbase64.b64decodeand return it as UTF-8 text.crack(secret, words)tries all 26 keys (keykdecodes withshift_text(secret, -k)) and returns the best-scoring message. On a tie, keep the smallest key.fingerprint(text)returns the SHA-256 hex digest of the text's UTF-8 bytes.open_vault(packet, words, seal)unwraps and cracks the packet. If the message's fingerprint equalsseal, return the message. Otherwise return"The Sphinx shakes her head."- Print
open_vault(PACKET, WORDS, SEAL).
These are learning tools, not real protection. Real secrets need real encryption, written and checked by security experts.
shift_text and score are ready for you.
unwrap(packet)opens the base64 envelope: decode the packet withbase64.b64decodeand return it as UTF-8 text.crack(secret, words)tries all 26 keys (keykdecodes withshift_text(secret, -k)) and returns the best-scoring message. On a tie, keep the smallest key.fingerprint(text)returns the SHA-256 hex digest of the text's UTF-8 bytes.open_vault(packet, words, seal)unwraps and cracks the packet. If the message's fingerprint equalsseal, return the message. Otherwise return"The Sphinx shakes her head."- Print
open_vault(PACKET, WORDS, SEAL).
These are learning tools, not real protection. Real secrets need real encryption, written and checked by security experts.
Press Run to try your code, then Check to test it.