Description

This article introduces the maximum password length and complexity allowed for pre-shared-key in IPsec VPN 

Symptoms

This article introduces the maximum password length and complexity allowed for pre-shared-key in IPsec VPN 

Solution

There are two types of pre-shared-key: ascii-text and hexadecimal key.

Each type allows a maximum of 255 characters for the key. However, there are different limits for different encryption methods. Special characters are also allowed if they are properly configured.

Here are the details:

# ascii-text key — Specify a string of 1 to 255 ASCII text characters for the key. To include the special characters ( ) [ ] ! & ? | enclose either the entire key string or the special character in quotation marks; for example “str)ng” or str”)”ng. Other use of quotation marks within the string is not allowed. With des-cbc encryption, the key contains 8 ASCII characters. With 3des-cbc encryption, the key contains 24 ASCII characters.

# hexadecimal key —Specify a string of 1 to 255 hexadecimal characters for the key. Characters must be hexadecimal digits 0 through 9, or letters a through f or A through F. With des-cbc encryption, the key contains 16 hexadecimal characters. With 3des-cbc encryption, the key contains 48 hexadecimal characters.

policy (Security IKE) | Junos OS | Juniper Networks

Modification History

2026-01-26 : Article Created

Related Information

policy (Security IKE) | Junos OS | Juniper Networks