-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathHashMake.fmfn
More file actions
35 lines (32 loc) · 786 Bytes
/
HashMake.fmfn
File metadata and controls
35 lines (32 loc) · 786 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
/*
* =====================================================
* @function HashMake ( password; key )
*
* @parameter password (string)
* @parameter key (string)
*
* @return string: The salted password.
*
* @category Hashing
*
* @version 1.0
*
* @dependencies RandomString
*
* @purpose Created a salted pasword hash.
*
*
* @changes
* 2017-10-07, Jason Scharf, Created.
* @/changes
* =====================================================
*/
Let(
[
~salt_characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890";
~salt = RandomString(~salt_characters; 16);
~salted_password = ~salt & password;
~hashed_password = Base64EncodeRFC( 3548; CryptAuthCode ( ~salted_password ; "SHA512" ; key ))
];
~salt & "$" & ~hashed_password
)