projects/sencrypt

view sencrypt.1.xml @ 21:5f9dc8f3c53e

Release version 3
author Guido Berhoerster <guido+sencrypt@berhoerster.name>
date Mon Aug 05 11:19:02 2019 +0200 (2019-08-05)
parents f0ceb0ad20e7
children
line source
1 <?xml version="1.0"?>
2 <!--
4 Copyright (C) 2016 Guido Berhoerster <guido+sencrypt@berhoerster.name>
6 Permission is hereby granted, free of charge, to any person obtaining
7 a copy of this software and associated documentation files (the
8 "Software"), to deal in the Software without restriction, including
9 without limitation the rights to use, copy, modify, merge, publish,
10 distribute, sublicense, and/or sell copies of the Software, and to
11 permit persons to whom the Software is furnished to do so, subject to
12 the following conditions:
14 The above copyright notice and this permission notice shall be included
15 in all copies or substantial portions of the Software.
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 -->
26 <refentry xmlns="http://docbook.org/ns/docbook" xml:lang="en">
27 <info>
28 <author>
29 <personname>
30 <firstname>Guido</firstname>
31 <surname>Berhoerster</surname>
32 </personname>
33 <email>guido+sencrypt@berhoerster.name</email>
34 <personblurb/>
35 </author>
36 <date>3 September, 2016</date>
37 </info>
38 <refmeta>
39 <refentrytitle>sencrypt</refentrytitle>
40 <manvolnum>1</manvolnum>
41 <refmiscinfo class="source"/>
42 <refmiscinfo class="version"/>
43 <refmiscinfo class="manual">User Commands</refmiscinfo>
44 </refmeta>
45 <refnamediv>
46 <refname>sencrypt</refname>
47 <refname>sdecrypt</refname>
48 <refpurpose>encrypt and decrypt data</refpurpose>
49 </refnamediv>
50 <refsynopsisdiv>
51 <cmdsynopsis>
52 <command>sencrypt</command>
53 <arg choice="req">
54 <option>-l</option>
55 </arg>
56 </cmdsynopsis>
57 <cmdsynopsis>
58 <command>sencrypt</command>
59 <arg choice="opt">
60 <option>-v</option>
61 </arg>
62 <arg choice="req">
63 <option>-a</option>
64 <replaceable>algorithm</replaceable>
65 </arg>
66 <arg choice="opt">
67 <option>-k</option>
68 <replaceable>key_file</replaceable>
69 </arg>
70 <arg choice="opt">
71 <option>-i</option>
72 <replaceable>input_file</replaceable>
73 </arg>
74 <arg choice="opt">
75 <option>-o</option>
76 <replaceable>output_file</replaceable>
77 </arg>
78 </cmdsynopsis>
79 <cmdsynopsis>
80 <command>sdecrypt</command>
81 <arg choice="req">
82 <option>-l</option>
83 </arg>
84 </cmdsynopsis>
85 <cmdsynopsis>
86 <command>sdecrypt</command>
87 <arg choice="opt">
88 <option>-v</option>
89 </arg>
90 <arg choice="req">
91 <option>-a</option>
92 <replaceable>algorithm</replaceable>
93 </arg>
94 <arg choice="opt">
95 <option>-k</option>
96 <replaceable>key_file</replaceable>
97 </arg>
98 <arg choice="opt">
99 <option>-i</option>
100 <replaceable>input_file</replaceable>
101 </arg>
102 <arg choice="opt">
103 <option>-o</option>
104 <replaceable>output_file</replaceable>
105 </arg>
106 </cmdsynopsis>
107 </refsynopsisdiv>
108 <refsect1>
109 <title>Description</title>
110 <para>The <command>sencrypt</command> utility encrypts data and the
111 <command>sdecrypt</command> utility decrypts data using the specified
112 algorithm. A key file must be a regular file and have the exact size of the
113 desired key length, its content will be used verbatim as the key. If no key
114 file is specified <command>sencrypt</command> or
115 <command>sdecrypt</command> will ask for a passphrase and use that together
116 with a salt to derive a key using the PBKDF2 key derivation function. If no
117 input file is specfified, the input will be read from stdin. If no output
118 file is specfied, the output will be written to stdout. The input and
119 output file may be identical, in which case the content of the input file
120 is replaced with the output after successful encryption or decryption. The
121 algorithm used for encrypting data is not saved and needs to be explicitly
122 specified when decrypting data.</para>
123 <para><command>sencrypt</command> and <command>sdecrypt</command> are
124 portable and compatible reimplementations of the <command>encrypt</command>
125 and <command>decrypt</command> utilities in Solaris/Illumos-based operating
126 systems.</para>
127 </refsect1>
128 <refsect1>
129 <title>Options</title>
130 <para>The following options are supported:</para>
131 <variablelist>
132 <varlistentry>
133 <term>
134 <option>-l</option>
135 </term>
136 <listitem>
137 <para>List the available algorithms and supported key lengths and
138 exit.</para>
139 </listitem>
140 </varlistentry>
141 <varlistentry>
142 <term>
143 <option>-a</option>
144 <replaceable>algorithm</replaceable>
145 </term>
146 <listitem>
147 <para>Use the specified algorithm. See
148 <xref linkend="algorithms"/> for a list of supported
149 algorithms.</para>
150 </listitem>
151 </varlistentry>
152 <varlistentry>
153 <term>
154 <option>-k</option>
155 <replaceable>key_file</replaceable>
156 </term>
157 <listitem>
158 <para>Read key data from specified key file. Key size requirements
159 depend on the selected algorithm.</para>
160 </listitem>
161 </varlistentry>
162 <varlistentry>
163 <term>
164 <option>-i</option>
165 <replaceable>input_file</replaceable>
166 </term>
167 <listitem>
168 <para>Read the input from the specified file.</para>
169 </listitem>
170 </varlistentry>
171 <varlistentry>
172 <term>
173 <option>-o</option>
174 <replaceable>output_file</replaceable>
175 </term>
176 <listitem>
177 <para>Write the output to the specified file.</para>
178 </listitem>
179 </varlistentry>
180 <varlistentry>
181 <term>
182 <option>-v</option>
183 </term>
184 <listitem>
185 <para>Ignored for compatibility with <command>encrypt</command> and
186 <command>decrypt</command>.</para>
187 </listitem>
188 </varlistentry>
189 </variablelist>
190 </refsect1>
191 <refsect1 xml:id="algorithms">
192 <title>Algorithms</title>
193 <para>The following algorithms and key lengths are supported:
194 <simplelist type="vert" columns="2">
195 <member>aes</member>
196 <member>arcfour</member>
197 <member>des</member>
198 <member>3des</member>
199 </simplelist></para>
200 <para>The arcfour, des, and 3des algorithms are considered insecure and should
201 not longer be used to encrypt new files. Using them will print a warning
202 message.</para>
203 </refsect1>
204 <refsect1>
205 <title>Examples</title>
206 <example>
207 <title>Encrypt a file with the AES algorithm</title>
208 <para>The following example encrypts a file with the AES algorithm:</para>
209 <screen>
210 $ sencrypt -a aes -i secret.txt -o secret.aes
211 </screen>
212 </example>
213 <example>
214 <title>Decrypt a file in-place</title>
215 <para>The following example decrypts a file in-place:</para>
216 <screen>
217 $ sdecrypt -a 3des -i data.bin -o data.bin
218 </screen>
219 </example>
220 <example>
221 <title>Encrypt a file using a key file</title>
222 <para>The following example generates a key file with 512 bits of random
223 data and uses it to encrypt a file:</para>
224 <screen>
225 $ dd if=/dev/urandom of=key.bin bs=64 count=1
226 $ sencrypt -a arcfour -k key.bin -i secret.txt -o secret.rc4
227 </screen>
228 </example>
229 <example>
230 <title>Pipe data trough encrypt in order to make a remote encrypted
231 backup</title>
232 <para>The following example creates an archive in the tar format,
233 encrypts it and sends it to a remote location via
234 <abbrev>SSH</abbrev>:</para>
235 <screen>
236 $ pax -w -x ustar /home | sencrypt -a aes -k backup-key.bin |\
237 ssh backuphost 'cat > home.tar'
238 </screen>
239 </example>
240 </refsect1>
241 <refsect1>
242 <title>Exit Status</title>
243 <para>The following exit values are returned:</para>
244 <variablelist>
245 <varlistentry>
246 <term>0</term>
247 <listitem>
248 <para>Command successfully executed.</para>
249 </listitem>
250 </varlistentry>
251 <varlistentry>
252 <term>&gt; 0</term>
253 <listitem>
254 <para>An error has occured.</para>
255 </listitem>
256 </varlistentry>
257 </variablelist>
258 </refsect1>
259 </refentry>