Platforms to show: All Mac Windows Linux Cross-Platform
Back to CipherMBS class.
CipherMBS.CipherInit(key as memoryblock, IV as memoryblock, Encrypt as boolean) as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Encryption and Hash | MBS Encryption Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
We added for 17.3 a new boolean result:
Returns true in case of success and key length is okay.
Returns false in case of failures like out of memory, wrong key length.
Even if key length is wrong, we initialize (as with older versions before) but may crop the key length to default length.
AES 128 uses 16 byte key length, AES 256 uses 32 byte key length.
Key and IV are both filled with zeros to reach the minimum length.
key: The key to use.
IV: Optional, the initial vector.
You can use IVLength and KeyLength properties to learn how long those should be.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Encryption and Hash | MBS Encryption Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
CipherMBS.Constructor Private
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Encryption and Hash | MBS Encryption Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
CipherMBS.Control(Type as Integer, Arg as Integer, Data as Ptr)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Encryption and Hash | MBS Encryption Plugin | 23.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See OpenSSL documentation for EVP_CIPHER_CTX_ctrl function.
CipherMBS.DecryptInit(key as memoryblock, IV as memoryblock = nil) as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Encryption and Hash | MBS Encryption Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
We added for 17.3 a new boolean result:
Returns true in case of success and key length is okay.
Returns false in case of failures like out of memory, wrong key length.
Even if key length is wrong, we initialize (as with older versions before) but may crop the key length to default length.
AES 128 uses 16 byte key length, AES 256 uses 32 byte key length.
Key and IV are both filled with zeros to reach the minimum length.
key: The key to use.
IV: Optional, the initial vector.
You can use IVLength and KeyLength properties to learn how long those should be.
For AES the length of the key defines whether you get 128, 192 or 256 bit encryption. Pass some other key length will return an error. Best is usually to put a hashing algorithm before to make sure the key has the required bit length, e.g. use SHA256MBS class.
Some examples using this method:
CipherMBS.EncryptInit(key as memoryblock, IV as memoryblock = nil) as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Encryption and Hash | MBS Encryption Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
We added for 17.3 a new boolean result:
Returns true in case of success and key length is okay.
Returns false in case of failures like out of memory, wrong key length.
Even if key length is wrong, we initialize (as with older versions before) but may crop the key length to default length.
AES 128 uses 16 byte key length, AES 256 uses 32 byte key length.
Key and IV are both filled with zeros to reach the minimum length.
key: The key to use.
IV: Optional, the initial vector.
You can use IVLength and KeyLength properties to learn how long those should be.
For AES the length of the key defines whether you get 128, 192 or 256 bit encryption. Pass some other key length will return an error. Best is usually to put a hashing algorithm before to make sure the key has the required bit length, e.g. use SHA256MBS class.
Some examples using this method:
CipherMBS.FinalizeAsMemory as memoryblock
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Encryption and Hash | MBS Encryption Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
CipherMBS.FinalizeAsString as String
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Encryption and Hash | MBS Encryption Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returned string does not contain text, but binary data.
Please do not store in text fields in database without using EncodeHex or EncodeBase64 to make it a text string.
Some examples using this method:
CipherMBS.GetGCMTag(Size as Integer = 16) as MemoryBlock
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Encryption and Hash | MBS Encryption Plugin | 23.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Calls the Control method with type EVP_CTRL_GCM_GET_TAG (16).
Raises exception in case of an error.
CipherMBS.ProcessFile(InputFile as FolderItem, OutputFile as FolderItem) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Encryption and Hash | MBS Encryption Plugin | 14.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Plugin will start a preemptive thread to read in file and process all data in chunks and write to output file.
Returns true on success or false on failure. May raise OutOfMemoryException or IOException.
This function works best if called from a thread.
Some examples using this method:
CipherMBS.ProcessMemory(data as memoryblock) as MemoryBlock
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Encryption and Hash | MBS Encryption Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
due to block sizes, the result may be longer or shorter than the input size.
CipherMBS.ProcessString(data as String) as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Encryption and Hash | MBS Encryption Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
due to block sizes, the result may be longer or shorter than the input size.
Returned string does not contain text, but binary data.
Please do not store in text fields in database without using EncodeHex or EncodeBase64 to make it a text string.
Some examples using this method:
CipherMBS.SetGCMTag(Data as MemoryBlock)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Encryption and Hash | MBS Encryption Plugin | 23.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Calls the Control method with type EVP_CTRL_GCM_SET_TAG (17).
Raises exception in case of an error.
CipherMBS.SetPadding(padding as boolean)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Encryption and Hash | MBS Encryption Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
On by default.
The items on this page are in the following plugins: MBS Encryption Plugin.