Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Pulseprint Decoder Challenge

Problem Statement

Fred unearthed an old communication device and found a file filled with dots, tabs, and spaces. It looks like random noise, but it's actually a pulseprint - a faint signal left by low-level hardware.

Your task: Decode the pulses, turn them into bits, rebuild the bytes, and uncover the hidden message.

Beware! The sender loved padding his encoders with clutter. Some dots are just distractions. Focus on the whitespaces; they hold the truth.

Encoder Logic Fragment

The following base64-encoded fragment reveals how the message was encoded:

ICAgIGZvciBsZXR0ZXIgaW4gdGV4dDoNCiAgICAgICAgYmluYXJ5ID0gInswOmJ9Ii5mb3JtYXQob3JkKGxldHRlcikpDQogICAgICAgIGN1cnIgKz0gIi4gLiAuIC4gLiAuIg0KICAgICAgICBmb3IgYml0IGluIGJpbmFyeToNCiAgICAgICAgICAgIGlmKGJpdCA9PSAnMScpOg0KICAgICAgICAgICAgICAgIGN1cnIgKz0gIi5cdCINCiAgICAgICAgICAgIGlmKGJpdCA9PSAnMCcpOg0KICAgICAgICAgICAgICAgIGN1cnIgKz0gIi4gIg0KICAgICAgICBjdXJyICs9ICIuXG4uXHQuXG4iDQoNCiAgICBjdXJyICs9ICIuIC4gLlxuIg==

Decoded, this reveals:

for letter in text:
    binary = "{0:b}".format(ord(letter))
    curr += ". . . . . ."  # padding (noise)
    for bit in binary:
        if(bit == '1'):
            curr += ".\t"  # dot + TAB = bit 1
        if(bit == '0'):
            curr += ". "   # dot + SPACE = bit 0
    curr += ".\n.\t.\n"   # separator between letters

Solution

Understanding the Encoding

The key insight is that whitespace characters encode the binary data, not the dots themselves:

  • .\t (dot followed by TAB) = binary 1
  • . (dot followed by SPACE) = binary 0
  • . . . . . . = padding/noise (ignore)
  • .\n.\t.\n = separator between characters

Decoding Steps

  1. Parse each line of the pulseprint file
  2. Skip padding and separators (they're just noise)
  3. Extract binary digits by checking whitespace after dots:
    • TAB → 1
    • SPACE → 0
  4. Convert binary to ASCII for each character
  5. Concatenate characters to reveal the hidden message

Python Solution

def decode_pulseprint(pulseprint_text):
    lines = pulseprint_text.strip().split('\n')
    message = []
    
    for line in lines:
        # Skip separator lines
        if line.strip() in [".", ".\t."]:
            continue
        
        # Extract binary from whitespace pattern
        binary = ""
        i = 0
        while i < len(line):
            if line[i] == '.':
                if i + 1 < len(line):
                    if line[i + 1] == '\t':
                        binary += '1'  # Tab = 1
                        i += 2
                    elif line[i + 1] == ' ':
                        binary += '0'  # Space = 0
                        i += 2
                    else:
                        i += 1
                else:
                    i += 1
            else:
                i += 1
        
        # Convert binary to character
        if binary:
            try:
                char_code = int(binary, 2)
                if 32 <= char_code <= 126:  # Printable ASCII
                    message.append(chr(char_code))
            except ValueError:
                pass
    
    return ''.join(message)

# Read the pulseprint file
with open('pulseprint.txt', 'r') as f:
    pulseprint = f.read()

# Decode and print the flag
flag = decode_pulseprint(pulseprint)
print(f"Flag: {flag}")

Quick Usage

  1. Save the pulseprint data to pulseprint.txt
  2. Run the decoder script
  3. The hidden message/flag will be revealed

Key Takeaways

  • Don't be distracted by dots - they're padding
  • Whitespace is the signal - tabs and spaces encode binary
  • Pattern recognition - understanding the encoding scheme is critical
  • Simple parsing - once you know the pattern, extraction is straightforward

Challenge Type

  • Category: Steganography / Encoding
  • Difficulty: Medium
  • Skills: Pattern recognition, binary encoding, whitespace analysis

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages