e-CryptIt Engine Xojo Plugin

Serpent.Decrypt Method

Use this function to decrypt a block of data.

Because Serpent works on blocks of 16 bytes then you get the best performance if the block size that you pass to it is dividable by 16. The class has built in cache technology so it will work if the the block size is not dividable by 16, but it will be slower.

Decrypt(
   data as String) as String

Parameters

data
The data to decrypt.

Returns

String
returns the Decrypted string.

Remarks

If the total size of all blocks that you encrypt is not dividable by 16 then you will get 1 to 15 unencrypted bytes at the end. Because of that then you should add 15 bytes (PaddingBlockSize-1) of random bytes to the end of the encrypted stream to ensure that all of your data gets encrypted.

After you have finished decrypting all of the blocks then you should call FinishDecrypt which will let the decryptor clean up and it will return all untouched bytes there which should be part of the random bytes if you have done as described above.

Password >= 256 bits will give 256 bit key.

Note:
Normally a 256 bit password is ensured by running the password first through 256 bit hashing algorithm.

See Also

Serpent Class