Managing Signing Keys

Overview

MIDAS digitally signs the MDS files you export with a passkey registered in this browser. A passkey is a public-key cryptography key used in place of a password, and its private key is kept in a password manager, including those built into the OS or the browser, or on a security key. Using the digital signature, the recipient's MIDAS confirms which key last signed the file and detects changes made after signing.

MIDAS classifies the signers of MDS files into the following three trust levels.

Trust LevelDescription
OfficialSigned by the MIDAS Provider's key
TrustedSigned by your own key registered in this browser, or a registered public key
UnknownSigned by an unregistered signer

A file signed with your own key appears as Trusted only in a browser where that key is registered or its public key is registered in Trusted Keys. If the recipients have not registered your public key in their browsers, their MIDAS shows Unknown.

By default, the trust level does not affect whether a file can be opened. MIDAS opens files with unknown signatures without a confirmation dialog. See Opening MDS from Unknown Signers for details.

What MIDAS stores in the browser's IndexedDB is the public key, the fingerprint, the identifier that designates the passkey, the signer name, and the registration time of each registered key, and the setting of the default key. The private key of a passkey is in your password manager or on your security key, and the MIDAS page cannot export it. Clearing the browser's site data also removes the key registrations, but the passkeys remain in your password manager or on your security key, so you can register them again with the steps in Use an Existing Passkey.

Signing keys are managed in the Signing Keys tab of the Settings dialog. Select Help > Settings... from the menu bar, then click the Signing Keys tab.

Signing Keys tab

How Digital Signatures Work

The digital signature on an MDS file is based on public-key cryptography. The signer signs the file with their private key, and the recipient's MIDAS verifies the signature with the signer's public key. If the file content changes after signing, verification fails, so MIDAS can detect tampering and corruption.

What a digital signature confirms is which key signed the file. A valid signature guarantees neither that you can trust the signer nor that the file content is safe.

Share only the public key file produced by Export Public Key. The recipient's MIDAS verifies signatures with the public key alone, so there is no need to share the private key.

A signature does not encrypt the file content. Anyone who obtains an MDS file can read its content, signed or not. If the file requires confidentiality, protect it with OS disk encryption or another encryption method.

The signer name included in a signature is self-declared. To confirm that a key belongs to the stated person, compare fingerprints instead of relying on the name.

Whether a signer is Trusted or Unknown depends only on the registrations in the recipient's browser and does not change with anything the signer does. If a signer removes a key from the browser or creates a new passkey, the recipient's registrations and the verification results of existing MDS files are unaffected. To have recipients treat signatures by a new key as Trusted, distribute its public key again.

Fingerprint Verification

A fingerprint is a 32-digit hexadecimal number calculated from the public key and identifies it1. By comparing fingerprints, you can confirm that the public key you are about to register really belongs to the other person.

The steps to compare fingerprints are:

  1. The sender opens Help > Settings..., checks the fingerprint in the My Signing Keys section of the Signing Keys tab, and posts it somewhere separate from the public key file, such as their own website or email signature
  2. The recipient compares the fingerprint shown in the Register Trusted Key dialog with the posted fingerprint

When Signature Verification Fails

MIDAS does not open MDS files whose signature verification fails. Besides files changed after signing, files corrupted in transit, such as in an email attachment or cloud storage, also fail verification. Ask the sender to resend the file.

An Unknown signer is different from a verification failure. A file whose signer is Unknown has passed signature verification, so MIDAS can open it.

Managing Your Signing Keys

Your signing keys are passkeys registered in this browser. There are two ways to register a key: create a new passkey, or start using an existing passkey created elsewhere, such as on another device. You can register more than one key in a browser and choose which key signs each export.

Create a Passkey

When you export an MDS file while this browser has no key, MIDAS shows the Create Passkey and Use Existing Passkey buttons in the export dialog. The buttons with the same names in the Signing Keys tab register a key in the same way. The steps to create a passkey are:

  1. Click the Create Passkey button
  2. Enter a signer name
  3. Click the Create Passkey button of the form
  4. In the screen the browser shows, choose where to save the passkey and verify yourself with a PIN, biometrics, or similar

The signer name is included in the signature. The recipient's MIDAS shows this name if the signer's public key is not registered, and shows the name the recipient gave when registering it if it is.

A passkey is saved in a password manager, including those built into the OS or the browser, or on a security key. A passkey saved in a password manager that syncs passkeys across devices, such as iCloud Keychain or Google Password Manager, can be used in browsers on your other devices that use the same account. A passkey saved on a security key can be used in any browser the key is connected to. In either case, register the passkey in each other browser with the steps in Use an Existing Passkey before using it there.

MIDAS creates passkeys of the kind that users can choose from a list without the site specifying them (discoverable credentials). Security keys that support only U2F (Universal 2nd Factor) cannot store this kind of passkey.

In browsers that do not support passkeys, MIDAS cannot register a key and cannot export MDS files.

Use an Existing Passkey

A passkey created on another device and synced, or a passkey saved on a security key, is registered in this browser with Use Existing Passkey. The steps are:

  1. Click the Use Existing Passkey button
  2. Click the Choose Passkey button, then choose the passkey and verify yourself in the screen the browser shows
  3. Enter a signer name
  4. Click the Confirm Again button and verify yourself once more with the same passkey

If the passkey you choose in step 2 is already registered in this browser, MIDAS does not ask for the second verification and shows the signer name and fingerprint of the registered key.

Choose the Signing Key

When you have two or more keys, choose the key to sign with in Sign with in the export dialog. The initial choice is the default key. The first key you register becomes the default key, and you can change it with the Set as Default button in the Signing Keys tab. When you remove the default key, the remaining key registered earliest becomes the default key. When there are two or more keys, the Signing Keys tab marks the default key with Default. exportMds() of the Agent API signs with the default key unless a key is specified.

You choose the key in the export dialog, not in the browser's verification screen.

Confirming Each Export

For each export, MIDAS asks the browser to sign with the passkey of the chosen key. The browser asks you to verify yourself with a PIN, biometrics, or similar. MIDAS rejects signatures made without this verification when it opens a file. MIDAS asks for the signature after it has written the Parquet files of the row data, so for a large project it takes a while between clicking Save and the verification screen appearing.

In the following four cases about the verification, the browser returns the same error and the export fails: you close the verification screen, the verification times out, another window has focus when MIDAS asks for the verification, or you have deleted the passkey from your password manager or security key. For a large project, keep the MIDAS window in front while it writes the Parquet files. If you deleted the passkey, remove the key from this browser in the Signing Keys tab.

Export Your Public Key

To share your public key with other users, click the Export Public Key button of the key. MIDAS writes the public key to a JSON file, and the browser downloads the file.

When the people you share MDS files with register this public key file, their MIDAS treats files signed with this key as Trusted. If you use more than one key, give them the public key of each key.

The public key file itself is not secret, so you can hand it over by email attachment or an internal file server. So that recipients can confirm the key is yours, post your fingerprint on your own website or in your email signature.

Change Signer Name

Click the Edit button next to the name in the My Signing Keys section to change the signer name of that key. The new name goes into signatures from subsequent exports. The signer name in MDS files you have already exported does not change. When this browser shows signatures by the key, MIDAS uses the new name. The name of the passkey in your password manager stays the signer name used when the passkey was created.

Remove a Key from This Browser

Click the Remove button of a key to remove the key from this browser. The passkey in your password manager or on your security key is not deleted. MIDAS has no way to learn that you deleted a passkey in your password manager, so remove the key of a deleted passkey with this operation.

When you remove a key, the confirmation dialog asks whether to keep trusting the files signed with the key, with the following two choices.

  • Keep trusting them: MIDAS registers the public key of the key in Trusted Keys under the signer name and keeps treating files signed with the key as Trusted. If Trusted Keys already has the same key, MIDAS leaves that registration as it is. Choose this when you have only stopped using the key.
  • Stop trusting them: MIDAS registers nothing and treats files signed with the key as Unknown. If Trusted Keys has the same key, MIDAS removes it too. Choose this when someone else may have used the passkey, for example after a lost device or a compromised account.

Migrating from the Previous Signing Key

When a key pair saved by MIDAS before it supported passkeys remains in the browser, the export dialog asks you to register a passkey. Earlier MIDAS stored a key pair, a pair of a private key and a public key, in the browser in a form that could be exported, and signed with it. The Signing Keys tab shows this key as Previous Signing Key. The steps are the same as Create a Passkey and Use an Existing Passkey, and the initial signer name is the signer name of the previous key.

When you register a passkey for the first time, MIDAS registers the public key of the previous key in Trusted Keys under the previous signer name and deletes the key pair from the browser. If Trusted Keys already has the same key, MIDAS leaves that registration as it is. MIDAS keeps treating files signed with the previous key, and projects saved in this browser after opening such files, as Trusted in this browser.

A passkey cannot take in the previous private key, so the fingerprint changes when you migrate. To have recipients treat signatures by the new key as Trusted, give them the public key of the new key.

MIDAS does not import key pair backup files written by MIDAS before it supported passkeys. To treat signatures by the previous key as Trusted in another browser, open a file signed with the previous key and register the signer with Trust this signer in the signature badge. A backup file contains the previous private key, and depending on the version that wrote it, the private key is not encrypted, so delete it if you no longer need it.

Registering Others' Public Keys

By registering a public key received from another user, you can treat that user's signatures as trusted.

Import a Public Key

  1. Click the Import Public Key button in the Trusted Keys section
  2. Select the public key file (.json)
  3. Verify the fingerprint
  4. Enter a name for identification
  5. Click the Register button

Register Trusted Key dialog

Verify the fingerprint to confirm the authenticity of the public key. The procedure is described in Fingerprint Verification.

Edit Registered Key Name

Click a key in the Registered keys list to view details. Click the Edit button to change the name.

Delete Registered Key

Click the Remove button in the Registered keys list to unregister. After removal, signatures from that key will be treated as Unknown.

About Official Keys

The Official section in Trusted Keys displays the MIDAS Provider's keys. Signatures from official keys are always treated as trusted. Official keys are built into the MIDAS application and require no registration.

Official keys cannot be edited or deleted.

Opening MDS from Unknown Signers

By default, MIDAS opens MDS files from an Unknown signer without showing a confirmation dialog. This is because loading an MDS file by itself never makes MIDAS communicate with an external server. Four things in an MDS file can lead to external communication: the link URL of a column's link display, Markdown links in the report body, re-fetching a dataset's source URL with Reload Dataset, and SQL queries. In a project whose trust level is Unknown, MIDAS disables column link display and Markdown links in the report body, and shows the column values and the link text as plain text. For both kinds of link, only URLs with the http or https scheme become links. Reload Dataset re-fetching is available regardless of trust level, but it communicates only when you click. Re-fetching follows the same restrictions as importing from a URL (HTTPS only, no following of redirects, rejection in strict mode) but does not show the warning for URLs outside the trusted list. For SQL queries, the CSP applied to DuckDB rejects reads of external URLs.

The signature badge at the right end of the menu bar shows the trust level of the current project. The badge reads Official for Official, the signer name for Trusted, and Unknown for Unknown. Newly created projects have no signature, so no badge appears. Click the badge to see the signer name, the fingerprint, and the signing time. For a project opened from a URL it also shows that URL, and for a file that passed through several signers it also shows the provenance list. When the signer is Unknown, Trust this signer in this view registers that signer as trusted on the spot.

The trust level of a project is the lowest trust level among everyone in its provenance, so the Unknown signer is not necessarily the last one who signed. When the last signer is Unknown, register them with Trust this signer in the badge view. When an earlier signer in the provenance is Unknown, click Trust next to that signer in the provenance list of the same view. Once every Unknown signer is registered, the warning disappears and the links are rendered without reopening the project.

Before receiving MDS files from a collaborator, we recommend registering their public key as trusted. After registration, MIDAS treats files signed with that key as Trusted.

Show a confirmation dialog for unknown signatures

To confirm explicitly every time, open Help > Settings... and enable Require confirmation for unknown signers on the Security tab. With this setting on, MIDAS shows a confirmation dialog every time you open, from outside the browser, an MDS file whose last signer is Unknown. Only the last signer counts: if an Unknown signer appears earlier in the provenance but the last signer is Trusted, no dialog appears. The dialog also does not appear when you reopen a project saved in the browser.

The dialog displays the signer's self-declared name and fingerprint, and offers three choices:

  • Cancel: Close the dialog without opening the file
  • Trust this signer and open: Enter a name for identification, register the key as trusted, and open the file in the same step
  • Open Anyway: Open the file this once without registering the key

The signer's name is self-declared, so confirm that the key belongs to the stated person by verifying the fingerprint.

See also

  • Privacy and Security - Where data, including signing keys, is stored and the scope of external communication
  • MDS Files - Project file structure and digital signatures

Footnotes

  1. A fingerprint is the first 128 bits of the SHA-256 hash value of the public key. Different public keys with the same fingerprint exist, but creating a key with the same fingerprint as a given public key takes about 21282^{128} hash computations. ↩