Metadata-Version: 2.4
Name: recode-stamper
Version: 0.1.6
Summary: Encode and decode UTF-8 strings into a 12- or 24-word RECODE mnemonic.
Author-email: avra911 <java-hug-circulate@duck.com>
License: MIT License
        
        Copyright (c) 2026
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Keywords: recode,mnemonic,cli,encoding,python
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Security :: Cryptography
Classifier: Topic :: Utilities
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Recode Stamper

A small Python utility that encodes UTF-8 text into a 12- or 24-word mnemonic (RECODE) and decodes it back.

## Install from PyPI

```bash
pip install recode-stamper
```

## Quick start

After installation, use the CLI entry point:

```bash
recode --encode "MyPassword123!"
```

```bash
recode --decode "artist scavenge intimate airdrop humdrum curfew hexagon candy comedy bunion brevity aardvark"
```

Subcommands also work:

```bash
recode encode "MyPassword123!"
recode decode "artist scavenge intimate airdrop humdrum curfew hexagon candy comedy bunion brevity aardvark"
```

For interactive use, the CLI can also prompt for text securely without echoing it in the terminal:

```bash
recode --encode
recode encode
```

This is useful for avoiding accidental exposure in shell history or terminal logs.

Show help:

```bash
recode --help
```

If you are running directly from the repository checkout instead of the installed package:

```bash
python recode.py --encode "MyPassword123!"
python recode.py --decode "artist scavenge intimate airdrop humdrum curfew hexagon candy comedy bunion brevity aardvark"
```

## How the format works

The RECODE format uses a fixed 4096-word list.

- Each word is mapped to a 12-bit value
- 2^12 = 4096 unique values
- A word index is therefore a number from 0 to 4095

The format automatically selects between 12 and 24 words:

- up to 16 bytes of data -> 12 words
- 17 to 32 bytes of data -> 24 words
- more than 32 bytes -> rejected

This keeps the output compact while preserving enough space for metadata and a checksum.

You can also force the format explicitly:

```bash
recode --encode "MyPassword123!" --plates 12
recode --encode "MyPassword123!" --plates 24
```

## Why UTF-8

The encoder accepts UTF-8 text and converts it to bytes before packing the bit stream. This means it works for regular ASCII strings as well as non-ASCII text, while preserving deterministic behavior and a fixed wordlist layout.

## Wordlist source

The file `wordlist4096.txt` is based on the public wordlist from:

https://raw.githubusercontent.com/kklash/wordlist4096/main/wordlist4096.txt

Also check the [12-bit representation](./wordlist4096.md) of each of the 4,096 words.

## License

This project is licensed under the MIT License. See [LICENSE](LICENSE) for the full text.

The included wordlist is derived from the upstream source referenced above. Please check the original repository and license terms for the wordlist itself before using it in production or redistribution.

This repository does not claim to replace or relicense the upstream wordlist; it only references the source used for the local copy included here.
