get base64 tool

Started by eguun, September 17, 2021, 05:25:39 PM

Previous topic - Next topic
Hello,

I am struggling to find an actionable way to get the tool base64 on opnsense

for reference: https://linux.die.net/man/1/base64
This is the tool to encode/decode string from the shell.

I can't find it in packages, it's not installed by default ...
Am I missing something easy and obvious to get it ?

Any pointers would be welcome.

Thanks

In worst case you should be able to build it from the ports tree however you could use OpenSSL as well.

Sorry for the late response, I hadn't been notified on the activity here.

Thanks for your reply.

I can't find the tool handy in the pkg library.

These 2 options you recommend, would you please be kind to share a link there where I can learn more how to work with ports or openssl to achieve this result?

Thanks

Ports tree:
=========

AFAIK the quick command is opnsense-code tools ports

Then you can build everything from the source code.

Some docs are here:
https://github.com/opnsense/tools


OpenSSL:
========
https://wiki.openssl.org/index.php/Command_Line_Utilities#Base64_Encoding_Strings

Okay many thanks, I can work with this


September 23, 2021, 03:36:43 PM #6 Last Edit: September 23, 2021, 03:49:16 PM by eguun
Many thanks for the response.

To help any other people having this issue and finding this thread.

I managed to make it work via 2 options:
1- I build a oneliner- script to use openssl base64. I named the script base64 and redirect args towards openssl - following fabian's pointers
2- I downloaded the compiled binary from lilsense link: https://freebsd.pkgs.org/12/freebsd-amd64/base64-1.5_1.txz.html - worked right out of the box!

Both solution works.

There is still a 3rd way which would have been to compile from source ... but I haven't gone through this.

My warm thanks for the support!

my bash script (named base64 and placed in /root/bin):
#!/usr/local/bin/bash
/usr/bin/openssl base64 "$@"