Created
June 15, 2025 20:35
-
-
Save chriskacerguis/c439e9cbbab85ae8580a3a587eccf49f to your computer and use it in GitHub Desktop.
Shell Script to create a key for Tait Communication Radios AND Anytone Radios
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Step 1: Generate a 32-character alphanumeric string | |
KEY=$(LC_ALL=C tr -dc 'A-Za-z0-9' </dev/urandom | head -c 32) | |
# Step 2: Convert to hex | |
HEX=$(echo -n "$KEY" | xxd -p | tr -d '\n') | |
# Step 3: Format hex in 4-character blocks | |
FORMATTED=$(echo "$HEX" | sed 's/.\{4\}/& /g' | sed 's/ $//') | |
# Step 4: Output | |
echo "Generated 32-char key: $KEY" | |
echo "Formatted AES-256 hex key:" | |
echo "$FORMATTED" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment