Encoding & Decoding Secrets

Encoding & Decoding Secrets

Many Helm charts and manifest files within Kubernetes have Base64 encoded strings to obfuscate secrets.

The easiest way to encode and decode values is to use a couple of commands in Linux: –

To encode a clear piece of information to Base64, use the following command: –

echo "clearvalue" | base64
Y2xlYXJ2YWx1ZQo=

To decode a base64 string back to the precise value, use this: –

echo "Y2xlYXJ2YWx1ZQo=" | base64 --decode
clearvalue
Stephen

Hi, my name is Stephen Finchett. I have been a software engineer for over 30 years and worked on complex, business critical, multi-user systems for all of my career. For the last 15 years, I have been concentrating on web based solutions using the Microsoft Stack including ASP.Net, C#, TypeScript, SQL Server and running everything at scale within Kubernetes.