![]() ![]() That’s it, now you know how to encode and decode base64 data from command line. $ echo "MTIz" | openssl base64 -d Conclusion $ openssl base64 -d -in encoded.txt -out raw.txt These are some example commands: $ openssl base64 -in raw.txt -output encoded.txt Openssl works with same way as base64 utility. You can also use openssl to perform base64 encoding and decoding, but it might require to install for the operating system. To decode base64-encoded data, use the -d argument: $ echo "MTIz" | base64 -d I would like to write a bash script to decode a base64 string. The package coreutils (installed by default in debian) carry both base32 and base64. If you just want to quickly perform base64 encoding for a string and get the output, use any of these commands: $ cat raw.txt | base64 1 Answer Sorted by: 11 Packages Yes, there are several. ![]() We have gone through all use cases of options available in the base64 command. The encoded base64 value, by default, is printed on the stdout if you want to save into an file, you can use either one of following commands: $ base64 -i raw.txt -o encoded.txt base64 command is used to Base64 encode or decode data provided as input. $ echo -n "123" > raw.txtįor some Linux distros, you might need to specify the input file by using -i, -input : $ base64 -i raw.txt To encode base64 for an input file, issue this command: $ echo "123" > raw.txtīy default, echo command will append a newline character to the output, you might want to omit it by using -n argument. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |