RandoloWiki

Too much of everything is just enough!

User Tools

Site Tools


misc:chrome_to_keepass

Jump to a different year? Take your pick!2000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024


Exporting Chrome Browser Passwords to Keepass 1.x

Introduction

What with retirement of the Palm OS as both a smart phone platform and a sync-able home planner/calendar/database it's taken awhile for me to work up snazzy, effective solutions. One of my primary aggravations was lack of a simple means of securely synchronizing useful information (login and password info mainly, but sometimes just notes) between my current smartphone and the various computers I use.

The current solution: KeePass

I'd been using the latest version (2.17) of KeePass on a work machine for awhile, and decided lately that it was time to stop waiting for a bug-free android app to appear, so this past weekend, I installed KeePass 1.21 on my various home machines, and KeePass Droid on my smartphone.

Although the KeePass Droid page mentions that it supports 2.x .kdbx databases, anecdotal reports of smartphone users experiencing data corruption and other issues has prompted me to stick with 1.x for now.

As noted on the KeePass Droid page, Dropbox makes an excellent solution for synchronizing the database between various clients, and using it was a no brainer for me, since I already had it installed. One worry yet to be addressed is how the clients will deal with a database being left open on one machine when another attempts access. Sure to be revealed!

Importing Firefox data into KeePass

Import from Firefox was darn simple … just followed the instructions at where

Importing Chrome data into KeePass

Import from Chrome was slightly more troublesome; here's the path I followed, modified somewhat from instructions posted at the Tech Correspondent Blog for performing a csv import. My motivation for deviating was the fact that it wasn't really too hard to import the data as XML instead, particularly since the format is specified by KeePass, and a sample XML file is easily available. Here's what I did:

  • Launched ChromePass from Nirsoft (a free utility)
    • Selected all of the entries
    • Then selected XML as the filetype when doing Save As…

(Note that ChromePass offers to save as a KeePass 1.x-compatible csv file, but that option was rejected with unspecified errors when I tried to actually import into KeePass)

  • Opened the XML output file in TED notepad (feel free to substitute your favorite editor instead), and performed the following edits:
    • updated the doctype declaration to match the first line of the KeePass sample
    • changed the file encoding to UTF-8 to match the preceding declaration
    • globally replaced the fieldname “chromepasswordslist” with “pwlist” (should only occur at top/bottom of the file)
    • globally replaced the fieldname “item” with “pwentry” (should occur at open/close of each record in the file)

Note that if “item” occurs in any other location, this substitution will cause you some grief! Somewhat safer would be to replace <item> and </item> instead…

  • added the field <group>Chrome</group> to every record immediately following <pwentry> – I chose this approach so as to easily indicate in my .kdbx that these entries originally came from Chrome. You are certainly free to place your records anywhere you like!
  • added an empty title field, <title></title> to every record immediately following <group>
  • added an empty notes field, <notes></notes> to every record immediately following <password>
  • globally replaced the fieldname “createdtime” with “creationtime” (every record) * removed extraneous fields: <actionurl>, <usernamefield>, <passwordfield>, <passwordstrength>
  • removed records duplicated by other entries in my .kdbx file - I did this by hand with visual comparison between windows, one for the CHrome XML and the other from KeePass. An automatic approach might work after exporting from KeePass to XML and then using WinMerge or another text comparison tool.
  • Populated <title> and <notes> fields in any records that seemed to call out to me for additional info.
  • Note that the KeePass sample.xml file offered additional fields that I omitted, for example: <uuid>, <image> and <expiretime>
  • Saved the edited XML with a new filename and exited my editor.
  • Opened that file in KeePass via File > Import From > Import KeePass 1.x XML File

Jump to a different year? Take your pick!2000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024

misc/chrome_to_keepass.txt · Last modified: 2020/06/14 23:54 by 127.0.0.1