ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage syntax /  / Advanced types
  • WLanguage properties that can be used with the SecurePassword type
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
The SecurePassword type is a structured type used to obtain a secure, hashed and salted password. This type of variable can be used:
  • for 3-tier applications that handle items of type Password.
  • to store a secure password (hashed and salted) in a binary memo or in an XML file.
Example
oSP is SecurePassword
oSP.Hash = SP_SHA2_256
oSP.IterationCount = 10000
oSP.Size = 256
oSP = "hello"
Syntax

Declaring and initializing a secure password Hide the details

<Password name> is SecurePassword
<Password name>:
Name of the SecurePassword variable to be declared.
Remarks

WLanguage properties that can be used with the SecurePassword type

The following properties can be used to handle a SecurePassword variable:
Property nameTypeEffect
AgeDurationTime elapsed since the password was last changed.
ContentCharacter stringPassword.
DerivationInteger constantKey derivation function used to hash the password:
  • SP_PBKDF2: Password-Based Key Derivation Function 2 (PBKDF2) is used.
PBKDF2 is a key derivation function that takes the following parameters:
  • the password,
  • a hash algorithm (SHA256, SHA512, etc.),
  • a salt (randomly generated). Salts are used to prevent rainbow table attacks.
  • a number of iterations. This number of iterations increases the time it takes to generate/compare a password and prevents attackers from testing millions of passwords in a short time. Thus, the time it would take to generate/compare a password is so long that it becomes impossible to try many combinations.
HashInteger constantSalting algorithm:
  • SP_SHA2_256: Secure Hash Algorithm 256 (SHA-256) is used.
  • SP_SHA2_512: Secure Hash Algorithm 512 (SHA-512) is used.
  • SP_SHA3_256: Secure Hash Algorithm 3-256 (SHA-3 256) is used.
  • SP_SHA3_512: Secure Hash Algorithm 3-512 (SHA-3 512) is used.
IterationCountIntegerNumber of iterations of the hash algorithm used. It is recommended to set a value between 10,000 and 30,000
LengthIntegerHash output length (in bits). The key must be a multiple of 8, greater than 160 bits and less than 2048 bits. It is recommended to use a 256 or 512-bit key.
Minimum version required
  • Version 27
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 07/12/2022

Send a report | Local help