base64 package not available. Is there a substitute so I can use the command anyway?

5.1k Views Asked by At

I am on a system where i can not install any packages and my busybox does not include the base64 command. However I need to run a script that uses base64 de/encoding. Is there a way to do that in a function in the script maybe?

1

There are 1 best solutions below

1
On

well, how easy it is to en/decode base64 really depends on what is installed on your system.

e.g. openssl can encode and decode base64:

$ openssl enc -base64 <<< 'Hello, World!'
SGVsbG8sIFdvcmxkIQo=
$ openssl enc -base64 -d <<< SGVsbG8sIFdvcmxkIQo=
Hello, World!