|
JubeatPlus 3.9.11
|
Four CommonCrypto wrappers. More...
#include <Crypto.h>


Class Methods | |
| (nonnull NSData *) | + createHash: |
| SHA-1 of a data buffer, returned as the raw twenty-byte digest. | |
| (nonnull NSString *) | + sha1: |
| SHA-1 of a string, returned as forty lower-case hexadecimal characters. | |
| (nonnull NSString *) | + sha256: |
| SHA-256 of a string, returned as sixty-four lower-case hexadecimal characters. | |
| (nullable NSData *) | + cryptorToData:value:key: |
| AES-128 encrypt or decrypt with PKCS#7 padding and no initialisation vector. | |
Four CommonCrypto wrappers.
| + (nonnull NSData *) createHash: | (nullable NSData *) | data |
SHA-1 of a data buffer, returned as the raw twenty-byte digest.
The only one of the three digest methods that takes data rather than a string, and the only one whose length handling is correct.
| data | The bytes to hash. |
| + (nullable NSData *) cryptorToData: | (unsigned int) | cryptor | |
| value: | (nullable NSData *) | value | |
| key: | (nullable NSData *) | key |
AES-128 encrypt or decrypt with PKCS#7 padding and no initialisation vector.
The key length is fixed at sixteen bytes whatever key actually holds, so a shorter key reads past its own buffer and a longer one is silently truncated. Running with no IV means ECB mode, so identical plaintext blocks produce identical ciphertext.
| cryptor | kCCEncrypt or kCCDecrypt. |
| value | The bytes to transform. |
| key | The key. Must be at least sixteen bytes. |
| + (nonnull NSString *) sha1: | (nullable NSString *) | string |
SHA-1 of a string, returned as forty lower-case hexadecimal characters.
Mis-measures non-ASCII input. It takes the string's UTF-8 C string but its character count from -length, so any string containing a character outside ASCII is hashed over the wrong number of bytes. See TYPES_PENDING.md.
| string | The text to hash. |
| + (nonnull NSString *) sha256: | (nullable NSString *) | string |
SHA-256 of a string, returned as sixty-four lower-case hexadecimal characters.
Carries the same length mismatch as +sha1: .
| string | The text to hash. |