enigma.1 2.7 KB

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