version 1.24, 2014/09/03 07:47:50 |
version 1.25, 2014/12/24 22:04:26 |
|
|
.Nd encrypt passwords from the command line or standard input |
.Nd encrypt passwords from the command line or standard input |
.Sh SYNOPSIS |
.Sh SYNOPSIS |
.Nm encrypt |
.Nm encrypt |
.Op Fl k |
|
.Op Fl b Ar rounds |
.Op Fl b Ar rounds |
.Op Fl c Ar class |
.Op Fl c Ar class |
.Op Fl p | Ar string |
.Op Fl p | Ar string |
.Op Fl s Ar salt |
|
.Nm makekey |
|
.Sh DESCRIPTION |
.Sh DESCRIPTION |
.Nm |
.Nm |
prints the encrypted form of |
prints the encrypted form of |
|
|
to the standard output. |
to the standard output. |
This is mostly useful for encrypting passwords from within scripts. |
This is mostly useful for encrypting passwords from within scripts. |
.Pp |
.Pp |
When invoked as |
|
.Nm makekey , |
|
a single combined key and salt are read from standard |
|
input and the DES encrypted result is written to standard output without a |
|
terminating newline. |
|
.Pp |
|
The options are as follows: |
The options are as follows: |
.Bl -tag -width Ds |
.Bl -tag -width Ds |
.It Fl b Ar rounds |
.It Fl b Ar rounds |
|
|
See |
See |
.Xr login.conf 5 |
.Xr login.conf 5 |
for more information. |
for more information. |
.It Fl k |
|
Run in |
|
.Nm makekey |
|
compatible mode. |
|
.It Fl p |
.It Fl p |
Prompt for a single string with echo turned off. |
Prompt for a single string with echo turned off. |
.It Fl s Ar salt |
|
Encrypt the string using DES, with the specified |
|
.Ar salt . |
|
.El |
.El |
.Pp |
.Pp |
If no |
If no |
.Ar string |
.Ar string |
is specified, |
is specified, |
.Nm |
.Nm |
reads one string per line from standard input, encrypting each one |
reads one string per line from standard input, encrypting each one. |
with the chosen algorithm from above. |
|
In the case where no specific algorithm or specific user login class was given |
In the case where no specific algorithm or specific user login class was given |
as a command line option, the algorithm specified in the default class in |
as a command line option, the algorithm specified in the default class in |
.Pa /etc/login.conf |
.Pa /etc/login.conf |
|
|
.It Pa /etc/login.conf |
.It Pa /etc/login.conf |
.El |
.El |
.Sh SEE ALSO |
.Sh SEE ALSO |
.Xr crypt 3 , |
.Xr crypt_newhash 3 , |
.Xr login.conf 5 |
.Xr login.conf 5 |
.Sh HISTORY |
.Sh HISTORY |
.Nm |
.Nm |
first appeared in |
first appeared in |
.Ox 1.2 . |
.Ox 1.2 . |
.Pp |
|
A |
|
.Nm makekey |
|
command appeared in |
|
.At v7 . |
|