Platforms to show: All Mac Windows Linux Cross-Platform

Back to CCCryptorMBS class.

Previous items

CCCryptorMBS.kCCKeySizeMaxRC4 = 512

Type Topic Plugin Version
const Encryption and Hash MBS MacOSX Plugin 11.3
One of the key size constants.

RC4 maximum key size.
CAST and RC4 have variable key sizes.

CCCryptorMBS.kCCKeySizeMinBlowfish = 8

Type Topic Plugin Version
const Encryption and Hash MBS MacOSX Plugin 21.4
One of the key size constants.

Minimum key size for blowfish.

CCCryptorMBS.kCCKeySizeMinCAST = 5

Type Topic Plugin Version
const Encryption and Hash MBS MacOSX Plugin 11.3
One of the key size constants.

CAST minimum key size.
CAST and RC4 have variable key sizes.

CCCryptorMBS.kCCKeySizeMinRC2 = 1

Type Topic Plugin Version
const Encryption and Hash MBS MacOSX Plugin 11.3
One of the key size constants.

RC2 minimum key size.
CAST and RC4 have variable key sizes.

CCCryptorMBS.kCCKeySizeMinRC4 = 1

Type Topic Plugin Version
const Encryption and Hash MBS MacOSX Plugin 11.3
One of the key size constants.

RC4 minimum key size.
CAST and RC4 have variable key sizes.

CCCryptorMBS.kCCMemoryFailure = -4302

Type Topic Plugin Version
const Encryption and Hash MBS MacOSX Plugin 11.3
One of the error constants.

Memory allocation failure.

CCCryptorMBS.kCCOptionCBCMode = 0

Type Topic Plugin Version
const Encryption and Hash MBS MacOSX Plugin 20.1
One of the option constants.

Cipher Block Chaining Mode. Default is CBC.

CCCryptorMBS.kCCOptionECBMode = 2

Type Topic Plugin Version
const Encryption and Hash MBS MacOSX Plugin 11.3
One of the option constants.

Electronic Code Book Mode. Default is CBC.
Stream ciphers currently have no options

CCCryptorMBS.kCCOptionPKCS7Padding = 1

Type Topic Plugin Version
const Encryption and Hash MBS MacOSX Plugin 11.3
One of the option constants.
Example
// initialize
dim h as new CCCryptorMBS(CCCryptorMBS.kCCEncrypt, CCCryptorMBS.kCCAlgorithmAES128, CCCryptorMBS.kCCOptionPKCS7Padding, "Hello12312345678")

if h.Lasterror<>0 then break

// destination memoryblock

dim m as new MemoryBlock(100)
dim Position as Uint64 = 0
dim BytesLeft as UInt64 = m.Size

// add a few bytes
dim q as UInt64 = 0

// due to padding, we don't need to pass a multiple of block size
h.Update "Hello World!", m, BytesLeft, q
if h.Lasterror<>0 then break

Position = Position + q
BytesLeft = BytesLeft - q

// now finalize:
q = 0

dim dp as ptr = m.AddressPtrMBS(Position)

h.Final dp, BytesLeft, q
if h.Lasterror<>0 then break

Position = Position + q
BytesLeft = BytesLeft - q

// and show result
dim d as string = m.StringValue(0, Position)
MsgBox EncodingToHexMBS(d)

Perform PKCS7 padding.
Stream ciphers currently have no options

CCCryptorMBS.kCCOverflow = -4306

Type Topic Plugin Version
const Encryption and Hash MBS MacOSX Plugin 21.4
One of the error constants.

Buffer overflow.

CCCryptorMBS.kCCParamError = -4300

Type Topic Plugin Version
const Encryption and Hash MBS MacOSX Plugin 11.3
One of the error constants.

Illegal parameter value.

CCCryptorMBS.kCCRNGFailure = -4307

Type Topic Plugin Version
const Encryption and Hash MBS MacOSX Plugin 21.4
One of the error constants.

Random number generator failed.

CCCryptorMBS.kCCSuccess = 0

Type Topic Plugin Version
const Encryption and Hash MBS MacOSX Plugin 11.3
One of the error constants.

Operation completed normally.

CCCryptorMBS.kCCUnimplemented = -4305

Type Topic Plugin Version
const Encryption and Hash MBS MacOSX Plugin 11.3
One of the error constants.

Function not implemented for the current algorithm.

CCCryptorMBS.kCCUnspecifiedError = -4308

Type Topic Plugin Version
const Encryption and Hash MBS MacOSX Plugin 21.4
One of the error constants.

An error occurred, but not matching one of the other error codes.

Previous items

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


💬 Ask a question or report a problem
The biggest plugin in space...