Help language development. Donate to The Perl Foundation

Auth::SCRAM cpan:MARTIMM last updated on 2019-03-31


Salted Challenge Response Authentication Mechanism (SCRAM)

Build Status AppVeyor Build Status License

This package implements secure authentication mechanism.


# Example from rfc (C = client, s = server)
# C: n,,n=user,r=fyko+d2lbbFgONRv9qkxdawL
# S: r=fyko+d2lbbFgONRv9qkxdawL3rfcNHYJY1ZVvWVs7j,s=QSXCR+Q6sek8bf92,i=4096
# C: c=biws,r=fyko+d2lbbFgONRv9qkxdawL3rfcNHYJY1ZVvWVs7j,
#    p=v0X8v3Bz2T0CJGbJQyF0X+HI4Ts=
# S: v=rmF9pqV8S7suAoZWja4dJRkFsKQ=
class MyClient {

  # Send client first message to server and return server response
  method client-first ( Str:D $client-first-message --> Str ) {

    # Send $client-first-message to server;

    # Get server response, this is the server first message

  # Send client final message to server and return server response
  method client-final ( Str:D $client-final-message --> Str ) {

    # Send $client-final-message to server.

    # Server response is server final message

  method error ( Str:D $message --> Str ) {
    # Errors? nah ... (Famous last words!)

my Auth::SCRAM $sc .= new(

$sc.c-nonce-size = 24;
$sc.c-nonce = 'fyko+d2lbbFgONRv9qkxdawL';

my $error = $sc.start-scram;


Change log * Release notes

Bugs, todo and known limitations * Bugs, todo


Use panda to install the package like so.

$ panda install Auth-SCRAM


$ zef install Auth-SCRAM

Versions of PERL, MOARVM

This project is tested with latest Rakudo built on MoarVM implementing Perl v6.c.


Marcel Timmerman (MARTIMM on github)