Platforms to show: All Mac Windows Linux Cross-Platform
CipherMBS.CipherInit(key as memoryblock, IV as memoryblock, Encrypt as boolean) as Boolean
Function:
Initializes the cipher for encryption or decryption.
Notes:
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 |
Notes:
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.
CipherMBS.Clear
Function:
Clears the current state.
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
Function:
The private constructor.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Encryption and Hash | MBS Encryption Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
CipherMBS.DecryptInit(key as memoryblock, IV as memoryblock = nil) as Boolean
Function:
Initializes the cipher for decrypting.
Example:
Notes:
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.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Encryption and Hash | MBS Encryption Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Example:
dim key as string = "mysecretkey"
dim encrypted as string = "6IcB9bpDwOjjONErhYQ6c7+Fb4qszsUNZVU0iThLYqOu7chJ7MG2nwSpRBUY0ZC3"
encrypted = DecodeBase64(encrypted)
dim c as CipherMBS = CipherMBS.aes_128_cbc
call c.DecryptInit key
dim s as string = c.ProcessString(Encrypted)+c.FinalizeAsString
Break // "In welcher Stadt steht das Bundeshaus?" is now in s.
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
Function:
Initializes the cipher for encrypting.
Example:
Notes:
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.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Encryption and Hash | MBS Encryption Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Example:
dim c as CipherMBS = CipherMBS.aes_128_cfb128
dim CKey as MemoryBlock = "1234567812345678"
dim CIV as MemoryBlock
dim data as string = "Hello World. Just a test!"
call c.EncryptInit Ckey, CIV
dim output as string = c.ProcessString(data)
output = output + c.FinalizeAsString
MsgBox EncodeHex(output)
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
Function:
Finalizes en/decryption and returns last data.
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
Function:
Finalizes en/decryption and returns last data.
Example:
Notes:
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.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Encryption and Hash | MBS Encryption Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Example:
dim c as CipherMBS = CipherMBS.aes_128_cfb128
dim CKey as MemoryBlock = "1234567812345678"
dim CIV as MemoryBlock
dim data as string = "Hello World. Just a test!"
call c.EncryptInit Ckey, CIV
dim output as string = c.ProcessString(data)
output = output + c.FinalizeAsString
MsgBox EncodeHex(output)
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.ProcessFile(InputFile as FolderItem, OutputFile as FolderItem) as boolean
Function:
Processes content of file.
Notes:
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.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Encryption and Hash | MBS Encryption Plugin | 14.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes:
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
Function:
Processes data in a memory block.
Notes: due to block sizes, the result may be longer or shorter than the input size.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Encryption and Hash | MBS Encryption Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes: due to block sizes, the result may be longer or shorter than the input size.
CipherMBS.ProcessString(data as String) as string
Function:
Processes data in a string.
Example:
Notes:
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.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Encryption and Hash | MBS Encryption Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Example:
dim key as string = "mysecretkey"
dim encrypted as string = "6IcB9bpDwOjjONErhYQ6c7+Fb4qszsUNZVU0iThLYqOu7chJ7MG2nwSpRBUY0ZC3"
encrypted = DecodeBase64(encrypted)
dim c as CipherMBS = CipherMBS.aes_128_cbc
call c.DecryptInit key
dim s as string = c.ProcessString(Encrypted)+c.FinalizeAsString
Break // "In welcher Stadt steht das Bundeshaus?" is now in s.
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.SetPadding(padding as boolean)
Function:
Enables padding.
Notes: On by default.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Encryption and Hash | MBS Encryption Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes: On by default.
The items on this page are in the following plugins: MBS Encryption Plugin.
Feedback: Report problem or ask question.
