Import my usual \dash macro into all these man pages, and use it for
[sgt/utils] / base64 / base64.but
CommitLineData
fe25517f 1\cfg{man-identity}{base64}{1}{2004-11-20}{Simon Tatham}{Simon Tatham}
9acadc2b 2
92dccb8d 3\define{dash} \u2013{-}
4
8a48d402 5\title Man page for \cw{base64}
9acadc2b 6
8a48d402 7\U NAME
9acadc2b 8
92dccb8d 9\cw{base64} \dash stand-alone encoder and decoder for base64
9acadc2b 10
8a48d402 11\U SYNOPSIS
9acadc2b 12
13\c base64 [ -d ] [ filename ]
14\e bbbbbb bb iiiiiiii
8a48d402 15\c base64 -e [ -c width ] [ filename ]
16\e bbbbbb bb bb iiiii iiiiiiii
9acadc2b 17
8a48d402 18\U DESCRIPTION
9acadc2b 19
20\cw{base64} is a command-line utility for encoding and decoding the
21\q{base64} encoding.
22
fa784cfa 23This encoding, defined in
24\W{http://www.ietf.org/rfc/rfc2045.txt}{RFC 2045}, is primarily used
25to encode binary attachments in MIME e-mail, but is widely used in
26many other applications as well. For example, the \q{Content-MD5}
27mail header contains a small piece of base64; SSH private keys are
28generally stored as base64-encoded blobs; and so on.
9acadc2b 29
30Other utilities, such as \cw{munpack}, exist which will take an
31entire MIME-encoded message, identify the base64-encoded subparts,
32and decode them. However, these utilities will not help you if you
33need to inspect a Content-MD5 header or an SSH private key.
34
35\cw{base64} is a very simple stand-alone encoder and decoder for the
36base64 format \e{alone}. It does not try to understand MIME headers
37or anything other than raw data.
38
8a48d402 39\U OPTIONS
9acadc2b 40
41By default (if neither \cw{-d} or \cw{-e} is supplied), \cw{base64}
42operates in decode mode.
43
44\dt \cw{-d}
45
46\dd Places \cw{base64} into decode mode. In this mode, it will read
47from standard input or the supplied file name, ignore all characters
48that are not part of the base64 alphabet, decode the ones that are,
49and output the decoded data on standard output.
50
51\dt \cw{-e}
52
53\dd Places \cw{base64} into encode mode. In this mode, it will read
54binary data from standard input or the supplied file name, encode it
55as base64, and output the encoded data on standard output.
56
8a48d402 57\dt \cw{-c} \e{width}
9acadc2b 58
59\dd If \cw{base64} is operating in encode mode, this controls the
60number of base64 characters output per line of the encoded file.
61Normally base64-reading applications do not care about this, so the
62default of 64 characters per line is perfectly adequate.
63
64\lcont{
65
66The special value 0 will prevent \cw{base64} from ever writing a
67line break in the middle of the data at all.
68
69The base64 encoding converts between a group of three plaintext
70bytes and a group of four encoded bytes. \cw{base64} does not
da0f8522 71support breaking an encoded group across a line (although it can
72handle it as input if it receives it). Therefore, the \e{width}
73parameter passed to \cw{-c} must be a multiple of 4.
9acadc2b 74
75}
da0f8522 76
8a48d402 77\U LICENCE
da0f8522 78
79\cw{base64} is free software, distributed under the MIT licence.
80Type \cw{base64 --licence} to see the full licence text.
1166ff62 81
82\versionid $Id$