stegtext 0.1.0

Text steganography command-line tool and library.
Documentation
# stegtext

Text [steganography][] command-line tool and library.

## Command-Line Tool Examples

Hide secret message in text with the command-line tool:

```
# view contents of `input.txt`
$ cat input.txt
The Hitchhiker's Guide to the Galaxy is a 1979 science fiction comedy
novel by English author Douglas Adams, adapted from the first four parts
of his radio comedy series of the same name. It centres on the
misadventures of Arthur Dent, the only man to survive the destruction of
Earth, as he roams the cosmos and learns the truth behind his very
existence. The novel's namesake is an in-universe electronic travel
guide written in the form of an encyclopaedia, through which the story
is framed.

# check capacity
$ stegtext capacity < input.txt
23

# embed secret, write results to `encoded.txt`
$ stegtext encode 'secret message' < input.txt > encoded.txt

# view contents of `encoded.txt`
$ cat encoded.txt
Тhe Нitchhіkеr'ѕ Guide to the Galaxy іѕ a 1979 sсіеncе fiсtion соmedу
nоvel by Englіѕh author Dоuglas Аdаmѕ, adаptеd from the fіrѕt four partѕ
of hіѕ rаdio comedy ѕeriеs оf thе sаmе namе. It сentreѕ оn the
mіѕadventurеѕ оf Arthur Dеnt, thе only mаn tо ѕurvivе the destructіоn of
Еаrth, аs he rоаms thе cоsmoѕ аnd learns the truth behind his very
existence. The novel's namesake is an in-universe electronic travel
guide written in the form of an encyclopaedia, through which the story
is framed.

# extract secret from `encoded.txt`
$ stegtext decode < encoded.txt
secret message
```

## Rust Library Examples

Hide secret in text:

```rust
// secret
const SECRET: [u8; 5] = *b"hello";

// input text
const TEXT: &str = "\
Тhe Нitсhhikеr's Guіdе to thе Galaxy is a 1979 ѕcіеncе fiсtion соmedy
novеl bу Englіѕh author Douglаѕ Adаmѕ, adарtеd frоm the fіrѕt four parts
of hiѕ radiо соmedу ѕеriеѕ оf thе sаmе name.";

// expected output
const EXP: &str = "\
Тhe Нitсhhikеr's Guide to the Galaxy is a 1979 ѕcіеncе fiсtion соmedy
novеl bу Englіѕh author Douglаѕ Adаmѕ, adарtеd frоm the fіrѕt four parts
of hiѕ radiо соmedу ѕеriеѕ оf thе sаmе name.";

// encode secret, check result
assert_eq!(stegtext::encode(&SECRET, TEXT)?, EXP);
```

Get secret from text:

```rust
// text with embedded secret
const TEXT: &str = "\
Тhe Нitсhhikеr's Guide to the Galaxy is a 1979 ѕcіеncе fiсtion соmedy
novеl bу Englіѕh author Douglаѕ Adаmѕ, adарtеd frоm the fіrѕt four parts
of hiѕ radiо соmedу ѕеriеѕ оf thе sаmе name.";

// decode secret, check result
assert_eq!(stegtext::decode(TEXT)?, "hello");
```

Get text embedding capacity:

```rust
// input text
const TEXT: &str = "\
Тhe Нitсhhikеr's Guіdе to thе Galaxy is a 1979 ѕcіеncе fiсtion соmedy
novеl bу Englіѕh author Douglаѕ Adаmѕ, adарtеd frоm the fіrѕt four parts
of hiѕ radiо соmedу ѕеriеѕ оf thе sаmе name. Іt centrеѕ оn the
misаdvеntureѕ оf Arthur Dent, the оnly man tо ѕurvive the destruction of
Earth, as he roams the cosmos and learns the truth behind his very
existence. The novel's namesake is an in-universe electronic travel
guide written in the form of an encyclopaedia, through which the story
is framed.";

// calculate capacity, check result
assert_eq!(stegtext::capacity(TEXT), 23);
```

[steganography]: https://en.wikipedia.org/wiki/Steganography
  "Steganography (Wikipedia)"
[utf-8]: https://en.wikipedia.org/wiki/UTF-8
  "UTF-8 (Wikipedia)"
[homoglyph]: https://en.wikipedia.org/wiki/Homoglyph
  "Homoglyph (Wikipedia)"
[homoglyphs]: https://en.wikipedia.org/wiki/Homoglyph
  "Homoglyph (Wikipedia)"
[idn homograph attack]: https://en.wikipedia.org/wiki/IDN_homograph_attack#Cyrillic
  "IDN homograph attack (Wikipedia)"