xref: /freebsd/usr.bin/enigma/enigma.1 (revision 1c05a6ea6b849ff95e539c31adea887c644a6a01)
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$
8.\" "
9.Dd February 5, 2017
10.Dt ENIGMA 1
11.Os
12.Sh NAME
13.Nm enigma ,
14.Nm crypt
15.Nd very simple file encryption
16.Sh SYNOPSIS
17.Nm
18.Op Fl s
19.Op Fl k
20.Op Ar password
21.Nm crypt
22.Op Fl s
23.Op Fl k
24.Op Ar password
25.Sh DESCRIPTION
26The
27.Nm
28utility, also known as
29.Nm crypt
30is a
31.Em very
32simple encryption program, working on a
33.Dq secret-key
34basis.
35It operates as a filter, i.e.,
36it encrypts or decrypts a
37stream of data from standard input, and writes the result to standard
38output.
39Since its operation is fully symmetrical, feeding the encrypted data
40stream again through the engine (using the same secret key) will
41decrypt it.
42.Pp
43There are several ways to provide the secret key to the program.
44By
45default, the program prompts the user on the controlling terminal for
46the key, using
47.Xr getpass 3 .
48This is the only safe way of providing it.
49.Pp
50Alternatively, the key can be provided as the sole command-line
51argument
52.Ar password
53when starting the program.
54Obviously, this way the key can easily be
55spotted by other users running
56.Xr ps 1 .
57As yet another alternative,
58.Nm
59can be given the option
60.Fl k ,
61and it will take the key from the environment variable
62.Ev CrYpTkEy .
63While this at a first glance seems to be more secure than the previous
64option, it actually is not since environment variables can also be
65examined with
66.Xr ps 1 .
67Thus this option is mainly provided for compatibility with other
68implementations of
69.Nm .
70.Pp
71When specifying the option
72.Fl s ,
73.Nm
74modifies the encryption engine in a way that is supposed to make it a
75little more secure, but incompatible with other implementations.
76.Pp
77.Ss Warning
78The cryptographic value of
79.Nm
80is rather small.
81This program is only provided here for compatibility
82with other operating systems that also provide an implementation
83(usually called
84.Xr crypt 1
85there).
86For real encryption, refer to
87.Xr openssl 1 ,
88.Xr pgp 1 Pq Pa ports/security/pgp ,
89or
90.Xr gpg 1 Pq Pa ports/security/gnupg .
91However, restrictions for exporting,
92importing or using such tools might exist in some countries, so those
93stronger programs are not being shipped as part of the operating
94system by default.
95.Sh ENVIRONMENT
96.Bl -tag -offset indent -width ".Ev CrYpTkEy"
97.It Ev CrYpTkEy
98used to obtain the secret key when option
99.Fl k
100has been given
101.El
102.Sh EXAMPLES
103.Bd -literal -offset indent
104man enigma | enigma > encrypted
105Enter key: (XXX \(em key not echoed)
106.Ed
107.Pp
108This will create an encrypted form of this man page, and store it in
109the file
110.Pa encrypted .
111.Bd -literal -offset indent
112enigma XXX < encrypted
113.Ed
114.Pp
115This displays the previously created file on the terminal.
116.Sh SEE ALSO
117.Xr gpg 1 ,
118.Xr openssl 1 ,
119.Xr pgp 1 ,
120.Xr ps 1 ,
121.Xr getpass 3
122.Sh HISTORY
123Implementations of
124.Nm crypt
125are very common among
126.Ux
127operating systems.
128This implementation has been taken from the
129.Em Cryptbreakers Workbench
130which is in the public domain.
131