85d152ed36e9576b2c04f01de780981ba9c4ff0c
[games.git] / usr.bin / enigma / enigma.1
1 .\"
2 .\" enigma (aka. crypt) man page written by Joerg Wunsch.
3 .\"
4 .\" Since enigma itself is distributed in the Public Domain, this file
5 .\" is also.
6 .\"
7 .\" $FreeBSD: src/usr.bin/enigma/enigma.1,v 1.5.2.2 2002/06/20 23:45:48 charnier Exp $
8 .\" $DragonFly: src/usr.bin/enigma/enigma.1,v 1.4 2006/04/17 17:40:34 swildner Exp $
9 .\" "
10 .Dd October 30, 1998
11 .Os
12 .Dt ENIGMA 1
13 .Sh NAME
14 .Nm enigma ,
15 .Nm crypt
16 .Nd very simple file encryption
17 .Sh SYNOPSIS
18 .Nm
19 .Op Fl s
20 .Op Fl k
21 .Op Ar password
22 .Nm crypt
23 .Op Fl s
24 .Op Fl k
25 .Op Ar password
26 .Sh DESCRIPTION
27 The
28 .Nm
29 utility, also known as
30 .Nm crypt
31 is a
32 .Em very
33 simple encryption program, working on a
34 .Dq secret-key
35 basis.  It operates as a filter, i. e. it encrypts or decrypts a
36 stream of data from standard input, and writes the result to standard
37 output.  It automatically detects whether the input data stream is
38 already encrypted, and switches into decryption mode in this case.
39 .Pp
40 There are several ways to provide the secret key to the program.  By
41 default, the program prompts the user on the controlling terminal for
42 the key, using
43 .Xr getpass 3 .
44 This is the only safe way of providing it.
45 .Pp
46 Alternatively, the key can be provided as the sole command-line
47 argument
48 .Ar password
49 when starting the program.  Obviously, this way the key can easily be
50 spotted by other users running
51 .Xr ps 1 .
52 As yet another alternative,
53 .Nm
54 can be given the option
55 .Fl k ,
56 and it will take the key from the environment variable
57 .Ev CrYpTkEy .
58 While this at a first glance seems to be more secure than the previous
59 option, it actually isn't since environment variables can also be
60 examined with
61 .Xr ps 1 .
62 Thus this option is mainly provided for compatibility with other
63 implementations of
64 .Nm .
65 .Pp
66 When specifying the option
67 .Fl s ,
68 .Nm
69 modifies the encryption engine in a way that is supposed to make it a
70 little more secure, but incompatible with other implementations.
71 .Ss Warning
72 The cryptographic value of
73 .Nm
74 is rather small.  This program is only provided here for compatibility
75 with other operating systems that also provide an implementation.  For
76 real encryption, refer to
77 .Xr bdes 1
78 (from the DES distribution package), or
79 .Xr pgp 1
80 (from the pkgsrc collection).  However, restrictions for exporting,
81 importing or using such tools might exist in some countries, so those
82 stronger programs are not being shipped as part of the operating
83 system by default.
84 .Sh ENVIRONMENT
85 .Bl -tag -offset indent -width "XXCrYpTkEy"
86 .It Ev CrYpTkEy
87 used to obtain the secret key when option
88 .Fl k
89 has been given
90 .El
91 .Sh EXAMPLES
92 .Bd -literal -offset indent
93 man enigma | enigma > encrypted
94 Enter key: (XXX \(em key not echoed)
95 .Ed
96 .Pp
97 This will create an encrypted form of this man page, and store it in
98 the file
99 .Ql encrypted .
100 .Bd -literal -offset indent
101 enigma XXX < encrypted
102 .Ed
103 .Pp
104 This displays the previously created file on the terminal.
105 .Sh SEE ALSO
106 .Xr bdes 1 ,
107 .Xr pgp 1 ,
108 .Xr ps 1 ,
109 .Xr getpass 3
110 .Sh HISTORY
111 Implementations of
112 .Nm crypt
113 are very common among
114 .Ux
115 operating systems.  This implementation has been taken from the
116 .Em Cryptbreakers Workbench
117 which is in the public domain.