# CTF Challenge Walkthrough: Logical Operations

The challenge in this walkthrough asked for the result in decimal of 4A & 2D. Competitors typically attempt a mathematical addition operation on these numbers, but that will not achieve the desired result. As per usual when I create challenges, I give a subtle clue, which in this case was the use of an ampersand versus a plus sign.

The first thing to figure out is what type of numbering system is represented. For the uninitiated, a google search of “numbering system with letters” might help identify these characters as hexadecimal. Hexadecimal (represented as 0x) is a base 16 numbering system, as compared to decimal (base 10) or binary (base 2). Hexadecimal characters range from 0-F.

There are only 10 kinds of people in the world, those who understand binary and those who don’t.

There are a couple of different ways to tackle this challenge. One way is to start by converting the hexadecimal characters to binary and then convert to decimal, since that is our desired output format. This is easily done with a calculator or online service, but we will step through it the manual way.

Hex: 4A = Binary: 0100 1010 = Decimal: 74

How did I come up with those numbers?

Nibble (4 bits or ½ of a byte) bit position values are 8–4–2–1, which is derived…