#string #english #xor #u8 #determine #english-words #encoded-string

sbxor

Given a string, xor all 256 possible u8. Can determine English

3 releases

Uses old Rust 2015

0.1.2 Jun 22, 2018
0.1.1 Jun 18, 2018
0.1.0 Jun 18, 2018

#28 in #english-words

MIT license

8KB
100 lines

SBXOR

Purpose

Given an encoded string try all 256 bytes with a single byte xor operation across the string. Can determine if a string contains English

How to use

Add the crate to [dependencies] and specify the lastest version. Then bring it into scope by placing extern crate sbxor; followed by use sbxor::* in a source file where the functionality is desired.

How it works

Iterates over all 256 possible u8s and xors them against the provided string. Non-ascii characters are stripped. There will be 256 possible decoded strings, some having the is_english field set. The field indicates that there is an English word longer than 3 characters resulting from the xor process.


lib.rs:

Single byte XOR against string.

Sbxor takes a string argument that has been encoded with a single byte XOR. Following that it decodes it, and determines if it contains English words.

Dependencies

~29KB