Mojolicious::Command::bcrypt - bcrypt a password using the settings in your Mojolicious app.
Usage: myapp.pl bcrypt password [OPTIONS] NOTE: If no options are provided, the bcrypt helper installed on your app will be used to generate the crypted text. See Mojolicious::Plugin::BcryptSecure for more info. Options: -c, --cost Uses this cost instead of the one used in your application. Must be an integer between 1 and 99. Default is 12. -nkn, --no-key-nul Flag that specifies that NUL should not be appended to the password before using it as a key. Default is to append NUL. If an empty password is provided, NUL must be appended and will be by Crypt::Eksblowfish::Bcrypt. -s, --salt 22 base 64 digits. Default is Crypt::Eksblowfish::Bcrypt::en_base64(Crypt::URandom::urandom(16)) # output password with your app's bcrypt helper and settings ./myapp.pl bcrypt password # output password not using a bcrypt helper by providing custom settings ./myapp.pl bcrypt password --c 8 ./myapp.pl bcrypt password --cost 8 # do not append a NUL before the password (not recommended) ./myapp.pl bcrypt password --nkn ./myapp.pl bcrypt password --no-key-nul # provide your own salt ./myapp.pl bcrypt password --s YndOHub.EV9Y37VeobUeSu ./myapp.pl bcrypt password --salt YndOHub.EV9Y37VeobUeSu # combine options ./myapp.pl bcrypt password --c 8 --nkn --s YndOHub.EV9Y37VeobUeSu
Mojolicious::Command::bcrypt allows you to crypt a password using bcrypt via a Mojolicious::Command.
bcrypt
If you are using a Mojolicious::Plugin like Mojolicious::Plugin::BcryptSecure or Mojolicious::Plugin::Bcrypt that installs a bcrypt helper, then this helper along with any settings you provided the plugin will be used to generate the crypted text:
# crypt using bcrypt helper ./myapp.pl bcrypt password
If you provide any "OPTIONS", the bcrypt helper (if present) will be ignored, and crypted text will be generated from the provided "OPTIONS" and any defaults:
./myapp.pl bcrypt password --cost 8
A non-negative integer with at most two digits that controls the cost of the hash function. The number of operations is proportional to 2^cost. The default value is 12. This option is described more in Crypt::Eksblowfish::Bcrypt.
./myapp.pl bcrypt password --cost 8 # short option ./myapp.pl bcrypt password --c 8
If present, a NUL is not appended to the password before it is used as a key. The default is to append a NUL and this flag is not recommended. This option is described more in Crypt::Eksblowfish::Bcrypt.
./myapp.pl bcrypt password --no-key-nul # short option ./myapp.pl bcrypt password --nkn
22 base 64 digits that will be used as the salt. The default is Crypt::Eksblowfish::Bcrypt::en_base64(Crypt::URandom::urandom(16)). This option is described more in Crypt::Eksblowfish::Bcrypt.
Crypt::Eksblowfish::Bcrypt::en_base64(Crypt::URandom::urandom(16))
./myapp.pl bcrypt password --salt YndOHub.EV9Y37VeobUeSu # short option ./myapp.pl bcrypt password --s YndOHub.EV9Y37VeobUeSu
Adam Hopkins <srchulo@cpan.org>
Copyright 2019- Adam Hopkins
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Mojolicious::Plugin::BcryptSecure
Crypt::Eksblowfish::Bcrypt
Crypt::URandom
Mojolicious::Plugin::Bcrypt
To install Mojolicious::Command::bcrypt, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Command::bcrypt
CPAN shell
perl -MCPAN -e shell install Mojolicious::Command::bcrypt
For more information on module installation, please visit the detailed CPAN module installation guide.