Camelia

Perl 6 Maven

Benchmarking crypt with SHA-512 in Perl 6

Earlier I've explained how to encrypt asswords in Perl 6 using crypt and SHA-512. Some of the commenters have suggested that it can be further improved by adding a "round-factor" further increasing the computation time and thereby making it similar to PBKDF or scrypt.

In this article we'll see how and what is the impact of this extra work.


Benchmarking crypt with SHA-512 in Perl 6


Encrypting Passwords in Perl 6 using crypt and SHA-512

In an earlier article I wrote about encrypting Passwords in Perl 6 using crypt. Several people pointed out and then I looked it up in the documentation of crypt as well, that if one uses a recent (released after 2007) version of glibc2 then instead of the default DES algorithm, the crypt function can be convinced to use the much stronger SHA-512 algorithm.

The full explanation of crypt can be found at the Description of the Crypt library function.

Bcrypt would still be a better solution, but till we can install that module this improvement is still better than the original version.


Encrypting Passwords in Perl 6 using crypt and SHA-512


Encrypting Passwords in Perl 6 using crypt

There are several Perl 6 modules to provide one-way encryption of passwords.

I think Crypt::Bcrypt or Crypt::Argon2 would be the recommended ones to use, but currently they are both broken due to a dependency being broken. In the meantime, let's explore how the encryption could work using Crypt::Libcrypt.

Actually even Libcrypt can be enhanced by using SHA-512. This improvement is described in the new article.


Encrypting Passwords in Perl 6 using crypt


Getting started with Rakudo Perl 6 in a Docker container


Getting started with Rakudo Perl 6 in a Docker container


Number guessing game in Perl 6

This is the Perl 6 solution to the exercise which is the beginning of a game called the Number Guessing game.


Number guessing game in Perl 6


Perl 6 Tricks and Treats newsletter

Register to the free newsletter now, and get updates and news.
Email:
Name: