Platforms to show: All Mac Windows Linux Cross-Platform

AESMBS class   Deprecated

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Encryption and Hash MBS Encryption Plugin 4.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
This item is deprecated and should no longer be used. You can use CipherMBS instead.
A class for AES encryption.
Example
dim a as AESMBS
dim key as MemoryBlock
dim data as MemoryBlock

key=NewMemoryBlock(20)
key.CString(0)="Hello World!1234" // 16 byte key for 128bit

a=new AESMBS

if a.SetKey(key, 128) then

data=NewMemoryBlock(20)
data.StringValue(0,16)="Hello World!"
MsgBox "Before: "+data.StringValue(0,16)
a.Encrypt(data)
MsgBox "After encryption: "+data.StringValue(0,16)
a.Decrypt(data)
MsgBox "After decryption: "+data.StringValue(0,16)
else
MsgBox "Failed"
end if

For newer projects we recommend switching to CipherMBS class.

This class has low level functions like Encrypt. It also has mid level functions like EncryptCFB/CBC. For your convenience, we also have high level functions like EncryptString.

  • 21 methods
    • method Decrypt(idata as memoryblock, odata as memoryblock=nil, iOffset as Integer=0, oOffset as Integer=0)
    • method DecryptCBC(idata as memoryblock, LengthBytes as Integer, IVector as memoryblock=nil, odata as memoryblock=nil, iOffset as Integer=0, oOffset as Integer=0)
    • method 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)
    • method DecryptCFB1(idata as string, IVector as memoryblock=nil) as string
    • method 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)
    • method DecryptCFB128(idata as string, IVector as memoryblock=nil) as string
    • method 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)
    • method DecryptCFB8(idata as string, IVector as memoryblock=nil) as string
    • method DecryptECB(idata as memoryblock, odata as memoryblock=nil, iOffset as Integer=0, oOffset as Integer=0)
    • method Encrypt(idata as memoryblock, odata as memoryblock=nil, iOffset as Integer=0, oOffset as Integer=0)
    • method EncryptCBC(idata as memoryblock, LengthBytes as Integer, IVector as memoryblock=nil, odata as memoryblock=nil, iOffset as Integer=0, oOffset as Integer=0)
    • method 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)
    • method EncryptCFB1(idata as string, IVector as memoryblock=nil) as string
    • method 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)
    • method EncryptCFB128(idata as string, IVector as memoryblock=nil) as string
    • method 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)
    • method EncryptCFB8(idata as string, IVector as memoryblock=nil) as string
    • method EncryptECB(idata as memoryblock, odata as memoryblock=nil, iOffset as Integer=0, oOffset as Integer=0)
    • method 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)
    • method SetKey(key as memoryblock, nBits as Integer) as boolean
    • method SetKey(key as string) as boolean

This class has no sub classes.

Some examples using this class:

Blog Entries

Xojo Developer Magazine

Release notes


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


ACLRightMBS   -   AliasInfoMBS


The biggest plugin in space...