{"tool":"base64","name":"base64","description":"Encodes and decodes Base64, the standard way to carry binary data over text channels — common in tokens, config files and shell file-transfer tricks.","tags":["encoding","base64","data transfer"],"homepage":"https://www.gnu.org/software/coreutils/","docs":"https://man7.org/linux/man-pages/man1/base64.1.html","install":{"apt":"sudo apt install coreutils","brew":"brew install coreutils"},"related":["openssl","gpg","jq"],"total_commands":10,"commands":[{"id":1,"category":"Encoding","command":"echo -n \"<text>\" | base64","example":"echo -n \"admin:password\" | base64","explanation":"Encodes text to Base64. -n stops echo adding a newline that would change the output."},{"id":2,"category":"Encoding","command":"base64 <file>","example":"base64 payload.bin","explanation":"Encodes a file, for example to paste a binary over a text-only channel."},{"id":3,"category":"Encoding","command":"base64 -w 0 <file>","example":"base64 -w 0 shell.elf","explanation":"Encodes with no line wrapping — needed when the receiver expects a single line (GNU)."},{"id":4,"category":"Decoding","command":"echo \"<b64>\" | base64 -d","example":"echo \"YWRtaW46cGFzcw==\" | base64 -d","explanation":"Decodes Base64 back to text. On macOS use -D."},{"id":5,"category":"Decoding","command":"base64 -d <file> > <out>","example":"base64 -d encoded.txt > decoded.bin","explanation":"Decodes a file."},{"id":6,"category":"Decoding","command":"echo \"<b64>\" | base64 -d | xxd | head","example":"echo \"f0VMRgIBAQ...\" | base64 -d | xxd | head","explanation":"Decodes and inspects bytes — ELF starts with 7f 45 4c 46, PNG with 89 50 4e 47."},{"id":7,"category":"Transfer trick","command":"base64 -w 0 <file>; # then on target: echo <b64> | base64 -d > <file>","example":"base64 -w 0 linpeas.sh","explanation":"Moves a file to a host with only a shell: encode here, paste and decode there."},{"id":8,"category":"Related encodings","command":"echo \"<text>\" | base32","example":"echo \"secret\" | base32","explanation":"Base32 for case-insensitive or DNS-friendly channels; -d decodes."},{"id":9,"category":"Related encodings","command":"echo -n \"<text>\" | xxd -p","example":"echo -n \"ABC\" | xxd -p","explanation":"Hex encoding; xxd -p -r reverses it."},{"id":10,"category":"Related encodings","command":"printf \"%s\" \"<text>\" | od -An -tx1","example":"printf \"%s\" \"hi\" | od -An -tx1","explanation":"Shows raw byte values in hex."}],"slug":"base64","category":"crypto","url":"https://terminal.rokibulroni.com/tool/crypto/base64","markdown":"https://terminal.rokibulroni.com/api/v1/tools/crypto/base64.md"}