CCCryptorMBS constants

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

Back to CCCryptorMBS class.

Option Constants

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

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


💬 Ask a question or report a problem