-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathHashCheck.fmfn
More file actions
36 lines (33 loc) · 820 Bytes
/
HashCheck.fmfn
File metadata and controls
36 lines (33 loc) · 820 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
* =====================================================
* @function HashMake ( password; hashed_password; key )
*
* @parameter password (string)
* @parameter hashed_password (string)
* @parameter key (string)
*
* @return boolean.
*
* @category Hashing
*
* @version 1.0
*
* @dependencies text.explode, HashMake
*
* @purpose Check a password against a salted password.
*
*
* @changes
* 2017-10-07, Jason Scharf, Created.
* @/changes
* =====================================================
*/
Let(
[
~hashed_password_parts = text.explode("$"; hashed_password);
~salt = GetValue(~hashed_password_parts; 1 );
~salted_password = ~salt & password;
~check = ~salt & "$" & Base64EncodeRFC( 3548; CryptAuthCode ( ~salted_password ; "SHA512" ; key ))
];
hashed_password = ~check
)