Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Wed, 17 Jul 2013 19:44:09 +0000
From: x2345234@...mail.org
To: john-users@...ts.openwall.com
Subject: 'sha1pass' support

Hi,

does john support hashes that were created using 'sha1pass' (syslinux)?

http://manpages.ubuntu.com/manpages/natty/man1/sha1pass.1.html

sample hash:

sha1pass password
$4$N9bcelN+$Q2TRqAt856G+EpmDgPjU9QHSQ+c$


'sha1pass' is a simple perl script:

#!/usr/bin/perl

use bytes;
use Digest::SHA1;
use MIME::Base64;

sub random_bytes($) {
    my($n) = @_;
    my($v, $i);

    if ( open(RANDOM, '<', '/dev/random') ||
	 open(RANDOM, '<', '/dev/urandom') ) {
	read(RANDOM, $v, $n);
    } else {
	# No real RNG available...
	srand($$ ^ time);
	$v = '';
	for ( $i = 0 ; $i < $n ; $i++ ) {
	    $v .= ord(int(rand() * 256));
	}
    }

    return $v;
}


($pass, $salt) = @ARGV;

unless (defined($salt)) {
    $salt = MIME::Base64::encode(random_bytes(6), '');
}
$pass = Digest::SHA1::sha1_base64($salt, $pass);

print '$4$', $salt, '$', $pass, "\$\n";

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.