PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

  • Availability of algorithms
  • HashCheckString function and UNICODE
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
HashCheckString (Function)
In French: HashVérifieChaîne
Checks the Hash of a character string for a specific type of algorithm. You have the ability to check:
  • a simple hash.
  • a hash with message authentication.
Reminder: The hashing is used to summarize a file or a character string. This summary is called Hash.
Versions 15 and later
PHP This function is now available for the PHP sites.
Java This function is now available for the Java applications.
Android This function is now available for the Android applications.
New in version 15
PHP This function is now available for the PHP sites.
Java This function is now available for the Java applications.
Android This function is now available for the Android applications.
PHP This function is now available for the PHP sites.
Java This function is now available for the Java applications.
Android This function is now available for the Android applications.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 18 and later
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode.
New in version 18
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
// Check the password:
// - Password typed in the "EDT_TypePassword" control
// - The password Hash is found in the "User.HashPassword" item
IF HashCheckString(HA_MD5_128, EDT_TypePassword, ...
User.HashPassword) = True THEN
Info("Password OK.")
// Rest of process
// ...
ELSE
Error("Wrong password.")
// Resume the input
ReturnToCapture(EDT_TypePassword)
END
Syntax

Checking a simple hash Hide the details

<Result> = HashCheckString(<Type of Algorithm> , <String> , <Hash>)
<Result>: Boolean
  • True if the result when <String> was hashed by <Type of Algorithm> corresponds to <Hash>,
  • False otherwise.
<Type of Algorithm>: Integer constant
Indicates the type of algorithm used when hashing the <String>:
Versions 22 and later
DJB2 family (Bernstein)
New in version 22
DJB2 family (Bernstein)
DJB2 family (Bernstein)
Versions 22 and later
HA_DJB2_32
AndroidAndroid Widget JavaPHP Not available.
New in version 22
HA_DJB2_32
AndroidAndroid Widget JavaPHP Not available.
HA_DJB2_32
AndroidAndroid Widget JavaPHP Not available.
Versions 22 and later
HA_DJB2_64
AndroidAndroid Widget JavaPHP Not available.
New in version 22
HA_DJB2_64
AndroidAndroid Widget JavaPHP Not available.
HA_DJB2_64
AndroidAndroid Widget JavaPHP Not available.
MD5 familyHA_MD5_128
SHA familyHA_SHA_160 (also called SHA-1)
HA_SHA_256
HA_SHA_384
HA_SHA_512
Versions 23 and later
SHA-3 family
New in version 23
SHA-3 family
SHA-3 family
Versions 23 and later
HA_SHA3_224
AndroidAndroid Widget JavaPHP Not available.
New in version 23
HA_SHA3_224
AndroidAndroid Widget JavaPHP Not available.
HA_SHA3_224
AndroidAndroid Widget JavaPHP Not available.
Versions 23 and later
HA_SHA3_256
AndroidAndroid Widget JavaPHP Not available.
New in version 23
HA_SHA3_256
AndroidAndroid Widget JavaPHP Not available.
HA_SHA3_256
AndroidAndroid Widget JavaPHP Not available.
Versions 23 and later
HA_SHA3_384
AndroidAndroid Widget JavaPHP Not available.
New in version 23
HA_SHA3_384
AndroidAndroid Widget JavaPHP Not available.
HA_SHA3_384
AndroidAndroid Widget JavaPHP Not available.
Versions 23 and later
HA_SHA3_512
AndroidAndroid Widget JavaPHP Not available.
New in version 23
HA_SHA3_512
AndroidAndroid Widget JavaPHP Not available.
HA_SHA3_512
AndroidAndroid Widget JavaPHP Not available.
RIPEMD familyHA_RIPEMD_128
AndroidAndroid Widget Java Not available.
HA_RIPEMD_160
AndroidAndroid Widget Java Not available.
TIGER familyHA_TIGER_128
AndroidAndroid Widget JavaPHP Not available.
AndroidAndroid Widget Java Not available.
HA_TIGER_160
AndroidAndroid Widget JavaPHP Not available.
AndroidAndroid Widget Java Not available.
HA_TIGER_192
AndroidAndroid Widget JavaPHP Not available.
AndroidAndroid Widget Java Not available.
WHIRLPOOL familyHA_WHIRLPOOL
AndroidAndroid Widget Java Not available.
CKSUM familyHA_CKSUM_8
AndroidAndroid Widget Java Not available.
HA_CKSUM_16
AndroidAndroid Widget Java Not available.
HA_CKSUM_32
AndroidAndroid Widget Java Not available.
HA_CKSUM_64
AndroidAndroid Widget Java Not available.
  • MD5/SHA/RIPEMD algorithms: standard cryptographic hash functions.
  • TIGER/WHIRLPOOL algorithms: hash functions with high cryptographic properties optimized for the 64-bit mode (but can also be used in 32-bit mode).
    PHP The TIGER algorithms are not available.
  • CKSUM algorithms: hash functions with no cryptographic property, should be used to perform low-level checks or with hashing tables.
  • Versions 22 and later
    DJB2 algorithm (Bernstein): hash functions reserved to strings and with no cryptographic property, should be used to perform low-level checks or with hashing tables. Few risks to get an identical hash.
    New in version 22
    DJB2 algorithm (Bernstein): hash functions reserved to strings and with no cryptographic property, should be used to perform low-level checks or with hashing tables. Few risks to get an identical hash.
    DJB2 algorithm (Bernstein): hash functions reserved to strings and with no cryptographic property, should be used to perform low-level checks or with hashing tables. Few risks to get an identical hash.
<String>: Character string (with quotes)
String for which the Hash will be checked.
<Hash>: Character string (with quotes)
Hash of string to check. This Hash must be the result of HashString previously called for <String> on <Type of Algorithm>.

Checking a hash with message authentication (HMAC algorithm) Hide the details

<Result> = HashCheckString(<Type of Algorithm> , <String> , <Hash> , <Secret Key>)
<Result>: Boolean
  • True if the result when <String> was hashed by <Type of Algorithm> corresponds to <Hash>,
  • False otherwise.
<Type of Algorithm>: Integer constant
Indicates the type of HMAC algorithm used when hashing the <String>:
MD5 familyHA_HMAC_MD5_128
SHA familyHA_HMAC_SHA_160
HA_HMAC_SHA_256
HA_HMAC_SHA_384
HA_HMAC_SHA_512
Versions 23 and later
SHA-3 family
New in version 23
SHA-3 family
SHA-3 family
Versions 23 and later
HA_SHA3_224
AndroidAndroid Widget JavaPHP Not available.
New in version 23
HA_SHA3_224
AndroidAndroid Widget JavaPHP Not available.
HA_SHA3_224
AndroidAndroid Widget JavaPHP Not available.
Versions 23 and later
HA_SHA3_256
AndroidAndroid Widget JavaPHP Not available.
New in version 23
HA_SHA3_256
AndroidAndroid Widget JavaPHP Not available.
HA_SHA3_256
AndroidAndroid Widget JavaPHP Not available.
Versions 23 and later
HA_SHA3_384
AndroidAndroid Widget JavaPHP Not available.
New in version 23
HA_SHA3_384
AndroidAndroid Widget JavaPHP Not available.
HA_SHA3_384
AndroidAndroid Widget JavaPHP Not available.
Versions 23 and later
HA_SHA3_512
AndroidAndroid Widget JavaPHP Not available.
New in version 23
HA_SHA3_512
AndroidAndroid Widget JavaPHP Not available.
HA_SHA3_512
AndroidAndroid Widget JavaPHP Not available.
RIPEMD familyHA_HMAC_RIPEMD_128
AndroidAndroid Widget Java Not available.
HA_HMAC_RIPEMD_160
AndroidAndroid Widget Java Not available.
TIGER familyHA_HMAC_TIGER_128
AndroidAndroid Widget JavaPHP Not available.
AndroidAndroid Widget Java Not available.
HA_HMAC_TIGER_160
AndroidAndroid Widget JavaPHP Not available.
AndroidAndroid Widget Java Not available.
HA_HMAC_TIGER_192
AndroidAndroid Widget JavaPHP Not available.
AndroidAndroid Widget Java Not available.
WHIRLPOOL familyHA_HMAC_WHIRLPOOL
AndroidAndroid Widget Java Not available.
  • MD5/SHA/RIPEMD algorithms: standard cryptographic hash functions.
  • TIGER/WHIRLPOOL algorithms: hash functions with high cryptographic properties optimized for the 64-bit mode (but can also be used in 32-bit mode).
    PHP The TIGER algorithms are not available.
<String>: Character string (with quotes)
String for which the Hash will be checked.
<Hash>: Character string (with quotes)
Hash of string to check. This Hash must be the result of HashString previously called for <String> on <Type of Algorithm>.
<Secret Key>: Character string (with quotes)
Authentication key of message. This key must be identical to the one used to calculate the Hash.
AndroidAndroid Widget Java This parameter must not be an empty string.
Remarks

Availability of algorithms

PHP
  • The available algorithms depend on the configuration of the PHP server.
The TIGER algorithms are not available.The SHA-3 algorithms are not available.
AndroidAndroid Widget Java Only the following algorithms are supported:
  • HA_MD5_128
  • HA_SHA_160, HA_SHA_256, HA_SHA_384, HA_SHA_512
  • HA_HMAC_MD5_128
  • HA_HMAC_SHA_160, HA_HMAC_SHA_256, HA_HMAC_SHA_384, HA_SHA_HMAC_512.

HashCheckString function and UNICODE

Multi-platform development: To use Hash of strings between several platforms (a hash generated in iOS and checked in Android or Windows for example), no Unicode string must be used. Indeed, the Unicode strings do not have the same format according to the platforms. In this case, we advise you to use strings in ANSI or UTF 8 format (and to convert the Unicode strings if necessary).
Components
WINDEVWEBDEV - Server codeReports and Queries wd230com.dll
Windows Mobile wp230com.dll
Java wd230java.jar
Linux wd230com.so
Android wd230android.jar
Minimum required version
  • Version 11
This page is also available for…
Comments
Click [Add] to post a comment