Codeunit "Rijndael Cryptography"
Provides helper functions for the Advanced Encryption Standard.
Properties
Name | Value |
---|---|
Access | Public |
InherentEntitlements | X |
InherentPermissions | X |
Methods
InitRijndaelProvider
Initializes a new instance of the RijndaelManaged class with default values.
procedure InitRijndaelProvider()
InitRijndaelProvider
Initializes a new instance of the RijndaelManaged class providing the encryption key.
procedure InitRijndaelProvider(EncryptionKey: SecretText)
Parameters
Name | Type | Description |
---|---|---|
EncryptionKey | SecretText |
Represents the secret key for the symmetric algorithm. |
InitRijndaelProvider
Initializes a new instance of the RijndaelManaged class providing the encryption key and block size.
procedure InitRijndaelProvider(EncryptionKey: SecretText, BlockSize: Integer)
Parameters
Name | Type | Description |
---|---|---|
EncryptionKey | SecretText |
Represents the secret key for the symmetric algorithm. |
BlockSize | Integer |
Represents the block size, in bits, of the cryptographic operation. |
InitRijndaelProvider
Initializes a new instance of the RijndaelManaged class providing the encryption key, block size and cipher mode.
procedure InitRijndaelProvider(EncryptionKey: SecretText, BlockSize: Integer, CipherMode: Text)
Parameters
Name | Type | Description |
---|---|---|
EncryptionKey | SecretText |
Represents the secret key for the symmetric algorithm. |
BlockSize | Integer |
Represents the block size, in bits, of the cryptographic operation. |
CipherMode | Text |
Represents the cipher mode used in the symmetric algorithm. Valid values: ECB,CBC,CFB,CTS,OFB |
InitRijndaelProvider
Initializes a new instance of the RijndaelManaged class providing the encryption key, block size, cipher mode and padding mode.
procedure InitRijndaelProvider(EncryptionKey: SecretText, BlockSize: Integer, CipherMode: Text, PaddingMode: Text)
Parameters
Name | Type | Description |
---|---|---|
EncryptionKey | SecretText |
Represents the secret key for the symmetric algorithm. |
BlockSize | Integer |
Represents the block size, in bits, of the cryptographic operation. |
CipherMode | Text |
Represents the cipher mode used in the symmetric algorithm. Valid values: ECB,CBC,CFB,CTS,OFB |
PaddingMode | Text |
Represents the padding mode used in the symmetric algorithm.. Valid values: None,ANSIX923,ISO10126,PKCS7,Zeros |
SetBlockSize
Sets a new block size value for the RijndaelManaged class.
procedure SetBlockSize(BlockSize: Integer)
Parameters
Name | Type | Description |
---|---|---|
BlockSize | Integer |
Represents the block size, in bits, of the cryptographic operation. |
SetCipherMode
Sets a new cipher mode value for the RijndaelManaged class.
procedure SetCipherMode(CipherMode: Text)
Parameters
Name | Type | Description |
---|---|---|
CipherMode | Text |
Represents the cipher mode used in the symmetric algorithm. Valid values: ECB,CBC,CFB,CTS,OFB |
SetPaddingMode
Sets a new padding mode value for the RijndaelManaged class.
procedure SetPaddingMode(PaddingMode: Text)
Parameters
Name | Type | Description |
---|---|---|
PaddingMode | Text |
Represents the padding mode used in the symmetric algorithm.. Valid values: None,ANSIX923,ISO10126,PKCS7,Zeros |
SetEncryptionData
Sets the key and vector for the RijndaelManaged class.
procedure SetEncryptionData(KeyAsBase64: SecretText, VectorAsBase64: Text)
Parameters
Name | Type | Description |
---|---|---|
KeyAsBase64 | SecretText |
Represents the secret key for the symmetric algorithm encoded as Base64 Text |
VectorAsBase64 | Text |
Represents the initialization vector (IV) for the symmetric algorithm encoded as Base64 Text |
IsValidKeySize
Determines whether the specified key size is valid for the current algorithm.
procedure IsValidKeySize(KeySize: Integer): Boolean
Parameters
Name | Type | Description |
---|---|---|
KeySize | Integer |
Key Size. |
Returns
Type | Description |
---|---|
Boolean |
True if the key size is valid; false otherwise. |
GetLegalKeySizeValues
Specifies the key sizes, in bits, that are supported by the symmetric algorithm.
procedure GetLegalKeySizeValues(var MinSize: Integer, var MaxSize: Integer, var SkipSize: Integer)
Parameters
Name | Type | Description |
---|---|---|
MinSize | Integer |
Minimum Size in bits |
MaxSize | Integer |
Maximum Size in bits |
SkipSize | Integer |
Skip Size in bits |
GetLegalBlockSizeValues
Specifies the block sizes, in bits, that are supported by the symmetric algorithm.
procedure GetLegalBlockSizeValues(var MinSize: Integer, var MaxSize: Integer, var SkipSize: Integer)
Parameters
Name | Type | Description |
---|---|---|
MinSize | Integer |
Minimum Size in bits |
MaxSize | Integer |
Maximum Size in bits |
SkipSize | Integer |
Skip Size in bits |
GetEncryptionData
Gets the key and vector from the RijndaelManaged class
procedure GetEncryptionData(var KeyAsBase64: SecretText, var VectorAsBase64: Text)
Parameters
Name | Type | Description |
---|---|---|
KeyAsBase64 | SecretText |
Represents the secret key for the symmetric algorithm encoded as Base64 Text |
VectorAsBase64 | Text |
Represents the initialization vector (IV) for the symmetric algorithm encoded as Base64 Text |
Encrypt
Returns plain text as an encrypted value.
procedure Encrypt(PlainText: Text): Text
Parameters
Name | Type | Description |
---|---|---|
PlainText | Text |
The value to encrypt. |
Returns
Type | Description |
---|---|
Text |
Encrypted value. |
Encrypt
Returns plain text as an encrypted value.
procedure Encrypt(PlainText: SecretText): SecretText
Parameters
Name | Type | Description |
---|---|---|
PlainText | SecretText |
The value to encrypt. |
Returns
Type | Description |
---|---|
SecretText |
Encrypted value. |
Decrypt
Returns encrypted text as plain text.
procedure Decrypt(CryptedText: Text): Text
Parameters
Name | Type | Description |
---|---|---|
CryptedText | Text |
The value to decrypt. |
Returns
Type | Description |
---|---|
Text |
Plain text. |
Decrypt
Returns encrypted text as plain text.
procedure Decrypt(CryptedText: SecretText): SecretText
Parameters
Name | Type | Description |
---|---|---|
CryptedText | SecretText |
The value to decrypt. |
Returns
Type | Description |
---|---|
SecretText |
Plain text. |