Skip navigation
This discussion is archived

keychain dump

5362 Views 11 Replies Latest reply: Mar 5, 2008 5:02 PM by baltwo RSS
user1724 Level 3 Level 3 (530 points)
Currently Being Moderated
Feb 16, 2008 2:00 PM
keychain is nice, but you need to be able to dump its contents. i see no way to export the contents to a readable file. i know i can backup the keychain, but that is not the same thing. you still need the keychain app to access the information. i don't want to invest the time to put in 100's of items if i cannot get them out.
  • iPhone Genius Calculating status...
    Currently Being Moderated
    Feb 16, 2008 6:07 PM (in response to user1724)
    Delete the keychain preferences in Macintosh HD>System>Library. Best of luck.
  • Tony T1 Level 6 Level 6 (8,125 points)
    Currently Being Moderated
    Feb 17, 2008 9:00 AM (in response to user1724)
    Are you trying to dump the keychain contents to a text file so that the passwords are readable?
    MacBook /, Mac OS X (10.5.2), / Windows xp (Boot Camp)
  • amulz Calculating status...
    Currently Being Moderated
    Feb 17, 2008 3:40 PM (in response to Tony T1)
    Tony T1 wrote:
    Are you trying to dump the keychain contents to a text file so that the passwords are readable?


    Close, he wants a safe file format for the keychain contents so that he can keep it as a secure easily recoverable file. Security is nothing without the ability to recover information.

    Sorry, I have no idea what will do what you want.
    20" iMac, Mac OS X (10.5.2)
  • Chris Noble Calculating status...
    Currently Being Moderated
    Feb 17, 2008 4:06 PM (in response to iPhone Genius)
    I think you may have misinterpreted the meaning of the word 'dump'. The poster wants to make a copy, not delete the data


    2GHz Core 2 Duo iMac, Mac OS X (10.5.2)
  • baltwo Level 9 Level 9 (59,150 points)
    Currently Being Moderated
    Feb 17, 2008 7:22 PM (in response to user1724)
    I have a simple AppleScript which generates a tab-delimited text file, named Passwords saved to the Desktop containing the name, account username, and password for each key in my login.keychain. The file is a backup for all generic and webpage keys. Note that it *hasn't been tested in Leopard*, but should do the job.

    Cut and paste it into Script Editor, compile it, and run it. Select the right-hand option in the dialog boxes that pop up; either allow always or allow once, whichever is not grayed out.

    Paste the file's contents into Excel, sort it by name, clean it up a bit, print it out, and you have a permanent record of each password item (key), sorted by name, username, and password. Store it in a secure location.

    <script>
    set osXKeychainScriptingPath to ¬
    (path to scripting additions from system domain as Unicode text) ¬
    & "Keychain Scripting.app:" -- one line
    set theSecuridPIN to {}

    tell application "Keychain Scripting" to launch
    tell application "Keychain Access" to launch

    using terms from application "Keychain Scripting"
    tell application osXKeychainScriptingPath
    set KeyList to every Internet key of current keychain
    repeat with aKey in KeyList
    set theSecuridPIN to theSecuridPIN & ((name of aKey) & tab & ¬
    (account of aKey) & tab & (password of aKey) & return) as text
    end repeat
    end tell
    end using terms from

    tell application "Keychain Scripting" to quit
    tell application "Keychain Access" to quit

    tell application "Finder"
    open for access file (((path to desktop folder) as text) & ¬
    "Passwords") with write permission
    set theFile to result
    write theSecuridPIN to theFile
    close access theFile
    end tell
    <end script>

    Tested in Tiger and Leopard.
    G4 450 MP Gigabit 1.5 GB RAM/17" Flat-panel 1GHz iMac, Mac OS X (10.5.2), (also 10.4.11/9.2.2)
  • baltwo Level 9 Level 9 (59,150 points)
    Currently Being Moderated
    Feb 18, 2008 12:06 PM (in response to user1724)
    I thought I corrected my post, but apparently missed this erroneous comment: *Note that it hasn't been tested in Leopard, but should do the job.*

    I and others have tested it and *it works in both Tiger and Leopard.*
    G4 450 MP Gigabit 1.5 GB RAM/17" Flat-panel 1GHz iMac, Mac OS X (10.5.2), (also 10.4.11/9.2.2)
  • btd1924 Calculating status...
    Currently Being Moderated
    Mar 5, 2008 4:07 PM (in response to baltwo)
    This works great. CAn you tell me what I need to modify to make it work the same on secure notes?

    Thanks

    btd1924
    Mac Pro, Mac OS X (10.4.11), Dual-Core Intel Xeon 4gb
  • baltwo Level 9 Level 9 (59,150 points)
    Currently Being Moderated
    Mar 5, 2008 5:02 PM (in response to btd1924)
    Thanks for the kudos. I have no idea about secure notes since I don't use them. Launch Script Editor, Window->Library and add Keychain Scripting to the list—it's in /System/Library/ScriptingAdditions/, double-click on it, and read its dictionary.
    G4 450 MP Gigabit 1.5 GB RAM/17" Flat-panel 1GHz iMac, Mac OS X (10.5.2), (also 10.4.11/9.2.2)

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.