Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Structured, uniform mpsites format. #164

Closed
lhunath opened this issue Mar 22, 2017 · 14 comments
Closed

Structured, uniform mpsites format. #164

lhunath opened this issue Mar 22, 2017 · 14 comments

Comments

@lhunath
Copy link
Member

lhunath commented Mar 22, 2017

Hi Maarten,

There are several implementations of your algorithm now (my self maintaining chrome and firefox addons). Are you interested in discussing a new format for the .mpsites file?

I think it's of high value that the different implementations can exchange configuration. At the same time, I'm looking for a way to save/backup application specific settings without using an extra or incompatible file.

In particular, as the browser plugin matches a size+counter+sitename entry with a url (regexp), I would like to be able to store that regexp. Further there are a couple of global + site specific settings like "auto-submit form (override)", auto insert username etc.

For bonus points, we could maintain a wiki with the definition of each field to avoid aliasing stuff.

json, yaml, xml whatever..

Cheers, Torbjørn

@dkunzler
Copy link
Contributor

@lhunath What do you think about the suggestion of @sscherfke that he made a few months ago?
https://gist.github.com/sscherfke/fe58bb5bcc3e5028b9199902bf895d7e
If I remember correctly he also sent you this.
@ttyridal Please also have a look at this.

But the biggest problems stays, namely the synchronization itself. A file format does not make a synchronization...

@lhunath
Copy link
Member Author

lhunath commented Jun 24, 2017

So, I think I'm going to implement something like this format. Feel free to provide any suggestions and feedback.

Note that export files are user-specific. They are not full app-data-dumps.

Dates are in UTC, RFC-3339 format, yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'.
There are three sections:

  • export: metadata on the export file and format.
  • user: data on the user for whom an export is made.
  • sites: data for each of the user's sites.

Each object has a few standardized properties, they are all described in the format below. Then it permits application-specific extensions. Extensions should always be keyed with the _ext_ prefix. The _ext_mpw key is reserved for the official Master Password apps.

The example below shows a few other potential extensions which are just random ideas and not specific to the format.

If .export.redacted is true, then the file MUST NOT contain any clear-text secrets. For sites with generated passwords, the .sites.password and the .sites.questions.answer keys MUST be null or missing. For sites with stored passwords, the password MUST be BASE64(AES128-CBC(master-key, site-password)).

{
    "export": {
        "format": 1,
        "date": "2017-06-24T18:45:17Z",
        "redacted": false,

        "_ext_signature_gpg": "iQEcBAEBCAAGBQJZTtteAAoJEDwVr2CJHly5bLEIALWCnxVn299i9ogp9uDEmmzO+6u8YAXcSpqUIWd/EnOL8hofiaSvYQh1Vxx7Xxrjhg6sWDzeHrUeQqRi23FX14P7bmBXfRjhqfEDSHH56mMQ9zqCFytxmtRN8VidCFIdHhnYGYssncR24m5VQiCyezMDVG1QrgSOfoZP5StAF3EdqqQnFBZlhPskAEE20WaqyLGuBT+yjADEWpPoZmnRLPvHAKx+BpDNSmXP/+NtCpCfUVD9hi4+F7qxNKq62lrmuN/IzRK8+JFd80q/QXXhNKot5J7h9trI50Yoh6p0xVef4pe/p2yf/nyyeL79qTCh3YvbMGSZqJt2YJPT0RNu9hk==fHAD",
        "_ext_sync_git": {
            "origin": "...",
            "commit": "...",
            "path": "..."
        }
    },

    "user": {
        "avatar": 4,
        "full_name": "Robert Lee Mitchell",
	"last_used": "2017-06-24T18:45:17Z",
        "key_id": "a636f54415916d6a0a3f5dd9c2b9cfe94388616df31509f0d40209846a6d112a",

        "algorithm": 3,
        "default_type": 17,

        "_ext_mpw": {
            "save_key": true,
            "touch_id": true
        }
    },

    "sites": {
        "twitter.com": {
	    "type": 17,
            "counter": 1,
            "algorithm": 3,
            "password": "VemfYuquPosi7,",

            "login_name": "rmitchell",
            "login_generated": false,

            "uses": 7,
            "last_used": "2017-06-24T18:45:17Z",

            "questions": {
                "": {
                    "answer": "veyy jap suxnuya ruh"
                },
                "mother": {
                    "answer": "lin wetwibuja mano"
                }
            },

            "_ext_mpw": {
                "url": "https://twitter.com"
            }
        }
    }
}

@adamczykm
Copy link

adamczykm commented Jun 25, 2017 via email

@lhunath
Copy link
Member Author

lhunath commented Jun 25, 2017

I'm unsure what you're suggesting. MP's point is indeed not to store passwords. The above does not invalidate that. Can you expand on your question?

@vitiral
Copy link

vitiral commented Jun 25, 2017

@lhunath MP's point is to store passwords... but NOT in plain text. Your solution seems to store them in plain text.

From my understanding (which is limited) the file should store:

  • validation of the master password using a site like __validate__ -- it will first use the master password you enter to find the password for __validate__ -- if it matches then it knows you didn't fat-finger the master password.
  • which sites are being used and what "version" to use

This way you can store the text file on a site like github (or anywhere) and it won't matter if someone finds it -- they will only know which sites you have passwords for -- not what the passwords are!

@lhunath
Copy link
Member Author

lhunath commented Jun 25, 2017

Please note that the above is an example of an export which is not redacted. It's the equivalent of today's export pressing the button "Show Passwords". The idea is that it should be easy for people to make a file that contains all of their passwords in a readable format. That way, the file can be used for a hard-storage, backup, that's independent of MP or to migrate away from MP should they so desire.

The STANDARD way of making an export is by doing so with the redacted format (equivalent to today's "Safe Export" button), in this format, as I already explained in my file format post above, the file does not contain any passwords and acts only as a document describing the metadata necessary to generate the user's site passwords.

MP doesn't store generated passwords, it never will. Export files are not storage. They are exports. The intent being to take things OUT of MP (ergo, export).

Per your "validate" site proposal, this function is already provided by the user's key_id property.

@adamczykm
Copy link

adamczykm commented Jun 25, 2017 via email

@lhunath
Copy link
Member Author

lhunath commented Jun 25, 2017

That is correct. And only if the user chooses to create a non-redacted export with the explicit intent of exposing them.

@adamczykm
Copy link

adamczykm commented Jun 25, 2017 via email

@lhunath
Copy link
Member Author

lhunath commented Jul 28, 2017

Done.

@ttyridal
Copy link

ttyridal commented May 2, 2018

In this scheme, what do we do when encountering an unknown ext field on import? Ignore it? store it for later export?

F.ex If the user is trying to keep multiple implementations in sync by exporting the latest version to some central repository.

@lhunath
Copy link
Member Author

lhunath commented May 4, 2018

@lhunath
Copy link
Member Author

lhunath commented May 4, 2018

@ttyridal extension data should always be preserved, regardless of whether your application knows how to handle it or not, to avoid data loss. Does that answer your question?

@ttyridal
Copy link

ttyridal commented May 4, 2018

indeed..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants