e-CryptIt Engine Xojo Plugin |

# Serpent Class (console safe)

Serpent is a 128-bit block cipher designed by Ross Anderson, Eli Biham and Lars Knudsen as a candidate for the Advanced Encryption Standard. It was a finalist in the AES competition. The winner, Rijndael, got 86 votes at the last AES conference while Serpent got 59 votes, Twofish 31 votes, RC6 23 votes and MARS 13 votes.
Rijndael (AES) is faster than the Serpent, but some people consider Serpent to be more secure.
The key size in Serpent can be up to 256 bits.
The block size in AES is 128 bits (16 bytes).
The Serpent class supports both ECB non chained mode and CBC chained mode.

Object
Serpent

class Serpent implements

IEncryptionAlgorithm

#### Constructors

Serpent (console safe) | A constructor that does not take IV vector for chaining mode.
Serpent (console safe) | A constructor that does take IV vector for chaining mode.

#### Methods

Decrypt (console safe) | 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.
Encrypt (console safe) | Use this function to encrypt 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.
FinishDecrypt (console safe) | Use this function to finish decrypting after you have decrypted all of the blocks.
FinishEncrypt (console safe) | Use this function to finish encrypting after you have encrypted all of the blocks.
PaddingBlockSize (console safe) | Use this property to get the padding value that is needed for this algorithm. (Serpent will always return 16 here).

#### Constants

ModeECB = 1 | A constant that specifies ECB mode encryption or decryption.
ModeCBC = 2 | A constant that specifies CBC mode encryption or decryption.
KeyTypeEncrypt = 0 | A constant that specifies that a Key is for encryption
KeyTypeDecrypt = 1 | A constant that specifies that a Key is for decryption
KeyTypeBoth = 2 | A constant that specifies that a Key is for either encryption or decryption

#### Supported Platforms:

- macOS Intel 64 bit
- macOS Apple Silicon
- Windows 32 bit
- Windows 64 bit
- Windows ARM 64 bit
- Linux 32 bit
- Linux 64 bit
- Linux ARM 32 bit
- Linux ARM 64 bit
- iOS