> For the complete documentation index, see [llms.txt](https://soyabeanboi.gitbook.io/bag-of-flags/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://soyabeanboi.gitbook.io/bag-of-flags/2022/uw-ctf-s22/0s-and-1s.md).

# 0s and 1s

## Description

> {% code overflow="wrap" %}
>
> ```
> 01110101 01110111 01100011 01110100 01100110 01111011 01100010 00110001 01101110 00110100 01110010 01111001 01011111 00111000 01100001 00110010 00110110 00110110 01100001 00111001 00110101 01100011 00110001 00110011 00110101 00110001 01100100 00110000 00110010 01111101
> ```
>
> {% endcode %}

## Binary Time :v:

As stated in the title **0s and 1s**, the provided text solely consists of 0s and 1s, which implies a binary string

{% hint style="info" %}
**Binary string** - Sequence of bytes (8 bits) where each byte represents a text character&#x20;
{% endhint %}

And the string is conveniently already split for us!

## Byte the Text

We can easily convert this string using online websites

{% embed url="<https://www.rapidtables.com/convert/number/binary-to-ascii.html>" %}

However, we could also code up a simple function in Python

```python
def binToText(binary):
    text = ""

    # Split the binary into bytes
    # Note this line may differ depending on the input
    binBytes = binary.split(' ')

    # Iterate over each byte
    for byte in binBytes:
        # Convert the base 2 byte into a base 10 number
        num = int(byte, 2)

        # Convert the number into its character counterpart
        char = chr(num)

        # Add to the string
        text += char
    
    return text
```

## Flag

`uwctf{b1n4ry_8a266a95c1351d02}`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://soyabeanboi.gitbook.io/bag-of-flags/2022/uw-ctf-s22/0s-and-1s.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
