just so that google can find it when the next poor soul goes searching.
For converting "binary files" to "base64 encoded ASCII", there is a program called "mimencode" (and sometimes mmencode) which used to ship as part of a package called "metamail".
Debian decided that metamail is no longer mantained, so they stopped bundling it with recent versions of debian linux, and thus, ubuntu.
This is a not a major problem, though, as there is a replacement "/usr/bin/base64" which can be called just the same es mimencode -
$ base64 file.bin >file.txt
base64 is part of "coreutils", and should be installed already on your system.
gert