Platforms to show: All Mac Windows Linux Cross-Platform

Back to BlowfishMBS class.

BlowfishMBS.Decrypt(iodata as memoryblock)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 6.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Lowest level function to decrypt data in a memoryblock.

input and output are in host endian format.
memoryblock must be not nil and has a size of 8 bytes.

See also:

BlowfishMBS.DecryptCBC(data as string, byref temp as memoryblock) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 6.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The continuing Blowfish decryption function.
Example
dim b as new BlowfishMBS

dim s as string = "UTYbBEZSMLfa0kvNDSla/n/GSUcA/545gp7LcA330Nw="
dim x as string = DecodeBase64(s)

dim m as MemoryBlock = nil
b = new BlowfishMBS
b.SetKey "geheim"
dim t1 as string = b.DecryptCBC(x,m)

// shows SD10003$$2012.03.16 11:00
MsgBox t1

data: data to be decrypted
temp: memoryblock for temporary data. Is created when called with nil value. Pass on following calls to allow data to be shared between function calls.

Returns "" on invalid input.
You can create yourself an eight byte memoryblock with a starting value you want.
Be aware that this CBC method works with data in 8 byte blocks, so you need to unpad data if needed.

See also:

BlowfishMBS.DecryptCBC(idata as memoryblock, odata as memoryblock, offset as Integer, length as Integer, ivec as memoryblock)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 6.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The continuing Blowfish decryption function.

idata: memoryblock for input data, 8 bytes in size and not nil.
odata: memoryblock for output data, 8 bytes in size and not nil.
offset: offset in input and output memoryblocks
length: length of data in memoryblock in bytes. Multiply of 8.
ivec: memoryblock for temporary data, 8 bytes in size and not nil.

ivec should be a memoryblock of 8 bytes size which you create before calling the function for the first time. On the next time you passed the same block, so the function can store data inside this memoryblock between function calls.
Be aware that this CBC method works with data in 8 byte blocks, so you need to unpad data if needed.

See also:

BlowfishMBS.DecryptCFB64(data as string, byref temp as memoryblock) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 6.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The continuing Blowfish decryption function.

data: data to be decrypted
temp: memoryblock for temporary data. Is created when called with nil value. Pass on following calls to allow data to be shared between function calls.

Returns "" on invalid input.
You can create yourself a twelve byte memoryblock with a starting value you want. First four bytes are position and next 8 bytes the current vector.

See also:

BlowfishMBS.DecryptCFB64(idata as memoryblock, odata as memoryblock, offset as Integer, length as Integer, ivec as memoryblock, byref num as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 6.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The continuing Blowfish decryption function.
Example
dim b as BlowfishMBS

b=new BlowfishMBS
b.SetKey "Key"

dim temp as MemoryBlock
dim s as string

s=b.EncryptCFB64("Hello World",temp)

MsgBox s

temp=nil // reset
s=b.DecryptCFB64(s,temp)

MsgBox s

idata: memoryblock for input data, 8 bytes in size and not nil.
odata: memoryblock for output data, 8 bytes in size and not nil.
offset: offset in input and output memoryblocks
length: length of data in memoryblock in bytes. Multiply of 8.
ivec: memoryblock for temporary data, 8 bytes in size and not nil.
num: current position in ivec. Pass 0 as start value and pass the value you get back to the next function call.

Returns "" on invalid input.
You can create yourself a twelve byte memoryblock with a starting value you want. First four bytes are position and next 8 bytes the current vector.

See also:

BlowfishMBS.DecryptECB(data as string) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 6.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The basic Blowfish decryption function.

This function decrypts only 8 bytes. For more, please use other functions!

data: data to be decrypted
Returns "" on invalid input.

See also:

BlowfishMBS.DecryptECB(idata as memoryblock, odata as memoryblock, offset as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 6.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The basic Blowfish encryption function.

idata: memoryblock for input data, 8 bytes in size and not nil.
odata: memoryblock for output data, 8 bytes in size and not nil.
offset: offset in input and output memoryblocks

See also:

BlowfishMBS.DecryptOFB64(data as string, byref temp as memoryblock) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 6.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The continuing Blowfish decryption function.

data: data to be decrypted
temp: memoryblock for temporary data. Is created when called with nil value. Pass on following calls to allow data to be shared between function calls.

Returns "" on invalid input.
You can create yourself a twelve byte memoryblock with a starting value you want. First four bytes are position and next 8 bytes the current vector.

This is output feedback mode. Encryption is the same a decryption.

See also:

Some examples using this method:

BlowfishMBS.DecryptOFB64(idata as memoryblock, odata as memoryblock, offset as Integer, length as Integer, ivec as memoryblock, byref num as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 6.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The continuing Blowfish decryption function.
Example
dim b as BlowfishMBS

b=new BlowfishMBS
b.SetKey "Key"

dim temp as MemoryBlock
dim s as string

s=b.EncryptCFB64("Hello World",temp)

MsgBox s

temp=nil // reset
s=b.DecryptCFB64(s,temp)

MsgBox s

idata: memoryblock for input data, 8 bytes in size and not nil.
odata: memoryblock for output data, 8 bytes in size and not nil.
offset: offset in input and output memoryblocks
length: length of data in memoryblock in bytes. Multiply of 8.
ivec: memoryblock for temporary data, 8 bytes in size and not nil.
num: current position in ivec. Pass 0 as start value and pass the value you get back to the next function call.

Returns "" on invalid input.
You can create yourself a twelve byte memoryblock with a starting value you want. First four bytes are position and next 8 bytes the current vector.

This is output feedback mode. Encryption is the same a decryption.

See also:

BlowfishMBS.Encrypt(iodata as memoryblock)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 6.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Lowest level function to encrypt data in a memoryblock.

input and output are in host endian format.
memoryblock must be not nil and has a size of 8 bytes.

See also:

BlowfishMBS.EncryptCBC(data as string, byref temp as memoryblock) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 6.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The continuing Blowfish encryption function.
Example
dim m as memoryblock // temporary storage of current state
dim b as blowfishmbs
dim s as string

b=new blowfishmbs
b.SetKey "EinKey1234567890" // some key

s=b.EncryptCBC("Hallo",m)
s=s+b.EncryptCBC(" ",m)
s=s+b.EncryptCBC("Leute",m)
s=s+b.EncryptCBC("!",m)

data: data to be encrypted
temp: memoryblock for temporary data. Is created when called with nil value. Pass on following calls to allow data to be shared between function calls.

Returns "" on invalid input.
You can create yourself an eight byte memoryblock with a starting value you want.
Be aware that this CBC method works with data in 8 byte blocks, so you need to pad data if needed.

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:

BlowfishMBS.EncryptCBC(idata as memoryblock, odata as memoryblock, offset as Integer, length as Integer, ivec as memoryblock)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 6.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The continuing Blowfish encryption function.

idata: memoryblock for input data, at least 8 bytes in size and not nil.
odata: memoryblock for output data, at least 8 bytes in size and not nil.
offset: offset in input and output memoryblocks
length: length of data in memoryblock in bytes. Multiply of 8.
ivec: memoryblock for temporary data, 8 bytes in size and not nil.

ivec should be a memoryblock of 8 bytes size which you create before calling the function for the first time. On the next time you passed the same block, so the function can store data inside this memoryblock between function calls.
Be aware that this CBC method works with data in 8 byte blocks, so you need to pad data if needed.

See also:

BlowfishMBS.EncryptCFB64(data as string, byref temp as memoryblock) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 6.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The continuing Blowfish encryption function.

data: data to be encrypted
temp: memoryblock for temporary data. Is created when called with nil value. Pass on following calls to allow data to be shared between function calls.

Returns "" on invalid input.
You can create yourself a twelve byte memoryblock with a starting value you want. First four bytes are position and next 8 bytes the current vector.

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:

BlowfishMBS.EncryptCFB64(idata as memoryblock, odata as memoryblock, offset as Integer, length as Integer, ivec as memoryblock, byref num as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 6.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The continuing Blowfish encryption function.

idata: memoryblock for input data, 8 bytes in size and not nil.
odata: memoryblock for output data, 8 bytes in size and not nil.
offset: offset in input and output memoryblocks
length: length of data in memoryblock in bytes. Multiply of 8.
ivec: memoryblock for temporary data, 8 bytes in size and not nil.
num: current position in ivec. Pass 0 as start value and pass the value you get back to the next function call.

Returns "" on invalid input.
You can create yourself a twelve byte memoryblock with a starting value you want. First four bytes are position and next 8 bytes the current vector.

See also:

BlowfishMBS.EncryptECB(data as string) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 6.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The basic Blowfish encryption function.

This function encrypts only 8 bytes. For more, please use other functions!

data: data to be encrypted
Returns "" on invalid input.

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:

BlowfishMBS.EncryptECB(idata as memoryblock, odata as memoryblock, offset as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 6.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The basic Blowfish decryption function.

This function encrypts only 8 bytes. For more, please use other functions!

idata: memoryblock for input data, 8 bytes in size and not nil.
odata: memoryblock for output data, 8 bytes in size and not nil.
offset: offset in input and output memoryblocks
length: length of data in memoryblock in bytes. Multiply of 8.

See also:

BlowfishMBS.EncryptOFB64(data as string, byref temp as memoryblock) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 6.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The continuing Blowfish encryption function.

data: data to be encrypted
temp: memoryblock for temporary data. Is created when called with nil value. Pass on following calls to allow data to be shared between function calls.

Returns "" on invalid input.
You can create yourself a twelve byte memoryblock with a starting value you want. First four bytes are position and next 8 bytes the current vector.

This is output feedback mode. Encryption is the same a decryption.

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:

BlowfishMBS.EncryptOFB64(idata as memoryblock, odata as memoryblock, offset as Integer, length as Integer, ivec as memoryblock, byref num as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 6.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The continuing Blowfish encryption function.

idata: memoryblock for input data, 8 bytes in size and not nil.
odata: memoryblock for output data, 8 bytes in size and not nil.
offset: offset in input and output memoryblocks
length: length of data in memoryblock in bytes. Multiply of 8.
ivec: memoryblock for temporary data, 8 bytes in size and not nil.
num: current position in ivec. Pass 0 as start value and pass the value you get back to the next function call.

Returns "" on invalid input.
You can create yourself a twelve byte memoryblock with a starting value you want. First four bytes are position and next 8 bytes the current vector.

This is output feedback mode. Encryption is the same a decryption.

See also:

BlowfishMBS.SetKey(key as string)

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

The longer the key, the better. Suggested is at least 16 bytes.

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


The biggest plugin in space...