echo -n "<text>" | base64Encodes text to Base64. -n stops echo adding a newline that would change the output.
Example
echo -n "admin:password" | base64Encodes and decodes Base64, the standard way to carry binary data over text channels — common in tokens, config files and shell file-transfer tricks.
sudo apt install coreutilsecho -n "<text>" | base64Encodes text to Base64. -n stops echo adding a newline that would change the output.
Example
echo -n "admin:password" | base64base64 <file>Encodes a file, for example to paste a binary over a text-only channel.
Example
base64 payload.binbase64 -w 0 <file>Encodes with no line wrapping — needed when the receiver expects a single line (GNU).
Example
base64 -w 0 shell.elfecho "<b64>" | base64 -dDecodes Base64 back to text. On macOS use -D.
Example
echo "YWRtaW46cGFzcw==" | base64 -dbase64 -d <file> > <out>Decodes a file.
Example
base64 -d encoded.txt > decoded.binecho "<b64>" | base64 -d | xxd | headDecodes and inspects bytes — ELF starts with 7f 45 4c 46, PNG with 89 50 4e 47.
Example
echo "f0VMRgIBAQ..." | base64 -d | xxd | headbase64 -w 0 <file>; # then on target: echo <b64> | base64 -d > <file>Moves a file to a host with only a shell: encode here, paste and decode there.
Example
base64 -w 0 linpeas.shThe ubiquitous toolkit for TLS and general cryptography: inspect certificates, generate keys and CSRs, convert formats, hash, encrypt and create random secrets.
The free implementation of OpenPGP: generate keys, encrypt and decrypt files, and create and verify digital signatures — used everywhere from email to release verification.
A lightweight command-line JSON processor: filter, transform and pretty-print JSON from APIs, logs and tool output.