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