1Authen::Passphrase::MySUQsLe3r23C(o3nptmr)ibuted Perl DoAcuutmheennt:a:tPiaosnsphrase::MySQL323(3pm)
2
3
4
6 Authen::Passphrase::MySQL323 - passphrases using the MySQL v3.23
7 algorithm
8
10 use Authen::Passphrase::MySQL323;
11
12 $ppr = Authen::Passphrase::MySQL323->new(
13 hash_hex => "2af8a0a82c8f9086");
14
15 $ppr = Authen::Passphrase::MySQL323->new(
16 passphrase => "passphrase");
17
18 $hash = $ppr->hash;
19 $hash_hex = $ppr->hash_hex;
20
21 if($ppr->match($passphrase)) { ...
22
24 An object of this class encapsulates a passphrase hashed using the
25 algorithm used by MySQL from version 3.23. This is a subclass of
26 Authen::Passphrase, and this document assumes that the reader is
27 familiar with the documentation for that class.
28
29 The MySQL v3.23 hash scheme is composed entirely of linear operations.
30 It accepts an arbitrarily long passphrase, and ignores all space and
31 tab characters. No salt is used. 62 bits of hash are generated. Each
32 character influences only a minority of the result bits, so similar
33 passphrases of the same length have noticeably similar hashes.
34
35 In MySQL the hash is represented as a string of sixteen lowercase
36 hexadecimal digits.
37
38 Warning: This is not a serious cryptographic algorithm. Do not use for
39 any security purpose.
40
42 Authen::Passphrase::MySQL323->new(ATTR => VALUE, ...)
43 Generates a new passphrase recogniser object using the MySQL v3.23
44 algorithm. The following attributes may be given:
45
46 hash
47 The hash, as a string of eight bytes. The first and fifth
48 bytes must have their top bit clear.
49
50 hash_hex
51 The hash, as a string of 16 hexadecimal digits.
52
53 passphrase
54 A passphrase that will be accepted.
55
56 Either the hash or the passphrase must be given.
57
59 $ppr->hash
60 Returns the hash value, as a string of eight bytes.
61
62 $ppr->hash_hex
63 Returns the hash value, as a string of 16 hexadecimal digits.
64
65 $ppr->match(PASSPHRASE)
66 This method is part of the standard Authen::Passphrase interface.
67
69 Authen::Passphrase, Crypt::MySQL
70
72 Andrew Main (Zefram) <zefram@fysh.org>
73
75 Copyright (C) 2006, 2007, 2009, 2010, 2012 Andrew Main (Zefram)
76 <zefram@fysh.org>
77
79 This module is free software; you can redistribute it and/or modify it
80 under the same terms as Perl itself.
81
82
83
84perl v5.38.0 2023-07-20 Authen::Passphrase::MySQL323(3pm)