Skip to content

Instantly share code, notes, and snippets.

View julepka's full-sized avatar

julepka

View GitHub Profile
@julepka
julepka / SE-Example.swift
Last active March 19, 2021 15:47
Secure Enclave example without requesting passcode
// Generating private key in Secure Enclave
let access = SecAccessControlCreateWithFlags(kCFAllocatorDefault,
kSecAttrAccessibleWhenUnlockedThisDeviceOnly,
.privateKeyUsage,
nil)!
let attributes: [String: Any] = [kSecAttrKeyType as String: kSecAttrKeyTypeEC,
kSecAttrKeySizeInBits as String: 256,
kSecAttrTokenID as String: kSecAttrTokenIDSecureEnclave,
kSecPrivateKeyAttrs as String: [ kSecAttrIsPermanent as String: true,
kSecAttrAccessControl as String: access,
@julepka
julepka / cycript_detection.m
Created September 7, 2019 08:27
Cycript Detection
// https://stackoverflow.com/questions/34131835/detect-if-cycript-substrate-or-gdb-is-attached-to-an-ios-apps-process
BOOL hasCynject() {
int max = _dyld_image_count();
for (int i = 0; i < max; i++) {
const char *name = _dyld_get_image_name(i);
if (name != NULL) {
if (strstr(name, "cynject") == 0) return YES;
}
}