Decoding an AmneziaVPN link, such as vpn://AAAH2Xjan..., requires specific tools because the encoding scheme is custom and not standard Base64. This response details how to decode these links using Linux command-line tools and Python, how to determine the VPN protocol, and what documentation is available.
Understanding the vpn:// Link Format
AmneziaVPN uses a custom encoding scheme for its vpn:// links. These links are not always standard Base64-encoded strings and may include additional metadata or proprietary encoding. The vpn:// prefix indicates a custom URI scheme, and the subsequent string is encoded using a method specific to AmneziaVPN. The encoded data typically includes VPN server details, protocol information (e.g., WireGuard, OpenVPN), and authentication keys or other configuration data.
Decoding with the Amnezia Config Decoder Script
The most reliable method to decode these links is by using the Amnezia Config Decoder & Encoder script, a Python tool designed for this purpose. Here’s how to use it:
Clone the Repository:
git clone https://github.com/andr13/amnezia-config-decoder.git cd amnezia-config-decoderEnsure Python is Installed:
Make sure you have Python 3.12 or higher installed. You can check your version with:python3 --versionRun the Decoding Script:
To decode the link and save the output to a JSON file, use:python3 amnezia-config-decoder.py vpn://AAAH2Xjan... -o output.jsonReplace
vpn://AAAH2Xjan...with your actual link. The-o output.jsonflag saves the decoded configuration to a file namedoutput.json. If you omit the-ooption, the decoded JSON will be printed to the console.python3 amnezia-config-decoder.py vpn://AAAH2Xjan...
Decoding with Linux Command-Line Tools
If the Amnezia Config Decoder script is unavailable, you can attempt to decode the vpn:// link using standard Linux tools. However, keep in mind that the link may not be a pure Base64 string, and this method may only partially work.
Remove the
vpn://Prefix:echo "vpn://AAAH2Xjan..." | sed 's/vpn:\/\///' > encoded.txtAttempt Base64 Decoding:
base64 -d encoded.txt > decoded.txtInspect the Decoded Output:
cat decoded.txtIf the output is not readable, the string likely uses a custom encoding, and the Amnezia Config Decoder script is the recommended approach.
Determining the VPN Protocol
Once you have decoded the vpn:// link, the output (typically in JSON format) will include details about the VPN configuration, including the protocol. Look for keywords such as:
"protocol": "WireGuard""protocol": "OpenVPN""protocol": "Shadowsocks""protocol": "IKEv2""protocol": "AmneziaWG""protocol": "XRay"
If the protocol is not explicitly mentioned, analyze the server configuration or consult the AmneziaVPN documentation. For example, WireGuard configurations often include fields like public_key, private_key, and dns, while OpenVPN configurations may include ca, cert, and key.
Official and Community Documentation
While the official AmneziaVPN documentation does not explicitly detail the vpn:// link format, the following resources can be helpful:
- Amnezia Config Decoder & Encoder GitHub Repository
- AmneziaVPN Supported Configuration Formats
- Setting Up a VPN on Your Own Server
- AmneziaVPN GitHub Repository
- AmneziaVPN Community Forum
- Reddit: r/AmneziaVPN
- Telegram (English)
Troubleshooting
If decoding fails:
- Verify that the
vpn://link is correctly formatted. - Ensure the Amnezia Config Decoder script is up-to-date.
- Check the AmneziaVPN GitHub issues page for known problems.
- Contact the AmneziaVPN community for support.
Example Decoded Output
After decoding, you might see output like this:
{
"protocol": "WireGuard",
"server": "vpn.example.com",
"port": 51820,
"public_key": "ABC123...",
"private_key": "XYZ789...",
"allowed_ips": "0.0.0.0/0"
}
This indicates the VPN uses the WireGuard protocol.
Conclusion
The vpn:// links used by AmneziaVPN are encoded using a custom scheme. The most reliable way to decode them is by using the Amnezia Config Decoder & Encoder Python script. Once decoded, the JSON output will reveal the VPN protocol and other configuration details. While the official documentation does not detail the vpn:// link format, community resources and the provided script are valuable for decoding and understanding these links.