Initializes Twofish key from password.
Unit
Syntax
ParametersAPassword [in, opt] User password.
ASalt [in, opt] Optional salt value. It is recommended to always use/specify salt when possible - to defend against dictionary and pre-computed rainbow table attacks. Use InitSalt function to create new salt for encryption and store salt with encrypted data. Use stored salt to decrypt data.
AData [in] Pointer to binary password to initialize the key.
ADataSize [in] Size of AData in bytes.
Return valuePrecalculated 256-bit Twofish key derived from APassword and (optionally) ASalt.
Delete this key by using TwofishDestroyKey function.
This value is always the same for the same APassword (and same ASalt).
RemarksThis function converts APassword to UTF-8, attaches ASalt (if specified), then uses the resulting RAW binary string to initialize the key. This function uses SHA-1 to derive key. Therefore the key has size of 256 bits.
Delete the returned value by using TwofishDestroyKey function when you have finished working with key.
Overloaded variant lets you initialize key from any binary password.
Twofish is a symmetric key block cipher with a block size of 128 bits and key sizes up to 256 bits. It was one of the five finalists of the Advanced Encryption Standard (AES) contest, but it was not selected for standardization. Twofish's distinctive features are the use of pre-computed key-dependent S-boxes, and a relatively complex key schedule. Twofish cipher has not been patented. As a result, the Twofish algorithm is free for anyone to use without any restrictions whatsoever. However, Twofish has seen less widespread usage than Blowfish, which has been available longer.
See also
|