Platforms to show: All Mac Windows Linux Cross-Platform

Back to AESMBS class.

AESMBS.Decrypt(idata as memoryblock, odata as memoryblock=nil, iOffset as Integer=0, oOffset as Integer=0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 9.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Decryptes the first 16 bytes in the input memoryblock at the given offset and stores the result in the output memoryblock at the given offset.

If odata is nil, idata is used for output.
This is ECB mode.

AESMBS.DecryptCBC(idata as memoryblock, LengthBytes as Integer, IVector as memoryblock=nil, odata as memoryblock=nil, iOffset as Integer=0, oOffset as Integer=0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 9.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Decryptes the 16 byte data blocks within LengthBytes bytes in the data.

If odata is nil, idata is used for output.
If IVector is nil, a vector filled with zeros is used.

AESMBS.DecryptCFB1(idata as memoryblock, LengthBytes as Integer, byref IVectorOffset as Integer, IVector as memoryblock=nil, odata as memoryblock=nil, iOffset as Integer=0, oOffset as Integer=0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 13.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Decryptes the data in CFB1 mode.

If odata is nil, idata is used for output.
If IVector is nil, a vector filled with zeros is used.
IVectorOffset safes the position in the IVector for the next call to this method.
iOffset: offset in idata.
oOffset: offset in odata.
LengthBytes: Length of data in idata and odata.

See also:

Some examples using this method:

AESMBS.DecryptCFB1(idata as string, IVector as memoryblock=nil) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 13.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Decryptes the data in CFB1 mode.
Example
dim a as new AESMBS

if a.SetKey("Hello World") then
dim input as string = "Hello World"
dim encrypted as string = a.EncryptCFB1(input)

if a.SetKey("Hello World") then
dim decrypted as string = a.DecryptCFB1(encrypted)

decrypted = DefineEncoding(decrypted, Encodings.ASCII)

if decrypted = input then
MsgBox "OK"
end if
end if
end if

If IVector is nil, a vector filled with zeros is used.

See also:

AESMBS.DecryptCFB128(idata as memoryblock, LengthBytes as Integer, byref IVectorOffset as Integer, IVector as memoryblock=nil, odata as memoryblock=nil, iOffset as Integer=0, oOffset as Integer=0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 13.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Decryptes the data in CFB128 mode.

If odata is nil, idata is used for output.
If IVector is nil, a vector filled with zeros is used.
IVectorOffset safes the position in the IVector for the next call to this method.
iOffset: offset in idata.
oOffset: offset in odata.
LengthBytes: Length of data in idata and odata.

Older plugin version had problems that they didn't use key at all. So if you want to read old data encrypted with them, you need simply to decrypt without setting key.

See also:

Some examples using this method:

AESMBS.DecryptCFB128(idata as string, IVector as memoryblock=nil) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 13.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Decryptes the data in CFB128 mode.
Example
dim a as new AESMBS

if a.SetKey("Hello World") then
dim input as string = "Hello World"
dim encrypted as string = a.EncryptCFB128(input)

if a.SetKey("Hello World") then
dim decrypted as string = a.DecryptCFB128(encrypted)

decrypted = DefineEncoding(decrypted, Encodings.ASCII)

if decrypted = input then
MsgBox "OK"
end if
end if
end if

If IVector is nil, a vector filled with zeros is used.

Older plugin version had problems that they didn't use key at all. So if you want to read old data encrypted with them, you need simply to decrypt without setting key.

See also:

AESMBS.DecryptCFB8(idata as memoryblock, LengthBytes as Integer, byref IVectorOffset as Integer, IVector as memoryblock=nil, odata as memoryblock=nil, iOffset as Integer=0, oOffset as Integer=0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 13.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Decryptes the data in CFB8 mode.

If odata is nil, idata is used for output.
If IVector is nil, a vector filled with zeros is used.
IVectorOffset safes the position in the IVector for the next call to this method.
iOffset: offset in idata.
oOffset: offset in odata.
LengthBytes: Length of data in idata and odata.

See also:

AESMBS.DecryptCFB8(idata as string, IVector as memoryblock=nil) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 13.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Decryptes the data in CFB8 mode.
Example
dim a as new AESMBS

if a.SetKey("Hello World") then
dim input as string = "Hello World"
dim encrypted as string = a.EncryptCFB8(input)

if a.SetKey("Hello World") then
dim decrypted as string = a.DecryptCFB8(encrypted)

decrypted = DefineEncoding(decrypted, Encodings.ASCII)

if decrypted = input then
MsgBox "OK"
end if
end if
end if

If IVector is nil, a vector filled with zeros is used.

See also:

AESMBS.DecryptECB(idata as memoryblock, odata as memoryblock=nil, iOffset as Integer=0, oOffset as Integer=0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 13.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Decryptes the 16 byte data block in the data.

If odata is nil, idata is used for output.

AESMBS.Encrypt(idata as memoryblock, odata as memoryblock=nil, iOffset as Integer=0, oOffset as Integer=0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 9.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Encryptes the first 16 bytes in the input memoryblock at the given offset and stores the result in the output memoryblock at the given offset.

If odata is nil, idata is used for output.
This is ECB mode.

AESMBS.EncryptCBC(idata as memoryblock, LengthBytes as Integer, IVector as memoryblock=nil, odata as memoryblock=nil, iOffset as Integer=0, oOffset as Integer=0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 9.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Encryptes the 16 byte data blocks within LengthBytes bytes in the data.

If odata is nil, idata is used for output.
If IVector is nil, a vector filled with zeros is used.

AESMBS.EncryptCFB1(idata as memoryblock, LengthBytes as Integer, byref IVectorOffset as Integer, IVector as memoryblock=nil, odata as memoryblock=nil, iOffset as Integer=0, oOffset as Integer=0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 13.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Encryptes the data in CFB1 mode.

If odata is nil, idata is used for output.
If IVector is nil, a vector filled with zeros is used.
IVectorOffset safes the position in the IVector for the next call to this method.
iOffset: offset in idata.
oOffset: offset in odata.
LengthBytes: Length of data in idata and odata.

See also:

Some examples using this method:

AESMBS.EncryptCFB1(idata as string, IVector as memoryblock=nil) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 13.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Encryptes the data in CFB1 mode.
Example
dim a as new AESMBS

if a.SetKey("Hello World") then
dim input as string = "Hello World"
dim encrypted as string = a.EncryptCFB1(input)

if a.SetKey("Hello World") then
dim decrypted as string = a.DecryptCFB1(encrypted)

decrypted = DefineEncoding(decrypted, Encodings.ASCII)

if decrypted = input then
MsgBox "OK"
end if
end if
end if

If IVector is nil, a vector filled with zeros is used.

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.

See also:

AESMBS.EncryptCFB128(idata as memoryblock, LengthBytes as Integer, byref IVectorOffset as Integer, IVector as memoryblock=nil, odata as memoryblock=nil, iOffset as Integer=0, oOffset as Integer=0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 13.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Encryptes the data in CFB128 mode.

If odata is nil, idata is used for output.
If IVector is nil, a vector filled with zeros is used.
IVectorOffset safes the position in the IVector for the next call to this method.
iOffset: offset in idata.
oOffset: offset in odata.
LengthBytes: Length of data in idata and odata.

See also:

Some examples using this method:

AESMBS.EncryptCFB128(idata as string, IVector as memoryblock=nil) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 13.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Encryptes the data in CFB128 mode.
Example
dim a as new AESMBS

if a.SetKey("Hello World") then
dim input as string = "Hello World"
dim encrypted as string = a.EncryptCFB128(input)

if a.SetKey("Hello World") then
dim decrypted as string = a.DecryptCFB128(encrypted)

decrypted = DefineEncoding(decrypted, Encodings.ASCII)

if decrypted = input then
MsgBox "OK"
end if
end if
end if

If IVector is nil, a vector filled with zeros is used.

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.

See also:

AESMBS.EncryptCFB8(idata as memoryblock, LengthBytes as Integer, byref IVectorOffset as Integer, IVector as memoryblock=nil, odata as memoryblock=nil, iOffset as Integer=0, oOffset as Integer=0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 13.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Encryptes the data in CFB8 mode.

If odata is nil, idata is used for output.
If IVector is nil, a vector filled with zeros is used.
IVectorOffset safes the position in the IVector for the next call to this method.
iOffset: offset in idata.
oOffset: offset in odata.
LengthBytes: Length of data in idata and odata.

See also:

AESMBS.EncryptCFB8(idata as string, IVector as memoryblock=nil) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 13.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Encryptes the data in CFB8 mode.
Example
dim a as new AESMBS

if a.SetKey("Hello World") then
dim input as string = "Hello World"
dim encrypted as string = a.EncryptCFB8(input)

if a.SetKey("Hello World") then
dim decrypted as string = a.DecryptCFB8(encrypted)

decrypted = DefineEncoding(decrypted, Encodings.ASCII)

if decrypted = input then
MsgBox "OK"
end if
end if
end if

If IVector is nil, a vector filled with zeros is used.

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.

See also:

AESMBS.EncryptECB(idata as memoryblock, odata as memoryblock=nil, iOffset as Integer=0, oOffset as Integer=0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 13.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Encryptes the 16 byte data block in the data.

If odata is nil, idata is used for output.

AESMBS.EncryptOFB(idata as memoryblock, LengthBytes as Integer, byref IVectorOffset as Integer, IVector as memoryblock=nil, odata as memoryblock=nil, iOffset as Integer=0, oOffset as Integer=0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 13.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Encryptes the data in OFB mode.

If odata is nil, idata is used for output.
If IVector is nil, a vector filled with zeros is used.
IVectorOffset safes the position in the IVector for the next call to this method.
iOffset: offset in idata.
oOffset: offset in odata.
LengthBytes: Length of data in idata and odata.

Some examples using this method:

AESMBS.SetKey(key as memoryblock, nBits as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 4.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the key.

possible values for the bitcount:
128key is 16 bytes long
192key is 24 bytes long
256key is 32 bytes long

Plugin version 13.4 and newer pads this memoryblock with 00 bytes if string is shorter.

See also:

AESMBS.SetKey(key as string) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 9.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the key.
Example
dim x,u,s as string
dim iv as MemoryBlock

s="Hello World"

// encrypt
s=ConvertEncoding(s,encodings.UTF8)

dim a as new AESMBS

call a.SetKey("1234567890123456")

iv=NewMemoryBlock(16)
x=a.EncryptCFB128(s,iv)

MsgBox x

// decrypt

iv=NewMemoryBlock(16)
u=a.DecryptCFB128(x,iv)

u=DefineEncoding(u,encodings.UTF8)

MsgBox u

Please use 16, 24 or 32 byte long key strings.
Plugin version 13.4 and newer pads this string with 00 bytes if string is shorter.

See also:

The items on this page are in the following plugins: MBS Encryption Plugin.


The biggest plugin in space...