Changeset View
Changeset View
Standalone View
Standalone View
head/lib/libcrypt/crypt.3
Show All 23 Lines | |||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd March 9, 2014 | .Dd August 10, 2016 | ||||
.Dt CRYPT 3 | .Dt CRYPT 3 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm crypt | .Nm crypt | ||||
.Nd Trapdoor encryption | .Nd Trapdoor encryption | ||||
.Sh LIBRARY | .Sh LIBRARY | ||||
.Lb libcrypt | .Lb libcrypt | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.In unistd.h | .In unistd.h | ||||
.Ft char * | .Ft char * | ||||
.Fn crypt "const char *key" "const char *salt" | .Fn crypt "const char *key" "const char *salt" | ||||
.Ft char * | |||||
.Fn crypt_r "const char *key" "const char *salt" "struct crypt_data *data" | |||||
.Ft const char * | .Ft const char * | ||||
.Fn crypt_get_format "void" | .Fn crypt_get_format "void" | ||||
.Ft int | .Ft int | ||||
.Fn crypt_set_format "const char *string" | .Fn crypt_set_format "const char *string" | ||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
The | The | ||||
.Fn crypt | .Fn crypt | ||||
function performs password hashing with additional code added to | function performs password hashing with additional code added to | ||||
▲ Show 20 Lines • Show All 189 Lines • ▼ Show 20 Lines | |||||
.Ql sha512 | .Ql sha512 | ||||
and | and | ||||
.Ql nth . | .Ql nth . | ||||
.Pp | .Pp | ||||
The | The | ||||
.Fn crypt_set_format | .Fn crypt_set_format | ||||
function sets the default encoding format according to the supplied | function sets the default encoding format according to the supplied | ||||
.Fa string . | .Fa string . | ||||
.Pp | |||||
The | |||||
.Fn crypt_r | |||||
function behaves identically to | |||||
.Fn crypt , | |||||
except that the resulting string is stored in | |||||
.Fa data , | |||||
making it thread-safe. | |||||
.Sh RETURN VALUES | .Sh RETURN VALUES | ||||
The | The | ||||
.Fn crypt | .Fn crypt | ||||
function returns a pointer to the encrypted value on success, and NULL on | and | ||||
.Fn crypt_r | |||||
functions return a pointer to the encrypted value on success, and NULL on | |||||
failure. | failure. | ||||
Note: this is not a standard behaviour, AT&T | Note: this is not a standard behaviour, AT&T | ||||
.Fn crypt | .Fn crypt | ||||
will always return a pointer to a string. | will always return a pointer to a string. | ||||
.Pp | .Pp | ||||
The | The | ||||
.Fn crypt_set_format | .Fn crypt_set_format | ||||
function will return 1 if the supplied encoding format was valid. | function will return 1 if the supplied encoding format was valid. | ||||
Show All 14 Lines | |||||
.At v7 . | .At v7 . | ||||
.Pp | .Pp | ||||
The | The | ||||
.Tn DES | .Tn DES | ||||
section of the code (FreeSec 1.0) was developed outside the United | section of the code (FreeSec 1.0) was developed outside the United | ||||
States of America as an unencumbered replacement for the U.S.-only | States of America as an unencumbered replacement for the U.S.-only | ||||
.Nx | .Nx | ||||
libcrypt encryption library. | libcrypt encryption library. | ||||
.Pp | |||||
The | |||||
.Fn crypt_r | |||||
function was added in | |||||
.Fx 12.0 . | |||||
.Sh AUTHORS | .Sh AUTHORS | ||||
.An -nosplit | .An -nosplit | ||||
Originally written by | Originally written by | ||||
.An David Burren Aq Mt davidb@werj.com.au , | .An David Burren Aq Mt davidb@werj.com.au , | ||||
later additions and changes by | later additions and changes by | ||||
.An Poul-Henning Kamp , | .An Poul-Henning Kamp , | ||||
.An Mark R V Murray , | .An Mark R V Murray , | ||||
.An Michael Bretterklieber , | .An Michael Bretterklieber , | ||||
Show All 20 Lines |