I am using as a customer a commercial VPN for OS/X and iPhone. I am also provisioning VNPs at work for iOS/MacOs, and have a Debian based VPN at home with StrongSwan.I have captured the .mobileconfig provisioning file the  Sierra MacOS executable provided by my commercial VPN provider generates. I would like to get the configuration details from there in order to not install their Linux software and configure it manually, however the SharedSecret XML data field is encrypted.At work, I have been using Apple Configurator 2 just to encrypt my Shared Secret for creating the skeleton of mobileconfig provisioning files for Apple devices, however I still do not have any ideia what is the format  of that field.I have noticed this encrypted password can be placed in ipsec.secrets, in lieu of the clear text passwords, such as:@vpngroup : PSK 0scGFzc3dvcmQKLikewise, again in Apple mobileconfig provision files that are delivered to customers/end users, it can be found again:<key>SharedSecret</key><data>cGFzc3dvcmQK</data>So what actually is this format? And how to encrypt and encrypt it? I know for sure it is not the actual Shared Secret in clear text.
VPN configuration: shared secret PSK format
linux;vpn;apple;strongswan
The format of the enconding of Shared Secret/ group password is actually Base64.From the strongswan documentation site:Alternatively, preshared secrets can be represented as hexadecimal or  Base64 encoded binary values. A character sequence beginning with 0x  is interpreted as sequence hexadecimal digits. Similarly, a character  sequence beginning with 0s is interpreted as Base64 encoded binary  data.Actually the Base64 format for the group password, besides being used in Linux/FreeBSD IPsec configurations and Apple provisioning files, is also used in Cisco VPN client files. Actually the justification of the use of Base64 is to protect the password from prying eyes and the end users. Why using then such a basic enconding algorithm...So at the end of the day, to decode it in Linux, it has to be taken verbatim from the Apple SharedSecret data field, or when begin captured from ipsec.secrets, you have to ignore the leading 0s from the string: $echo cGFzc3dvcmQK | base64 -dpasswordTo decode it in FreeBSD/OS/X:$echo cGFzc3dvcmQK | base64 -DpasswordLikewise, to encode it back:$echo password | base64cGFzc3dvcmQK