Move everything from /var/adm to /var/log
[unleashed.git] / share / man / man1 / crypt.1
blob7621f1f099fb320d84b2184811cfa479123b9c5a
1 '\" te
2 .\"  Copyright (c) 2005, Sun Microsystems, Inc.  All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH CRYPT 1 "Mar 8, 2005"
7 .SH NAME
8 crypt \- encode or decode a file
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fBcrypt\fR [\fIpassword\fR]
13 .fi
15 .SH DESCRIPTION
16 .sp
17 .LP
18 The \fBcrypt\fR utility encrypts and decrypts the contents of a file.
19 \fBcrypt\fR reads from the standard input and writes on the standard output.
20 The \fIpassword\fR is a key that selects a particular transformation. If no
21 \fIpassword\fR is given, \fBcrypt\fR demands a key from the terminal and turns
22 off printing while the key is being typed in. \fBcrypt\fR encrypts and decrypts
23 with the same key:
24 .sp
25 .in +2
26 .nf
27 example% \fBcrypt key < clear.file > encrypted.file\fR
28 example% \fBcrypt key < encrypted.file | pr\fR
29 .fi
30 .in -2
31 .sp
33 .sp
34 .LP
35 prints the contents of \fBclear.file\fR.
36 .sp
37 .LP
38 Files encrypted by \fBcrypt\fR are compatible with those treated by the editors
39 \fBed\fR(1), \fBex\fR(1), and \fBvi\fR(1) in encryption mode.
40 .sp
41 .LP
42 The security of encrypted files depends on three factors:  the fundamental
43 method must be hard to solve; direct search of the key space must be
44 infeasible; "sneak paths" by which keys or cleartext can become visible must be
45 minimized.
46 .sp
47 .LP
48 \fBcrypt\fR implements a one-rotor machine designed along the lines of the
49 German Enigma, but with a 256-element rotor.  Methods of attack on such
50 machines are widely known, thus \fBcrypt\fR provides minimal security.
51 .sp
52 .LP
53 The transformation of a key into the internal settings of the machine is
54 deliberately designed to be expensive, that is, to take a substantial fraction
55 of a second to compute.  However, if keys are restricted to (say) three
56 lower-case letters, then encrypted files can be read by expending only a
57 substantial fraction of five minutes of machine time.
58 .sp
59 .LP
60 Since the key is an argument to the \fBcrypt\fR command, it is potentially
61 visible to users executing \fBps\fR(1) or a derivative command. To minimize
62 this possibility, \fBcrypt\fR takes care to destroy any record of the key
63 immediately upon entry. No doubt the choice of keys and key security are the
64 most vulnerable aspect of \fBcrypt\fR.
65 .SH FILES
66 .sp
67 .ne 2
68 .na
69 \fB\fB/dev/tty\fR\fR
70 .ad
71 .RS 12n
72 for typed key
73 .RE
75 .SH SEE ALSO
76 .sp
77 .LP
78 \fBdes\fR(1), \fBed\fR(1), \fBex\fR(1), \fBps\fR(1), \fBvi\fR(1),
79 \fBattributes\fR(5)