Skip to main content

binhexa picoCTF 2024 Solution

Answer a series of prompts testing your knowledge of binary operations and hexadecimal conversion.

Published: April 3, 2024Updated: August 25, 2026

Description

How well can you perfom basic binary operations?

Additional details will be available after launching your challenge instance.

Port provided per instance

Launch the picoCTF instance so it assigns you a unique port number for your session.

Connect to titan.picoctf.net with that port via netcat to receive the randomized prompts.

bash
nc titan.picoctf.net <PORT_FROM_INSTANCE>

Solution

Want to try it yourself first?

The guided walkthrough reveals hints one step at a time.

Walk me through it
  1. Step 1Understand the challenge
    Observation
    The description promises basic binary operations, and the server randomizes the operands every session. There is no fixed answer to memorize, only the operators to apply carefully: AND, OR, shifts, addition, multiplication, and a hex conversion at the end.
    Each run gives a series of six questions that perform operations on two binary numbers. The values below are from one walkthrough; your connection will use different operands. Use the Binary Calculator tool for most of these conversions since it handles AND/OR, addition, multiplication, and bit shifts without mistakes.
    What didn't work first

    Tried: Trying to compute all six binary operations by hand without a tool.

    Binary multiplication and multi-step addition with carries are easy to get wrong under pressure. A single carry error early in a multiplication problem cascades into a completely wrong answer. Using the Binary Calculator tool eliminates this class of mistake entirely.

    Tried: Entering the final binary result directly instead of converting it to hexadecimal.

    The final prompt asks for the result in hex, so a raw binary string like 10000 is rejected. Group the bits into nibbles from the right and map each nibble to a hex digit: 10000 becomes 0x10.

    Learn more

    Binary is base-2 notation - numbers are represented using only the digits 0 and 1. Every bit position represents a power of 2 (1, 2, 4, 8, 16, ...), just as every digit in decimal represents a power of 10. Understanding binary arithmetic is foundational to all of computing: CPUs operate in binary at the hardware level, and bitwise operations are used everywhere from networking (subnet masks) to cryptography (XOR ciphers) to data compression.

    The six operations in this challenge cover the core bitwise and arithmetic operations:

    • AND (&) - outputs 1 only when both input bits are 1. Used for masking: isolating specific bits by ANDing with a mask.
    • OR (|) - outputs 1 when at least one input bit is 1. Used for setting bits: forcing specific positions to 1.
    • Left shift (<<) - shifts all bits left by N positions, appending zeros on the right. Equivalent to multiplying by 2^N.
    • Right shift (>>) - shifts all bits right by N positions, discarding the rightmost bits. Equivalent to integer division by 2^N.
    • Addition (+) - standard binary addition with carry propagation, identical in principle to decimal addition.
    • Multiplication (*) - binary long multiplication; equivalent to repeated addition and shifting.

    The final step asks you to convert the result to hexadecimal. Hex(base-16) is a compact representation of binary: each hex digit maps exactly to 4 binary bits (a "nibble"). Programmers use hex because it is far more readable than long binary strings - a 32-bit value needs 32 binary digits but only 8 hex digits.

Interactive tools
  • Number Base ConverterConvert numbers between binary, octal, decimal, and hexadecimal instantly. Enter any value and see all four bases update in real time.
  • Binary CalculatorPerform binary arithmetic (add, subtract, multiply, divide) with copyable outputs in every base.
  1. Compute 11010100 & 00100001

    Answer: 00000000

    Any overlapping 1 bits survive the AND; otherwise the result bit is 0.

  2. Compute 11010100 | 00100001

    Answer: 11110101

    OR preserves 1s from either operand. The Binary Calculator linked below makes this trivial.

  3. Multiply 11010100 * 00100001

    Answer: 1101101010100

    Binary multiplication mirrors base-10 long multiplication: stack the numbers and shift addends.

  4. Shift 11010100 left by 1 bit

    Answer: 110101000

    Appending a single 0 on the right multiplies the number by two.

  5. Compute 11010100 + 00100001

    Answer: 11110101

    Binary addition carries just like decimal math, so watch the carry chain in the middle bits.

  6. Shift 00100001 right by 1 bit

    Answer: 10000

    A right shift divides by two, chopping the least-significant bit.

Helpful resources

Flag

Reveal flag

picoCTF{b1tw^3se_0p3eR@tI0n_su33essFuL_aea...}

After answering all six prompts correctly, the service asks for the hexadecimal form of the final value (10000₂ = 0x10). Submit that answer to receive the flag above.

Key takeaway

Bitwise operations are the building blocks of low-level computing: CPUs implement arithmetic with them, network stacks apply subnet masks with AND, and most cryptographic primitives rest on XOR and rotation. Converting fluently between binary, decimal, and hex is what makes memory dumps, packet payloads, and disassembly readable. In exploit development, masks and shifts come up constantly when computing offsets, pulling struct fields apart, and building shellcode without null bytes.

Frequently asked questions

Common questions about the binhexa solution and the techniques it uses.

Why do the binary numbers change every time I reconnect?

The challenge server randomizes the two operands each session to force you to actually perform the operations rather than memorize a set of answers. The six operation types (AND, OR, left shift, right shift, addition, multiplication) and the final hex-conversion step stay the same, only the operands vary. That is why walking through with a tool like the Binary Calculator is faster than trying to compute by hand under a time limit.

What is the difference between a left shift and multiplication by 2?

A left shift by N positions is mathematically equivalent to multiplying by 2^N for non-negative integers, because each bit position represents a power of 2. CPUs implement shifts as a single cycle while multiplication takes several, so optimizing compilers routinely replace multiply-by-power-of-2 with shifts. In this challenge the << and * prompts can both show up; recognizing that 1010 << 2 equals 101000 (40 in decimal, same as 10 * 4) is the whole trick.

Why does the service ask for the hexadecimal form at the end?

After the six binary operations, you end up with a binary result (10000 in the walkthrough). Converting to hex groups the bits into nibbles of four: 10000 split from the right is 1 0000, which is 0x10. Hex is how bytes are commonly represented in real tools (memory dumps, network packets, cryptographic keys), so the challenge reinforces that you can move fluently between bases. Submitting 0x10 unlocks the flag.

Related reading

Tools used in this challenge

Where to go next