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
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.
Fist nibble of the byte is encoded with a set of nato chars:
0
: alpha1
: charlie2
: echo3
: golf4
: india5
: kilo6
: mike7
: oscar8
: quebec9
: sierraa
: uniformb
: whiskeyc
: yankeed
: onee
: threef
: five
Second nibble of the byte is encoded with a different set of nato chars:
0
: bravo1
: delta2
: foxtrot3
: hotel4
: juliett5
: lima6
: november7
: papa8
: romeo9
: tangoa
: victorb
: xrayc
: zulud
: twoe
: fourf
: six
start
: zero - used two time as starting sequence,silence
: char not printed but used as separator between words (in audio).
pydub
used for create an unique wav file,speech_recognition
used for STT conversion.
GNU GENERAL PUBLIC LICENSE, Version 3
Based on pgp-words.py Copyright (C) 2015 Joe Ruether jrruethe@gmail.com