Explore more
Securing data with Make
Hash functions
2 min
hash functions take variable length inputs and produce fixed length outputs of text that can't be reversed or decoded the resulting output can only be compared hashing is used for integrity verification for example, a typical business use of hash functions is for the secure storage of user passwords when a user sets or changes a password, the system does not store the original password instead, it stores a hash value and a salt in the database first, a unique string (salt), is added to the user's password salting the password ensures that, even if two users have the same password, the password hash values will be different next, the salt and password are hashed and the password hash value and unique salt are stored in the database the original password is not saved when the user attempts to log in, the system retrieves the stored salt and password hash, calculates a new hash, and compares the new hash to the stored password hash this method protects users if the database is breached the following hash functions can be used in {{product name}} function description sha1 the https //help make com/text and binary functions#sha1 has an output size of 160 bits though faster than the sha256 and sha512 functions, it is not as secure it is generally not recommended for use sha256 the https //help make com/text and binary functions#sha256 has an output size of 256 bits it is secure to use for data integrity and performs quickly on 32 bit systems sha 256 is a widely accepted standard that is used often sha512 the https //help make com/text and binary functions#sha512 has an output size of 512 bits sha 512 is used for the highest level of security or when 64 bit is required md5 the https //help make com/text and binary functions#md5 has an output size of 128 bits it's most commonly used to validate that a file has been downloaded correctly without any missing or corrupted data it is not recommended for use otherwise you can find hash functions under the text and binary functions tab example compare hash values in this example we will select content to hash set variables with a variety of sha functions compare hash values step 1 select content to hash in this example, we set a variable initialtext with our content to be hashed in your scenario, you may have the content set another way or pulled from a different source step 2 set variables with a variety of sha functions the most common hash functions are sha256 and sha512 here we set three variables with the set multiple variables module using the original content initialtext hash sha256 , hash sha512 , and hash sha512++ , a hash with a salt added sha functions allow you to add extra parameters, and in the case of hash sha512++ , we set the value to hexadecimal and added more information as a salt for additional security the output of these variables are hash values of the original content initialtext step 3 compare hash values a hash is often stored and then compared later with a new hash for example, if you set a password for an account, the hash is stored then, when you log in again, the hash of your new input (your password) is compared to the stored hash if the hash values match, you are logged in to your account if the hash values differ, you are denied access here, the new input is received, set as variables and hashed, and the new hash values are compared in the filters set after the router if the results do not match, the result is an error in the password example described above, a user would not be allowed to log in if the results match, there is no error in the password example described above, a user would be allowed to log in