scrypt hash format
#1
Does hashcat support hashes in the format 
Code:
scrypt$01zMhhtsm7hd$11$8$1$64$zpJQwicV2twXVpabH8/kCTaKUlx99Xplim50HJY4BA81xJxIG/R2BQ4QHOW3h15AGusc5lhYso3UJjkiTRXXTQ==
?

Note, this particular hash is from the 2019 Crack me if you Can competition, which is the first time I've encountered scrypt hashes.

I don't see hashes of this format on the https://hashcat.net/wiki/doku.php?id=example_hashes page, but possibly this can be trivially transformed in to one that is there?

Adam
Reply
#2
You have to reformat the hashes for cracking with hascat. Hashcat's format is SCRYPT:n:r:p:salt:hash

salt and hash are base64-encoded. I think hashcat only supports hash lengths of 32 bytes. You have to truncate the hash value to 32 bytes in the case of cmiyc hashes.
Reply
#3
Example method - script by atom.

Code:
#!/usr/bin/perl

use strict;
use warnings;
use MIME::Base64;

while (my $line = <>)
{
  chomp $line;

  my @data = split '\$', $line;

  if ($data[5] ne 64)
  {
    die "invalid\n";
  }

  my ($user, undef) = split '\:', $data[0];

  my $hash_bin = decode_base64($data[6]);

  my $hash_trunc = encode_base64(substr($hash_bin, 0, 32), "");

  my $salt_enc = encode_base64 ($data[1], "");

  printf ("%s:SCRYPT:%d:%d:%d:%s:%s\n", $user, 1<<$data[2], $data[3], $data[4], $salt_enc, $hash_trunc);

}
~
Reply