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
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Encryption and Hash | MBS MacOSX Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
This interface provides access to a number of symmetric encryption algorithms. Symmetric encryption algorithms come in two "flavors" - block ciphers, and stream ciphers. Block ciphers process data (while both encrypting and decrypting) in discrete chunks of data called blocks; stream ciphers operate on arbitrary sized data.
The object declared in this interface, CCCryptorMBS, provides access to both block ciphers and stream ciphers with the same API; however some options are available for block ciphers that do not apply to stream ciphers.
The general operation of a CCCryptor is: initialize it with raw key data and other optional fields with Constructor(); process input data via one or more calls to Update(), each of which may result in output data being written to caller-supplied memory; and obtain possible remaining output data with Final(). The CCCryptor is disposed of via Destructor(), or it can be reused (with the same key data as provided to Constructor()) by calling Reset().
One option for block ciphers is padding, as defined in PKCS7; when padding is enabled, the total amount of data encrypted does not have to be an even multiple of the block size, and the actual length of plaintext is calculated during decryption.
Another option for block ciphers is Cipher Block Chaining, known as CBC mode. When using CBC mode, an Initialization Vector (IV) is provided along with the key when starting an encrypt or decrypt operation. If CBC mode is selected and no IV is provided, an IV of all zeroes will be used.
CCCryptorMBS also implements block bufferring, so that individual calls to Update() do not have to provide data whose length is aligned to the block size. (If padding is disabled, encrypting with block ciphers does require that the *total* length of data input to Update() call(s) be aligned to the block size.)
A given CCCryptorMBS can only be used by one thread at a time; multiple threads can use safely different CCCryptors at the same time. |
Constant | Value | Description |
---|---|---|
kCCAlgorithm3DES | 2 |
Triple-DES, three key, EDE configuration |
kCCAlgorithmAES128 | 0 |
Advanced Encryption Standard, 128-bit block. Key length 128 to 256 bits. |
kCCAlgorithmBlowfish | 6 |
Blowfish encryption. |
kCCAlgorithmCAST | 3 |
CAST |
kCCAlgorithmDES | 1 |
Data Encryption Standard |
kCCAlgorithmRC2 | 5 |
RC2 stream cipher |
kCCAlgorithmRC4 | 4 |
RC4 stream cipher |
Constant | Value | Description |
---|---|---|
kCCAlignmentError | -4303 |
Input size was not aligned properly. |
kCCBufferTooSmall | -4301 |
Insufficent buffer provided for specified operation. |
kCCCallSequenceError | -4309 |
Functions called in wrong order. |
kCCDecodeError | -4304 |
Input data did not decode or decrypt properly. |
kCCInvalidKey | -4311 |
Key is not valid. |
kCCKeySizeError | -4310 |
The key size is incorrect. |
kCCMemoryFailure | -4302 |
Memory allocation failure. |
kCCOverflow | -4306 |
Buffer overflow. |
kCCParamError | -4300 |
Illegal parameter value. |
kCCRNGFailure | -4307 |
Random number generator failed. |
kCCSuccess | 0 |
Operation completed normally. |
kCCUnimplemented | -4305 |
Function not implemented for the current algorithm. |
kCCUnspecifiedError | -4308 |
An error occurred, but not matching one of the other error codes. |
Constant | Value | Description |
---|---|---|
kCCBlockSize3DES | 8 |
Triple DES block size. |
kCCBlockSizeAES128 | 16 |
AES block size (currently, only 128-bit blocks are supported). |
kCCBlockSizeBlowfish | 8 |
Blowfish block size. |
kCCBlockSizeCAST | 8 |
CAST block size. |
kCCBlockSizeDES | 8 |
DES block size. |
kCCBlockSizeRC2 | 8 |
RC2 block size. |
Constant | Value | Description |
---|---|---|
kCCDecrypt | 1 |
Symmetric decryption. |
kCCEncrypt | 0 |
Symmetric encryption. |
Constant | Value | Description |
---|---|---|
kCCKeySize3DES | 24 |
Triple DES key size. DES and TripleDES have fixed key sizes. |
kCCKeySizeAES128 | 16 |
128 bit AES key size. AES has three discrete key sizes. |
kCCKeySizeAES192 | 24 |
192 bit AES key size. AES has three discrete key sizes. |
kCCKeySizeAES256 | 32 |
256 bit AES key size. AES has three discrete key sizes. |
kCCKeySizeDES | 8 |
DES key size. DES and TripleDES have fixed key sizes. |
kCCKeySizeMaxBlowfish | 56 |
Maximum key size for blowfish. You may better do a hash on the key and use the hash. |
kCCKeySizeMaxCAST | 16 |
CAST maximum key size. CAST and RC4 have variable key sizes. |
kCCKeySizeMaxRC2 | 128 |
RC2 maximum key size. CAST and RC4 have variable key sizes. |
kCCKeySizeMaxRC4 | 512 |
RC4 maximum key size. CAST and RC4 have variable key sizes. |
kCCKeySizeMinBlowfish | 8 |
Minimum key size for blowfish. |
kCCKeySizeMinCAST | 5 |
CAST minimum key size. CAST and RC4 have variable key sizes. |
kCCKeySizeMinRC2 | 1 |
RC2 minimum key size. CAST and RC4 have variable key sizes. |
kCCKeySizeMinRC4 | 1 |
RC4 minimum key size. CAST and RC4 have variable key sizes. |
Constant | Value | Description |
---|---|---|
kCCOptionCBCMode | 0 |
Cipher Block Chaining Mode. Default is CBC. |
kCCOptionECBMode | 2 |
Electronic Code Book Mode. Default is CBC. Stream ciphers currently have no options |
kCCOptionPKCS7Padding | 1 |
Perform PKCS7 padding. Stream ciphers currently have no options Example |
This class has no sub classes.
The items on this page are in the following plugins: MBS MacOSX Plugin.