Skip to content

Instantly share code, notes, and snippets.

@zmts
Last active June 30, 2021 18:54
Show Gist options
  • Save zmts/0934c2486767ce70064199de02cf0aed to your computer and use it in GitHub Desktop.
Save zmts/0934c2486767ce70064199de02cf0aed to your computer and use it in GitHub Desktop.
base64 on unix systems

base64 on Unix systems

How get base64 from any file ?

Write to output

cat var/tmp/myFile.txt | base64

Or write to file

cat var/tmp/myFile.txt | base64 > var/tmp/decodedFile.txt

How decrypt base64 file ?

Write to output

cat base64encoded.txt | base64 -d

Write to file

cat base64encoded.txt | base64 -d > var/tmp/decodedFile.txt

How get base64 from any string ?

echo hello | base64

How decrypt base64 string to decoded string ?

echo aGVsbG8K | base64 -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment