Platforms to show: All Mac Windows Linux Cross-Platform
class AESMBS
class, Encryption and Hash, MBS REALbasic Util Plugin (E4), class AESMBS, Console safe, Plugin version: 4.1, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: A class for AES encryption.
Example:
Notes: This class is very low level. If you have written some high level code based on the class, I may add it directly to the plugin to make it easier.
class, Encryption and Hash, MBS REALbasic Util Plugin (E4), class AESMBS, Console safe, Plugin version: 4.1, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: 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
AESMBS.Decrypt(idata as memoryblock, odata as memoryblock=nil, iOffset as integer=0, oOffset as integer=0)
method, Encryption and Hash, MBS REALbasic Util Plugin (E4), class AESMBS, Console safe, Plugin version: 9.4, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: 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.
Notes: If odata is nil, idata is used for output.
method, Encryption and Hash, MBS REALbasic Util Plugin (E4), class AESMBS, Console safe, Plugin version: 9.4, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: 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.
Notes: If odata is nil, idata is used for output.
AESMBS.DecryptCBC(idata as memoryblock, LengthBytes as integer, IVector as memoryblock=nil, odata as memoryblock=nil, iOffset as integer=0, oOffset as integer=0)
method, Encryption and Hash, MBS REALbasic Util Plugin (E4), class AESMBS, Console safe, Plugin version: 9.4, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Decryptes the 16 byte data blocks within LengthBytes bytes in the data.
Notes:
If odata is nil, idata is used for output.
If IVector is nil, a vector filled with zeros is used.
method, Encryption and Hash, MBS REALbasic Util Plugin (E4), class AESMBS, Console safe, Plugin version: 9.4, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Decryptes the 16 byte data blocks within LengthBytes bytes in the data.
Notes:
If odata is nil, idata is used for output.
If IVector is nil, a vector filled with zeros is used.
AESMBS.DecryptCFB(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, Encryption and Hash, MBS REALbasic Util Plugin (E4), class AESMBS, Console safe, Plugin version: 9.5, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Decryptes the data in CFB128 mode.
Notes:
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.
The old code until plugin version 9.4 had a bug in the CFB method. This was fixed for 9.5. But the old behavior is still accessible using the methods with the Old suffix.
method, Encryption and Hash, MBS REALbasic Util Plugin (E4), class AESMBS, Console safe, Plugin version: 9.5, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Decryptes the data in CFB128 mode.
Notes:
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.
The old code until plugin version 9.4 had a bug in the CFB method. This was fixed for 9.5. But the old behavior is still accessible using the methods with the Old suffix.
AESMBS.DecryptCFBOld(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, Encryption and Hash, MBS REALbasic Util Plugin (E4), class AESMBS, Console safe, Plugin version: 9.5, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Decryptes the data in CFB128 mode.
Notes:
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.
The old code until plugin version 9.4 had a bug in the CFB method. This was fixed for 9.5. But the old behavior is still accessible using the methods with the Old suffix.#
method, Encryption and Hash, MBS REALbasic Util Plugin (E4), class AESMBS, Console safe, Plugin version: 9.5, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Decryptes the data in CFB128 mode.
Notes:
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.
The old code until plugin version 9.4 had a bug in the CFB method. This was fixed for 9.5. But the old behavior is still accessible using the methods with the Old suffix.#
AESMBS.DecryptString(idata as string, IVector as memoryblock=nil) as string
method, Encryption and Hash, MBS REALbasic Util Plugin (E4), class AESMBS, Console safe, Plugin version: 9.5, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Decrypts a string in CFB128 mode.
Example:
Notes:
If IVector is nil, a vector filled with zeros is used.
The bytes from the string are read without checking the text encoding and the result string has no text encoding assigned.
The old code until plugin version 9.4 had a bug in the CFB method. This was fixed for 9.5. But the old behavior is still accessible using the methods with the Old suffix.
method, Encryption and Hash, MBS REALbasic Util Plugin (E4), class AESMBS, Console safe, Plugin version: 9.5, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Decrypts a string in CFB128 mode.
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.EncryptString(s,iv)
MsgBox x
// decrypt
iv=NewMemoryBlock(16)
u=a.DecryptString(x,iv)
u=DefineEncoding(u,encodings.UTF8)
MsgBox u
If IVector is nil, a vector filled with zeros is used.
The bytes from the string are read without checking the text encoding and the result string has no text encoding assigned.
The old code until plugin version 9.4 had a bug in the CFB method. This was fixed for 9.5. But the old behavior is still accessible using the methods with the Old suffix.
AESMBS.DecryptStringOld(idata as string, IVector as memoryblock=nil) as string
method, Encryption and Hash, MBS REALbasic Util Plugin (E4), class AESMBS, Console safe, Plugin version: 9.5, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Decrypts a string in CFB128 mode.
Example:
Notes:
If IVector is nil, a vector filled with zeros is used.
The bytes from the string are read without checking the text encoding and the result string has no text encoding assigned.
The old code until plugin version 9.4 had a bug in the CFB method. This was fixed for 9.5. But the old behavior is still accessible using the methods with the Old suffix.
method, Encryption and Hash, MBS REALbasic Util Plugin (E4), class AESMBS, Console safe, Plugin version: 9.5, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Decrypts a string in CFB128 mode.
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.EncryptString(s,iv)
MsgBox x
// decrypt
iv=NewMemoryBlock(16)
u=a.DecryptString(x,iv)
u=DefineEncoding(u,encodings.UTF8)
MsgBox u
If IVector is nil, a vector filled with zeros is used.
The bytes from the string are read without checking the text encoding and the result string has no text encoding assigned.
The old code until plugin version 9.4 had a bug in the CFB method. This was fixed for 9.5. But the old behavior is still accessible using the methods with the Old suffix.
AESMBS.Encrypt(idata as memoryblock, odata as memoryblock=nil, iOffset as integer=0, oOffset as integer=0)
method, Encryption and Hash, MBS REALbasic Util Plugin (E4), class AESMBS, Console safe, Plugin version: 9.4, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: 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.
Notes: If odata is nil, idata is used for output.
method, Encryption and Hash, MBS REALbasic Util Plugin (E4), class AESMBS, Console safe, Plugin version: 9.4, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: 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.
Notes: If odata is nil, idata is used for output.
AESMBS.EncryptCBC(idata as memoryblock, LengthBytes as integer, IVector as memoryblock=nil, odata as memoryblock=nil, iOffset as integer=0, oOffset as integer=0)
method, Encryption and Hash, MBS REALbasic Util Plugin (E4), class AESMBS, Console safe, Plugin version: 9.4, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Encryptes the 16 byte data blocks within LengthBytes bytes in the data.
Notes:
If odata is nil, idata is used for output.
If IVector is nil, a vector filled with zeros is used.
method, Encryption and Hash, MBS REALbasic Util Plugin (E4), class AESMBS, Console safe, Plugin version: 9.4, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Encryptes the 16 byte data blocks within LengthBytes bytes in the data.
Notes:
If odata is nil, idata is used for output.
If IVector is nil, a vector filled with zeros is used.
AESMBS.EncryptCFB(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, Encryption and Hash, MBS REALbasic Util Plugin (E4), class AESMBS, Console safe, Plugin version: 9.5, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Encryptes the data in CFB128 mode.
Notes:
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.
The old code until plugin version 9.4 had a bug in the CFB method. This was fixed for 9.5. But the old behavior is still accessible using the methods with the Old suffix.
method, Encryption and Hash, MBS REALbasic Util Plugin (E4), class AESMBS, Console safe, Plugin version: 9.5, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Encryptes the data in CFB128 mode.
Notes:
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.
The old code until plugin version 9.4 had a bug in the CFB method. This was fixed for 9.5. But the old behavior is still accessible using the methods with the Old suffix.
AESMBS.EncryptCFBOld(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, Encryption and Hash, MBS REALbasic Util Plugin (E4), class AESMBS, Console safe, Plugin version: 9.5, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Encryptes the data in CFB128 mode.
Notes:
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.
The old code until plugin version 9.4 had a bug in the CFB method. This was fixed for 9.5. But the old behavior is still accessible using the methods with the Old suffix.
method, Encryption and Hash, MBS REALbasic Util Plugin (E4), class AESMBS, Console safe, Plugin version: 9.5, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Encryptes the data in CFB128 mode.
Notes:
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.
The old code until plugin version 9.4 had a bug in the CFB method. This was fixed for 9.5. But the old behavior is still accessible using the methods with the Old suffix.
AESMBS.EncryptString(idata as string, IVector as memoryblock=nil) as string
method, Encryption and Hash, MBS REALbasic Util Plugin (E4), class AESMBS, Console safe, Plugin version: 9.5, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Encrypts a string in CFB128 mode.
Example:
Notes:
If IVector is nil, a vector filled with zeros is used.
The bytes from the string are read without checking the text encoding and the result string has no text encoding assigned.
The old code until plugin version 9.4 had a bug in the CFB method. This was fixed for 9.5. But the old behavior is still accessible using the methods with the Old suffix.
method, Encryption and Hash, MBS REALbasic Util Plugin (E4), class AESMBS, Console safe, Plugin version: 9.5, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Encrypts a string in CFB128 mode.
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.EncryptString(s,iv)
MsgBox x
// decrypt
iv=NewMemoryBlock(16)
u=a.DecryptString(x,iv)
u=DefineEncoding(u,encodings.UTF8)
MsgBox u
If IVector is nil, a vector filled with zeros is used.
The bytes from the string are read without checking the text encoding and the result string has no text encoding assigned.
The old code until plugin version 9.4 had a bug in the CFB method. This was fixed for 9.5. But the old behavior is still accessible using the methods with the Old suffix.
AESMBS.EncryptStringOld(idata as string, IVector as memoryblock=nil) as string
method, Encryption and Hash, MBS REALbasic Util Plugin (E4), class AESMBS, Console safe, Plugin version: 9.5, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Encrypts a string in CFB128 mode.
Example:
Notes:
If IVector is nil, a vector filled with zeros is used.
The bytes from the string are read without checking the text encoding and the result string has no text encoding assigned.
The old code until plugin version 9.4 had a bug in the CFB method. This was fixed for 9.5. But the old behavior is still accessible using the methods with the Old suffix.
method, Encryption and Hash, MBS REALbasic Util Plugin (E4), class AESMBS, Console safe, Plugin version: 9.5, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Encrypts a string in CFB128 mode.
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.EncryptString(s,iv)
MsgBox x
// decrypt
iv=NewMemoryBlock(16)
u=a.DecryptString(x,iv)
u=DefineEncoding(u,encodings.UTF8)
MsgBox u
If IVector is nil, a vector filled with zeros is used.
The bytes from the string are read without checking the text encoding and the result string has no text encoding assigned.
The old code until plugin version 9.4 had a bug in the CFB method. This was fixed for 9.5. But the old behavior is still accessible using the methods with the Old suffix.
AESMBS.SetKey(key as memoryblock, nBits as integer) as boolean
method, Encryption and Hash, MBS REALbasic Util Plugin (E4), class AESMBS, Console safe, Plugin version: 4.1, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Sets the key.
Notes:
possible values for the bitcount:
method, Encryption and Hash, MBS REALbasic Util Plugin (E4), class AESMBS, Console safe, Plugin version: 4.1, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Sets the key.
Notes:
possible values for the bitcount:
| 128 | key is 16 bytes long |
| 192 | key is 24 bytes long |
| 256 | key is 32 bytes long |
See also:
AESMBS.SetKey(key as string) as boolean
method, Encryption and Hash, MBS REALbasic Util Plugin (E4), class AESMBS, Console safe, Plugin version: 9.4, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Sets the key.
Example:
Notes: Please use 16, 24 or 32 byte long key strings.
method, Encryption and Hash, MBS REALbasic Util Plugin (E4), class AESMBS, Console safe, Plugin version: 9.4, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: 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.EncryptString(s,iv)
MsgBox x
// decrypt
iv=NewMemoryBlock(16)
u=a.DecryptString(x,iv)
u=DefineEncoding(u,encodings.UTF8)
MsgBox u
See also:
The items on this page are in the following plugins: MBS REALbasic Util Plugin.
Links
MBS Realbasic Plugins - Pfarrgemeinde Messdiener Nickenich