User Rating 0.0 β˜…β˜…β˜…β˜…β˜…
Total Usage 0 times
Src:01234567
Dst:76543210
ASCII only (code points 0–127) 0 chars
Is this tool helpful?

Your feedback helps us improve.

β˜… β˜… β˜… β˜… β˜…

About

Every ASCII character occupies 8 bits. Rearranging those bits according to a fixed permutation vector P produces a different byte value - visually garbled text that is trivially reversible if P is known, but opaque otherwise. This is not encryption; it provides zero cryptographic security. It is, however, a useful primitive for obfuscation layers, CTF challenges, steganographic carriers, and educational demonstrations of bijective mappings at the bit level. A malformed permutation (duplicate indices, out-of-range values) silently destroys data because the mapping is no longer bijective. This tool validates the permutation before processing and computes the inverse automatically, eliminating that class of error.

The tool operates entirely in-browser on code points 0 - 127 (strict 7-bit ASCII). Characters outside this range are rejected with positional feedback. Pro tip: if you chain two different permutation vectors, the composite is itself a permutation - compute it by applying P2 after P1 to the identity vector.

ascii bit manipulation binary permutation encoder decoder byte shuffle bitwise

Formulas

Given an input byte B with bits b0b1…b7 (MSB-first, where b0 is bit 7) and a permutation vector P of length 8, the shuffled byte Bβ€² is computed as:

Bβ€² = 7βˆ‘i=0 bit(B, P[i]) Γ— 2(7 βˆ’ i)

where bit(B, k) extracts the k-th bit (counting from MSB = 0). The inverse permutation Pβˆ’1 satisfies:

Pβˆ’1[P[i]] = i   for all   i ∈ {0, 1, …, 7}

where P[i] = source bit index that maps to output position i, Bβ€² = shuffled output byte, bit(B, k) = value of bit at position k in byte B (0 or 1). A valid permutation must be a bijection on the set {0, 1, …, 7}: every index appears exactly once. The number of distinct permutations is 8! = 40320.

Reference Data

Permutation NameVector P[0…7]DescriptionInverse Vector
Identity0 1 2 3 4 5 6 7No change; output equals input0 1 2 3 4 5 6 7
Reverse7 6 5 4 3 2 1 0Mirror all bit positions7 6 5 4 3 2 1 0
Rotate Left 11 2 3 4 5 6 7 0Circular left shift by 17 0 1 2 3 4 5 6
Rotate Left 22 3 4 5 6 7 0 1Circular left shift by 26 7 0 1 2 3 4 5
Rotate Left 33 4 5 6 7 0 1 2Circular left shift by 35 6 7 0 1 2 3 4
Swap Nibbles4 5 6 7 0 1 2 3Exchange upper and lower 4 bits4 5 6 7 0 1 2 3
Interleave0 2 4 6 1 3 5 7Even indices first, then odd0 4 1 5 2 6 3 7
De-interleave0 4 1 5 2 6 3 7Inverse of Interleave0 2 4 6 1 3 5 7
Butterfly7 0 6 1 5 2 4 3Alternating outside-in mapping1 3 5 7 6 4 2 0
Odd-Even Swap1 0 3 2 5 4 7 6Swap adjacent bit pairs1 0 3 2 5 4 7 6
DES IP Subset5 0 3 6 1 4 7 2Inspired by DES initial permutation (scaled to 8 bits)1 4 7 2 5 0 3 6
Fibonacci Scatter0 1 1 2 3 5 0 2INVALID - duplicate indices; tool rejects this -
High-Low Split4 5 6 7 3 2 1 0Upper nibble first, lower reversed7 6 5 4 0 1 2 3
Bit Cascade6 4 2 0 7 5 3 1Even positions descending, odd descending3 7 2 6 1 5 0 4
AES ShiftRow-ish0 3 6 1 4 7 2 5Row-shift pattern scaled to 8 bits0 3 6 1 4 7 2 5

Frequently Asked Questions

The vector P has 8 entries. Entry P[i] means: "take the bit at position P[i] in the source byte and place it at position i in the output byte." Positions are numbered 0-7 from MSB to LSB. For example, P = [7,6,5,4,3,2,1,0] reverses all bits, so source bit 7 (LSB) becomes output bit 0 (MSB).
The mapping ceases to be bijective. Two output positions would source from the same input bit, and at least one input bit would be lost entirely. The tool validates the vector before processing and rejects any vector where the sorted values do not equal [0,1,2,3,4,5,6,7]. This prevents silent data destruction.
With a known-plaintext fragment (e.g., a common header like "HTTP" or a file signature), you can deduce P by comparing input and output bit patterns for each known character. Without any known plaintext, brute force over 8! = 40320 permutations is trivially feasible on modern hardware in under a second.
No. It is a monoalphabetic substitution cipher at the byte level. Each input byte always maps to the same output byte under a fixed P. Frequency analysis on the output reveals the permutation quickly. Use it for obfuscation, education, or as one layer in a composite scheme - never as standalone security.
ASCII characters fit in 7 bits (positions 1-7; position 0 is always 0). Shuffling can move a 0-valued MSB into a lower position and a 1-valued bit into the MSB, producing byte values 128-255 that fall outside printable ASCII. The tool handles this by displaying output in hexadecimal or escaped format when shuffled bytes exceed code point 126 or fall below 32.
Apply P1 first, then P2. The composite vector C is computed as C[i] = P1[P2[i]] for each i in 0-7. The tool's preset system lets you select named permutations; to compose manually, encode with P1, then encode the result with P2, or compute C offline and enter it as a custom vector.