Skip to main content

Public keys

Public keys offer a secure way to authenticate with Encord without requiring a user login and password. In particular, this is required when using the Encord SDK or Encord API. Once you have registered your public key, you can use the SDK or API to create, manage and interrogate projects, datasets and labels programmatically.

The 'Public keys' screen is where you create, filter and manage your public keys via a

  • + New key button: click this to register a new public key
  • Search bar: typing in the search bar will filter the keys by name
  • List of keys: delete them using the red bin icon

Set up public key authentication

A public-private key pair is required for authentication. Register the public key with Encord and use your private key as your credentials.

1. Generate a public-private key pair

If you do not already have an Ed25519 public-private key pair, you must first generate one using an encryption library. These libraries are part of most major operating systems, so you can generate this key pair using the appropriate terminal for your OS:

  • Linux/MacOS: the default terminal
  • Windows 10 & Server 2019/2022: Powershell

To generate a public-private key pair:

  1. Open Terminal
  2. Run the following command:
    $ ssh-keygen -t ed25519
  3. Press enter to accept the default file location or modify as required:
  • For Mac:
    > Enter a file in which to save the key (/Users/YOU/.ssh/id_ALGORITHM: [Modify / Press ENTER]
  • For Windows:
    > Enter a file in which to save the key (C:\Users\YOU/.ssh/id_ALGORITHM): [Modify / Press ENTER]
  • For Linux:
    > Enter a file in which to save the key (/home/YOU/.ssh/id_ALGORITHM): [Modify / Press ENTER]
  1. IMPORTANT Leave the passphrase blank:
> Enter passphrase (empty for no passphrase): [Press ENTER]
> Enter same passphrase again: [Press ENTER]

Now you should have two files:

  • /path/to/your/key/id_ALGORITHM contains your private key (which you should keep secure);
  • /path/to/your/key/ contains your public key (usually in a file ending in .pub).

You now need to add your public key to your Encord profile.

2. Add the public key to Encord

To add your public key to Encord:

  1. Copy the contents of the public key file. For that, do:

    $ cat /path/to/your/key/
    # Then select and copy the contents of the file
    # displayed in the terminal to your clipboard
  2. In Encord, navigate to:

    User > Settings > Public keys > + New key
  3. Choose a name for your key and paste in your public key. It must be in SSH key format and should look something like ssh-ed25519 <lots of characters>. Once you are happy, click Create to register it. You are now ready to authenticate programmatically with your private key.

3. Authenticate with your private key

You can now authenticate with Encord using your private key. Please check the SDK or API documentation on how to authenticate with each respectively.