Skip to content

Instantly share code, notes, and snippets.

@chriskacerguis
Created June 15, 2025 20:35
Show Gist options
  • Save chriskacerguis/c439e9cbbab85ae8580a3a587eccf49f to your computer and use it in GitHub Desktop.
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
#!/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