Yr in the past, I wrote a program to encrypt necessary information. This system created a random key and saved it in Keychain, and on subsequent runs it could retrieve it from the keychain. (There’s extra in regards to the API used, if you happen to’re curious, under.) I simply went again to run this program, after just a few years, and the password is gone from Keychain. I’ve misplaced all entry to those necessary information. I made an enormous mistake trusting Apple’s program and never saving it some other place, however I am questioning if there may be some method to discover this information.
First, under is a screenshot of ~/Library/Keychains
. Which of those information may include the information? What’s login_renamed_1.keychain-db
? I attempted opening it, and whereas it appears to open (it reveals up in left nav of Keychain Entry app) I do not assume I can search it correctly, as a result of I can not “unlock” it.
I’m wondering if it expects an outdated password for my pc, which I do not bear in mind. Possibly the keychain merchandise is hidden in there? Possibly there’s a method to brute power discover this password. I feel I bear in mind a part of the phrase.
I do not assume that is super-important, however if you happen to’re curious, the code from my program that saved and retrieved the keychain merchandise regarded like this:
// Storing it. Account was used to establish it
var question: [String: Any] = [kSecClass as String: kSecClassGenericPassword,
kSecAttrAccount as String: account,
kSecAttrLabel as String: label,
kSecUseDataProtectionKeychain as String: true,
kSecValueData as String: password]
let standing = SecItemAdd(question as CFDictionary, nil)
...
// Getting it again
let question: [String: Any] = [kSecClass as String: kSecClassGenericPassword,
kSecMatchLimit as String: kSecMatchLimitOne,
kSecAttrAccount as String: account,
kSecReturnAttributes as String: true,
kSecReturnData as String: true]
var merchandise: CFTypeRef?
let standing = SecItemCopyMatching(question as CFDictionary, &merchandise)