Import to 1Password from Enpass 6

xXHostmasterXx
xXHostmasterXx
Community Member

Hi all,

My topic today is to import credentials from Enpass 6.0.5 (new version released in early 2019) to 1Password 7.
As you maybe know Enpass can only export in JSON or txt format. Two formats no understood by 1Password for importing.

So, I found the great converter by Mrc (thank you a lot for your job). As long as I know, the last release of this converter (2019-02-22-1030) doesn't really take care of Enpass version 6.

Concretely, Export/conversion/import works, all stuff goes in 1Password (can I say 1P?) but all websites/URL fields are put in a note field. Idem for TOTP field.

So I wanted to modify the converter by myself to correct or add mapping. But I definitely do not understand how it works. If someone is in the same trouble as me. I would appreciate some help.

A last stupid question: Why the converter is not in a repository like GitHub or whatever. It would be greater than a dropbox folder. And in this way, we could be sure to always have the last release without check the dropbox link.

Thank you all for help.


1Password Version: 7.2.5
Extension Version: Not Provided
OS Version: OS X 10.14
Sync Type: Not Provided

Comments

  • Lars
    Lars
    1Password Alumni

    Welcome to the forum, @xXHostmasterXx! For someone new around here, you seem to have found your way to the good stuff. @MrC's converter suite is indeed pretty wonderful. He's one of our awesome forum moderators, and I'll let him answer at his convenience re: his own converter since I'm not actually certain what's up-to-date (since so many other formats which change frequently are included). If he's unable to assist you directly, let me know and I'd be happy to assist.

  • MrC
    MrC
    Volunteer Moderator

    @xXHostmasterXx ,

    The converter suite mac does have an enpass converter, and it has some support for version 6.

    The issue you may be facing, is that Enpass itself has been rather sloppy with its import and export, and/or you may have customized your stock categories and fields (which the converter uses to detect categories, and decide field mapping).

    First, make sure you followed the instructions in the README to export your Enpass 6 data in English.

    If you've already done that, let's work to see what needs to be customized. Do you want to work via forum post here, or email? If email, my address is at the top of the convert.pl script.

    Either way, I can show you how we can customize the converter for your Enpass 6 data.

    RE: Github. Most users just download the converter suite once, use it and toss it. Only a handfull re-download multiple times. Github offers very little value to this process, and for most users, is overwhelming and needlessly obtuse. It's also needless extra work for me, adding no value. Finally, I have a build process which does various things, and that build process is custom configured on my system, and requires certain tools. I'm not going to check those into Git, so nobody could fully build the suite anyway.

  • xXHostmasterXx
    xXHostmasterXx
    Community Member

    @Lars Thank you a lot for your feedback.
    @MrC I would prefer to continue here. It could help others in the future.

    Yes, I read and applied the README of course. For testing, I created a new vault in Enpass 6 with only 1 entry with fake data.

    Here is the JSON exported from Enpass 6 (only fake data of course):

    {
    "items": [
    {
    "auto_submit": 1,
    "category": "login",
    "favorite": 0,
    "fields": [
    {
    "label": "Username",
    "order": 1,
    "sensitive": 0,
    "type": "username",
    "uid": 10,
    "updated_at": 1551261188,
    "value": "florian",
    "value_updated_at": 1551261188
    },
    {
    "label": "E-mail",
    "order": 2,
    "sensitive": 0,
    "type": "email",
    "uid": 12,
    "updated_at": 1551261188,
    "value": "myemail@domain.tld",
    "value_updated_at": 1551261188
    },
    {
    "label": "Password",
    "order": 3,
    "sensitive": 1,
    "type": "password",
    "uid": 11,
    "updated_at": 1551261188,
    "value": "4paralyses-Tons-Bets",
    "value_updated_at": 1551261188
    },
    {
    "label": "Website",
    "order": 4,
    "sensitive": 0,
    "type": "url",
    "uid": 13,
    "updated_at": 1551261188,
    "value": "https://website.tld/",
    "value_updated_at": 1551261188
    },
    {
    "label": "ADDITIONAL DETAILS",
    "order": 5,
    "sensitive": 0,
    "type": "section",
    "uid": 101,
    "updated_at": 1551261188,
    "value": "",
    "value_updated_at": 1551261188
    },
    {
    "label": "Phone number",
    "order": 6,
    "sensitive": 0,
    "type": "phone",
    "uid": 14,
    "updated_at": 1551261188,
    "value": "",
    "value_updated_at": 1551261188
    },
    {
    "label": "TOTP",
    "order": 7,
    "sensitive": 0,
    "type": "totp",
    "uid": 102,
    "updated_at": 1551261188,
    "value": "564z6d54q65s1d684f3qs22d6z5d1q3s2d43qz",
    "value_updated_at": 1551261188
    },
    {
    "label": "Security question",
    "order": 8,
    "sensitive": 0,
    "type": "text",
    "uid": 15,
    "updated_at": 1551261188,
    "value": "",
    "value_updated_at": 1551261188
    },
    {
    "label": "Security answer",
    "order": 9,
    "sensitive": 1,
    "type": "text",
    "uid": 16,
    "updated_at": 1551261188,
    "value": "",
    "value_updated_at": 1551261188
    }
    ],
    "icon": {
    "fav": "TEST",
    "image": {
    "file": "misc/login"
    },
    "type": 1,
    "uuid": ""
    },
    "note": "",
    "subtitle": "florian",
    "template_type": "login.default",
    "title": "TEST",
    "updated_at": 1551261188,
    "uuid": "b61aac81-ec08-4161-b899-abd3d93437b3"
    }
    ]
    }

    And here is the file converted in 1PIF:

    {"openContents":{"tags":["Favorite"]},"typeName":"webforms.WebForm","updatedAt":1551261188,"secureContents":{"password":"4paralyses-Tons-Bets","fields":[{"designation":"username","name":"username","value":"florian","type":"T"},{"value":"4paralyses-Tons-Bets","type":"P","name":"password","designation":"password"}],"username":"florian","notesPlain":"E-mail: myemail@domain.tld\nWebsite: https://website.tld/\nTOTP: 564z6d54q65s1d684f3qs22d6z5d1q3s2d43qz\n\nEnpass Category: login"},"uuid":"4FFEB1640BCB4D3CA2214D68999836CB","title":"TEST"}
    5642bee8-a5ff-11dc-8314-0800200c9a66

    And now, original content compared to imported content in 1Password

    I think that the customisation it is pretty simple, maybe "just" a field taged as "Url" before is now called "website".
    Concerning TOTP, it would be great, but if I only have few to add again, it will be okay.

    thanks for your time.

  • xXHostmasterXx
    xXHostmasterXx
    Community Member

    @Lars Thank you a lot for your feedback.
    @MrC I would prefer to continue here. It could help others in the future.

    Yes, I read and applied the README of course. For testing, I created a new vault in Enpass 6 with only 1 entry with fake data.

    Here is the JSON exported from Enpass 6 (only fake data of course):

    {
    "items": [
    {
    "auto_submit": 1,
    "category": "login",
    "favorite": 0,
    "fields": [
    {
    "label": "Username",
    "order": 1,
    "sensitive": 0,
    "type": "username",
    "uid": 10,
    "updated_at": 1551261188,
    "value": "florian",
    "value_updated_at": 1551261188
    },
    {
    "label": "E-mail",
    "order": 2,
    "sensitive": 0,
    "type": "email",
    "uid": 12,
    "updated_at": 1551261188,
    "value": "myemail@domain.tld",
    "value_updated_at": 1551261188
    },
    {
    "label": "Password",
    "order": 3,
    "sensitive": 1,
    "type": "password",
    "uid": 11,
    "updated_at": 1551261188,
    "value": "4paralyses-Tons-Bets",
    "value_updated_at": 1551261188
    },
    {
    "label": "Website",
    "order": 4,
    "sensitive": 0,
    "type": "url",
    "uid": 13,
    "updated_at": 1551261188,
    "value": "https://website.tld/",
    "value_updated_at": 1551261188
    },
    {
    "label": "ADDITIONAL DETAILS",
    "order": 5,
    "sensitive": 0,
    "type": "section",
    "uid": 101,
    "updated_at": 1551261188,
    "value": "",
    "value_updated_at": 1551261188
    },
    {
    "label": "Phone number",
    "order": 6,
    "sensitive": 0,
    "type": "phone",
    "uid": 14,
    "updated_at": 1551261188,
    "value": "",
    "value_updated_at": 1551261188
    },
    {
    "label": "TOTP",
    "order": 7,
    "sensitive": 0,
    "type": "totp",
    "uid": 102,
    "updated_at": 1551261188,
    "value": "564z6d54q65s1d684f3qs22d6z5d1q3s2d43qz",
    "value_updated_at": 1551261188
    },
    {
    "label": "Security question",
    "order": 8,
    "sensitive": 0,
    "type": "text",
    "uid": 15,
    "updated_at": 1551261188,
    "value": "",
    "value_updated_at": 1551261188
    },
    {
    "label": "Security answer",
    "order": 9,
    "sensitive": 1,
    "type": "text",
    "uid": 16,
    "updated_at": 1551261188,
    "value": "",
    "value_updated_at": 1551261188
    }
    ],
    "icon": {
    "fav": "TEST",
    "image": {
    "file": "misc/login"
    },
    "type": 1,
    "uuid": ""
    },
    "note": "",
    "subtitle": "florian",
    "template_type": "login.default",
    "title": "TEST",
    "updated_at": 1551261188,
    "uuid": "b61aac81-ec08-4161-b899-abd3d93437b3"
    }
    ]
    }

    And here is the file converted in 1PIF:

    {"openContents":{"tags":["Favorite"]},"typeName":"webforms.WebForm","updatedAt":1551261188,"secureContents":{"password":"4paralyses-Tons-Bets","fields":[{"designation":"username","name":"username","value":"florian","type":"T"},{"value":"4paralyses-Tons-Bets","type":"P","name":"password","designation":"password"}],"username":"florian","notesPlain":"E-mail: myemail@domain.tld\nWebsite: https://website.tld/\nTOTP: 564z6d54q65s1d684f3qs22d6z5d1q3s2d43qz\n\nEnpass Category: login"},"uuid":"4FFEB1640BCB4D3CA2214D68999836CB","title":"TEST"}
    5642bee8-a5ff-11dc-8314-0800200c9a66

    And now, original content compared to imported content in 1Password


    It seems that the tag for url fields changed in version 6 of Enpass.
    And TOTP didn't exist in the 5th version of it.

    Thanks a lot for your time.

  • MrC
    MrC
    Volunteer Moderator
    edited February 2019

    @xXHostmasterXx ,

    The problem is that Enpass keeps changing their labels in version 6. I wrote the converter while version 6 was in beta.

    Take a look of this comparison between two version 6 login items:

    Maybe they've settled down now that it is out of beta.

    What do you want done with their TOTP field? (I'm not sure if it maps to 1Password's TOTP type or not, as I have not tested this).

    Here's all you have to do in the converter.

    Edit the file Converters/Enpass.pm with TextEdit or any plain-text editor.

    Change the line url key in the %card_field_specs table (line 347) from:

        login =>                    { textname => 'login.default', fields => [
            [ 'username',           3, qr/^Username$/, ],
            [ 'password',           3, qr/^Password$/, ],
            [ 'url',                3, qr/^URL$/, ],
            [ '_phone',             0, qr/^Phone$/, ],
            [ '_securityquestion',  3, qr/^Security [Qq]uestion$/, ],
        ]},
    

    to

        login =>                    { textname => 'login.default', fields => [
            [ 'username',           3, qr/^Username$/, ],
            [ 'password',           3, qr/^Password$/, ],
            [ 'url',                3, qr/^URL|Website$/, ],
            [ '_phone',             0, qr/^Phone$/, ],
            [ '_securityquestion',  3, qr/^Security [Qq]uestion$/, ],
        ]},
    

    With that change, you'll see your website field captured correctly:

    $ perl convert.pl enpass -vvdd en-fake.json
    main                : Runninng script from '/Users/MrC/Documents/Coding/mrc-converter-suite'
    main                : Command Line: enpass -vvdd en-fake.json
    main                : Output file: /Users/MrC/Desktop/1P_import.1pif
    print_fileinfo      : Input file info: "en-fake.json"
    print_fileinfo      :   size: 3427
    print_fileinfo      :   kind: ASCII text
    print_fileinfo      :   mime: text/plain; charset=us-ascii
    process_json        : Category login
    find_card_type      :       type 'login.default' matched 'login'
    normalize_card_data : field: Username
    normalize_card_data : field: E-mail
    normalize_card_data :   pushed to notes: E-mail: myemail@domain.tld
    normalize_card_data : field: Password
    normalize_card_data : field: Website
    normalize_card_data : field: TOTP
    normalize_card_data :   pushed to notes: TOTP: 564z6d54q65s1d684f3qs22d6z5d1q3s2d43qz
    print_record        : title: TEST
                          tags:  Favorite
                          key(url): Website = https://website.tld/
                          key(password): Password = 4paralyses-Tons-Bets
                          key(username): Username = florian
                          notes: E-mail: myemail@domain.tld<CR>TOTP: 564z6d54q65s1d684f3qs22d6z5d1q3s2d43qz<CR><CR>Enpass Category: login
    Imported 1 item
    create_pif_record   : Title: TEST
    create_pif_record   :   key test(username): florian
    create_pif_record   :   key test(password): 4paralyses-Tons-Bets
    create_pif_record   :   key test(url): https://website.tld/
    create_pif_record   :   notes: E-mail: myemail@domain.tld<CR>TOTP: 564z6d54q65s1d684f3qs22d6z5d1q3s2d43qz<CR><CR>Enpass Category: login
    create_pif_record   :   tags: Favorite
    Exported 1 login item
    Exported 1 total item
    You may now import the file /Users/MrC/Desktop/1P_import.1pif into 1Password
    
  • xXHostmasterXx
    xXHostmasterXx
    Community Member
    edited February 2019

    Oooh So great and not so complicated. Thanks a lot!!

    By the way, I did the same kind of modification about "Username" and "E-Mail" field.
    Previously, Enpass detected Username/email as a email field. And this is put in notes in 1Password.

    So: line 345: [ 'username', 3, qr/^Username|E-mail$/, ],
    will do the job.

    About, TOTP, it seems to be called "TOTP" in Enpass but called "otpcode" in 1Password.

    I'll try it.

  • MrC
    MrC
    Volunteer Moderator

    @xXHostmasterXx ,

    Be careful about the Username / E-mail field. These are two distinct fields in an Enpass 6 export. From your export data:

    {
    "label": "Username",
    "order": 1,
    "sensitive": 0,
    "type": "username",
    "uid": 10,
    "updated_at": 1551261188,
    "value": "florian",
    "value_updated_at": 1551261188
    },
    {
    "label": "E-mail",
    "order": 2,
    "sensitive": 0,
    "type": "email",
    "uid": 12,
    "updated_at": 1551261188,
    "value": "myemail@domain.tld",
    "value_updated_at": 1551261188
    },
    

    The way you are coding the entry means you will lose on of the values. Lines in the %card_field_specs table must match uniquely.

    As for the TOTP, I wasn't concerned about the 1Password's 1PIF internal key name for the one time passcode (I know its 1PIF key name). Rather, I was concerned about the interoperability. I haven't tested if taking the raw value from Enpass (or any other password manager's export) will work if placed into a 1Password otpcode field. Just assigning the key name is not sufficient - there is code in my PIF generator module that adds special flags for certain 1PIF field types.

  • MrC
    MrC
    Volunteer Moderator
    edited February 2019

    @xXHostmasterXx ,

    I recall now - the TOTP is an entirely non-validated field in Enpass. You can add garbage as a value.

                {
                    "label": "TOTP",
                    "order": 7,
                    "sensitive": 0,
                    "type": "totp",
                    "uid": 102,
                    "updated_at": 1551371291,
                    "value": "asdfsdf",
                    "value_updated_at": 1551371291
                },
    

    The converter won't bother trying to make sense of invalid or nonsense field values from a password manager's export.

  • jspindler
    jspindler
    Community Member

    @MrC,
    I just used 'mrc-converter-suite' to export data from Enpass to 1PW. Worked perfectly. Thanks!

  • So glad MrC was able to help out here. Thanks for letting us know it worked out. Great work, as always, @MrC. :)

    Ben

This discussion has been closed.