#ctf #bit #binary-encoding #converter

bin+lib rune-binary

Binary representation encoder and decoder — converts bytes to 01010101 bit strings

1 unstable release

Uses new Rust 2024

new 0.1.0 May 10, 2026

#11 in #ctf

MIT license

13KB
199 lines

rune-binary

Binary (01010101) representation encoder and decoder.

crates.io docs.rs license CI

What it does

Converts raw bytes to their 8-bit binary string representation and back. Security researchers and CTF players use it to inspect data at the bit level, analyze binary protocols, and verify bit manipulation results.

Installation

[dependencies]
rune-binary = "0.1"

Usage

use rune_binary::{encode, encode_compact, decode};

// Space-separated: one group of 8 bits per byte
assert_eq!(encode(b"AB"), "01000001 01000010");

// Compact: all bits joined together
assert_eq!(encode_compact(b"AB"), "0100000101000010");

// Both forms decode identically
assert_eq!(decode("01000001 01000010").unwrap(), b"AB");
assert_eq!(decode("0100000101000010").unwrap(), b"AB");

CLI

rune-binary encode myfile.bin        # encode a file
echo -n "AB" | rune-binary encode -  # encode from stdin
rune-binary decode "01000001"        # decode a literal string
rune-binary decode encoded.txt       # decode from file
cat bits.txt | rune-binary decode -  # decode from stdin

Output

$ echo -n "Hi" | rune-binary encode -
01001000 01101001

License

MIT

Dependencies

~0.9–1.4MB
~26K SLoC