1Authen::Passphrase::NTHUassehr(3C)ontributed Perl DocumeAnuttahteino:n:Passphrase::NTHash(3)
2
3
4
6 Authen::Passphrase::NTHash - passphrases using the NT-Hash algorithm
7
9 use Authen::Passphrase::NTHash;
10
11 $ppr = Authen::Passphrase::NTHash->new(
12 hash_hex => "7f8fe03093cc84b267b109625f6bbf4b");
13
14 $ppr = Authen::Passphrase::NTHash->new(
15 passphrase => "passphrase");
16
17 $ppr = Authen::Passphrase::NTHash->from_crypt(
18 '$3$$7f8fe03093cc84b267b109625f6bbf4b');
19
20 $ppr = Authen::Passphrase::NTHash->from_rfc2307(
21 '{MSNT}7f8fe03093cc84b267b109625f6bbf4b');
22
23 $hash = $ppr->hash;
24 $hash_hex = $ppr->hash_hex;
25
26 if($ppr->match($passphrase)) { ...
27
28 $passwd = $ppr->as_crypt;
29 $userPassword = $ppr->as_rfc2307;
30
32 An object of this class encapsulates a passphrase hashed using the NT-
33 Hash function. This is a subclass of Authen::Passphrase, and this
34 document assumes that the reader is familiar with the documentation for
35 that class.
36
37 The NT-Hash scheme is based on the MD4 digest algorithm. Up to 128
38 characters of passphrase (characters beyond the 128th are ignored) are
39 represented in Unicode, and hashed using MD4. No salt is used.
40
41 Warning: MD4 is a weak hash algorithm by current standards, and the
42 lack of salt is a design flaw in this scheme. Use this for
43 compatibility only, not by choice.
44
46 Authen::Passphrase::NTHash->new(ATTR => VALUE, ...)
47 Generates a new passphrase recogniser object using the NT-Hash
48 algorithm. The following attributes may be given:
49
50 hash
51 The hash, as a string of 16 bytes.
52
53 hash_hex
54 The hash, as a string of 32 hexadecimal digits.
55
56 passphrase
57 A passphrase that will be accepted.
58
59 Either the hash or the passphrase must be given.
60
61 Authen::Passphrase::NTHash->from_crypt(PASSWD)
62 Generates a new NT-Hash passphrase recogniser object from a crypt
63 string. Two forms are accepted. In the first form, the he crypt
64 string must consist of "$3$$" (note the extra "$") followed by the
65 hash in lowercase hexadecimal. In the second form, the he crypt
66 string must consist of "$NT$" followed by the hash in lowercase
67 hexadecimal.
68
69 Authen::Passphrase::NTHash->from_rfc2307(USERPASSWORD)
70 Generates a new NT-Hash passphrase recogniser object from an RFC
71 2307 string. Two forms are accepted. In the first form, the
72 string must consist of "{MSNT}" followed by the hash in
73 hexadecimal; case is ignored. In the second form, the string must
74 consist of "{CRYPT}" (case insensitive) followed by an acceptable
75 crypt string.
76
78 $ppr->hash
79 Returns the hash value, as a string of 16 bytes.
80
81 $ppr->hash_hex
82 Returns the hash value, as a string of 32 hexadecimal digits.
83
84 $ppr->match(PASSPHRASE)
85 $ppr->as_crypt
86 $ppr->as_rfc2307
87 These methods are part of the standard Authen::Passphrase
88 interface.
89
91 Authen::Passphrase, Digest::MD4
92
94 Andrew Main (Zefram) <zefram@fysh.org>
95
97 Copyright (C) 2006, 2007, 2009, 2010, 2012 Andrew Main (Zefram)
98 <zefram@fysh.org>
99
101 This module is free software; you can redistribute it and/or modify it
102 under the same terms as Perl itself.
103
104
105
106perl v5.34.0 2022-01-20 Authen::Passphrase::NTHash(3)