Skip to content

Latest commit

 

History

History
66 lines (42 loc) · 2.69 KB

README.md

File metadata and controls

66 lines (42 loc) · 2.69 KB

picoGYM: 2Warm

Author: Sanjay C/Danny Tunitis

General_Skills category Score: 50

Description

Can you convert the number 42 (base 10) to binary (base 2)?

Hints

Hint 1 Submit your answer in our competition's flag format. For example, if your answer was '11111', you would submit 'picoCTF{11111}' as the flag.

Summary

You can either just use an online converter or take that as an oppurtunity to recap binary numbers.

I wrote a script to change the base of a number some time ago so I used that.

How to change decimal to binary?

There are a lot of tutorials how to do that online. However a short summary:

Binary numbers can be represented in decimal as formula + formula + formula + formula + formula

Analogous the change from decimal to binary can be done by calculating the prefactors. This can be done using the logarithm to base two.

Some prerequisites for the calculation:

formula with formula and formula being logarithms to any base.

⌊x⌋ denotes the floor function: E.g. ⌊2.8⌋=2, ⌊2.1⌋=2;

formula

formula

formula

formula

formula

So the 1st, 3rd and 5th bit are one, the remaining bits are all zero:

101010
Note: Bits are counted from right to left and include the 0th bit

Flag

Show flag
picoCTF{101010}