NAME
Crypt::Passphrase::System - An system crypt() encoder for Crypt::Passphrase
VERSION
version 0.022
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: yescrypt, 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'yescryptis known to be supported on linux systems usinglibxcrypt.'y'is typically the default for system passwords on such systems.'7'scryptis known to be supported on linux systems usinglibxcrypt, FreeBSD and Solaris.'2b'/'2a'/'2y'/'2x'bcryptis 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 usinglibxcryptand Solaris.'6'SHA512cryptoriginated on Linux but is also supported on some BSDs and Solaris.'5'SHA256cryptoriginated on Linux but is also supported on some BSDs and Solaris.'sha1'SHA1cryptis supported on NetBSD and Linux systems usinglibxcrypt.'1'MD5cryptis supported on Linux, many BSDs and Solaris.'md5'Solaris
MD5cryptis supported on Solaris and Linux systems usinglibxcrypt.'_'Extended
descryptis supported on Linux, BSD and Mac OS.''descryptis 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'NTHASHis a saltless algorithm originating in the Microsoft world. It's supported on FreeBSD and Linux systems usinglibxcrypt.
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.