https://github.com/valerio-vaccaro/nato_encoder
Encode hexadecimal string using nato alphabet
https://github.com/valerio-vaccaro/nato_encoder
hexadecimal nato-alphabet
Last synced: 4 months ago
JSON representation
Encode hexadecimal string using nato alphabet
- Host: GitHub
- URL: https://github.com/valerio-vaccaro/nato_encoder
- Owner: valerio-vaccaro
- License: gpl-3.0
- Created: 2020-12-10T16:50:49.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2020-12-30T00:20:41.000Z (over 4 years ago)
- Last Synced: 2025-02-26T03:36:07.424Z (4 months ago)
- Topics: hexadecimal, nato-alphabet
- Language: Python
- Homepage:
- Size: 4.47 MB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Nato Encoder
Encode hexadecimal string using the nato alphabet/numbers.
```
python3 nato_encoder.py encode -M "deadbeef" -f "result.wav"zero zero one four uniform two whiskey four three six
```The file `result.wav` contain an audio version of the result phrase (created locally).
You can decode the nato string in the same manner.
```
python3 nato_encoder.py decode -M "zero zero one four uniform two whiskey four three six"deadbeef
```The `-h` argument can help you understanding how this program is working.
```
usage: nato_encoder.py [-h] {encode,decode,map,version} ...NATO alphabet encoder/decoder.
positional arguments:
{encode,decode,map,version}optional arguments:
-h, --help show this help message and exit
```## Protocol
The protocol uses a starting code (2 chars of start type) followed by the message encoding.
The encoding is realized char by char with a different conversion table for even and odd characters, this technique allows to recognize easily if a char is missing in the sequence.### Even chars
Fist nibble of the byte is encoded with a set of nato chars:
- `0`: alpha
- `1`: charlie
- `2`: echo
- `3`: golf
- `4`: india
- `5`: kilo
- `6`: mike
- `7`: oscar
- `8`: quebec
- `9`: sierra
- `a`: uniform
- `b`: whiskey
- `c`: yankee
- `d`: one
- `e`: three
- `f`: five### Odd chars
Second nibble of the byte is encoded with a different set of nato chars:
- `0`: bravo
- `1`: delta
- `2`: foxtrot
- `3`: hotel
- `4`: juliett
- `5`: lima
- `6`: november
- `7`: papa
- `8`: romeo
- `9`: tango
- `a`: victor
- `b`: xray
- `c`: zulu
- `d`: two
- `e`: four
- `f`: six### Special chars
- `start`: zero - used two time as starting sequence,
- `silence`: char not printed but used as separator between words (in audio).### Dependencies
- `pydub` used for create an unique wav file,
- `speech_recognition` used for STT conversion.## License
GNU GENERAL PUBLIC LICENSE, Version 3
Based on pgp-words.py Copyright (C) 2015 Joe Ruether [email protected]