In fact, Windows has a utility that encodes and decodes base64 - CERTUTIL
I'm not sure which version of Windows introduced this command.
To encode a file:
certutil -encode inputFileName encodedOutputFileName
To decode a file:
certutil -decode encodedInputFileName decodedOutputFileName
There are a number of verbs available and options available for certutil.
To get a list of almost all available verbs:
certutil -?
To get help with a specific verb (e.g. -encode):
certutil -encode -?
To get full help for almost all verbs:
certutil -v -?
Mysteriously, the -encodehex verb -encodehex not listed in certutil -? or certutil -v -? But this is described using certutil -encodehex -? , This is another convenient feature :-)
Refresh
Regarding David Morales's comment, the -encodehex verb -encodehex has a poorly documented type option that allows you to create base64 lines without header or footer lines.
certutil [Options] -encodehex inFile outFile [type]
Type 1 will give base64 without header or footer lines.
See https://www.dostips.com/forum/viewtopic.php?f=3&t=8521#p56536 for a short list of available type formats. And for a more detailed look at the available formats, see https://www.dostips.com/forum/viewtopic.php?f=3&t=8521#p57918 .
Not explored, but the -decodehex verb also has an optional type -decodehex argument.
dbenham Jun 05 '13 at 17:55 2013-06-05 17:55
source share