NAME
Crypt::Passphrase::System - An system crypt() encoder for Crypt::Passphrase
VERSION
version 0.020
SYNOPSIS
my $passphrase = Crypt::Passphrase->new(encoder => 'System');
DESCRIPTION
This class implements a Crypt::Passphrase encoder around your system's crypt()
function.
Note that the supported algorithms depend entirely on your platform. The only option portable among unices (descrypt) is not considered safe at all. It will try to pick a good default among the supported options. Because the different algorithms take different parameters they will have to be passed as a settings string if anything else is desired.
By default it uses the first supported algorithm in this list: yescript
, scrypt
, bcrypt
, SHA512crypt
, SHA256crypt
, SHA1crypt
, MD5crypt
, extended descrypt
, descrypt
and NTHASH
.
Configuration
It takes the following arguments for configuration:
type
The type of hash, this must be one of the values supported by the system. If none is given it is picked as described above.
'y'
/'gy'
yescrypt
This is known to be supported on linux systems using
libxcrypt
.'y'
is typically the default for system passwords on such systems.'7'
scrypt
This is known to be supported on linux systems using
libxcrypt
, FreeBSD and Solaris.'2b'
/'2a'
/'2y'
/'2x'
bcrypt
This is the traditional default algoritm of BSD systems. Difference between these types is in obscure edge-cases,
'2b'
should be prefered unless another variant is required. This is also supported on linux systems usinglibxcrypt
and Solaris.'6'
SHA512crypt
This algorithm originated on Linux but is also supported on some BSDs and Solaris.
'5'
SHA256crypt
This algorithm originated on Linux but is also supported on some BSDs and Solaris.
'sha1'
SHA1crypt
This algorithm is supported on NetBSD and Linux systems using
libxcrypt
.'1'
MD5crypt
This is supported on Linux, many BSDs and Solaris.
'md5'
Solaris
MD5crypt
.This is supported on Solaris and Linux systems using
libxcrypt
.'_'
Extended
descrypt
.This is supported on Linux, BSD and Mac OS.
''
descrypt
This is the only algorithm that is universally supported. Unfortunately it's also incredably unsafe and should not be used in production.
Note that unlike all other supported algorithms this lacks a crypt header.
'$3$'
NTHASH
This saltless algorithm originates in the Microsoft world. It's supported on FreeBSD and Linux systems using
libxcrypt
.
settings
The settings used for hashing the password, combining the type above with a type specific information, e.g.
'$1$'
,'$2b$12$'
,'$6$rounds=65600$'
,'$7$DU..../....'
or'$y$j9T$'
. If you don't know what these mean you probably shouldn't touch this parameter. It defaults to something appropriate for the selected algorithm.salt_size
This sets the salt size for algorithm, it defaults to something that should be sensible for your algorithm.
AUTHOR
Leon Timmermans <fawaka@gmail.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2021 by Leon Timmermans.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.