Skip to main content
The National Cipher Challenge

Reply To: Challenge 10B

A Tale of 2 Secrets Forums T.E.M.P.E.S.T. Challenge 10B Reply To: Challenge 10B

#115114
upsidedown
Participant

@Bookluvr18 the cipher encrypts pairs of plaintext letters to pairs of cards (four ciphertext letters). There are 283 unique pairs of cards, which is a small enough number that you can manually work out all of them using the grid published in case file 10.12 (as you said we, you can divide this work between you!).

You can put all the pairs you work out into this short Python program which will do the tedious work of decrypting everything:


# Lines that start with # are comments and are ignored by Python

# Fill in the full ciphertext here, by copying from the website.
ciphertext = "7CXS3H6S7CKSXDAS2CKS....."

# This is a dictionary called lookup.
#
# The bit on the left of the colon is a pair of cards (from the ciphertext)
# and the bit on the right is a pair of plaintext letters.
lookup = {
    "7CXS": "RE",
    "3H6S": "PO",
    "7CKS": "RT",
    "XDAS": "ON",
    "2CKS": "TH",

    # Add the rest here...
}

# Remove any unexpected letters.
ciphertext = "".join(
    letter for letter in ciphertext.upper()
    if letter in "A23456789XJQKCDHS"
)

# Break the ciphertext up into 4-letter sequences (2 cards)
card_pairs = [
    ciphertext[i:i+4]
    for i in range(0, len(ciphertext), 4)
]

# Use the lookup dictionary to convert pairs of cards into pairs of letters
letter_pairs = [
    lookup[card_pair] if card_pair in lookup else ".."
    for card_pair in card_pairs
]

# Print the result
print("".join(letter_pairs))

Assuming you’re using Windows: install Python 3.13 from Microsoft Store, then open IDLE. Click on File > New, paste the program above into the new window, and save as 10b.py then copy and paste the full ciphertext into the indicated place in the program. Click Run > Run Module and you will see a partial decryption. You can now add more pairs to the lookup structure in the program until you have the full plaintext.

Report a problem