Giter Club home page Giter Club logo

yoti's Introduction

core-interview-test

This repository includes the YOTI Core team interview test, and its resources.

The YOTI Core test

At Yoti we use a microservice architecture. This test asks for the development of a software encryption module to fit this architecture.

Please implement an encryption-server with two endpoints, described below. The server's interface may, for the purposes of this test, be anything convenient for you: it could be Unix sockets, HTTP, or even pure command line driven.

Use of built-in and third party Go libraries is encouraged, particularly with regard to serialising data/messages/commands.

We're happy for the data store to be implemented in any way: it could be an in-memory structure (don't worry about memory usage), on-disk, or using a third party library/database.

store endpoint

Inputs:

  • data to encrypt (plaintext)
  • an ID (will be used later to retrieve the data)

Actions:

  • generate an AES encryption key
  • encrypt the plaintext data using the generated key
  • store the encrypted data (ciphertext)

Outputs:

  • the key used to encrypt the ciphertext

retrieve endpoint

Inputs:

  • encryption key
  • ID

Actions:

  • retrieve the encrypted data (ciphertext)
  • decrypt the ciphertext using the provided key

Outputs:

  • the original plaintext

Go client interface

A client interface has also been provided. Please implement a client which satisfies the interface in order to interact with the above server.

Extra credits

Optional things for extra credits! Only do these if you wish to spend more time on this. We're happy to consider answers with and without these.

  1. It would be desirable for the data store key (used internally by encryption-server) to be difficult to derive from the original ID provided when storing the data. The intention is to provide an extra layer of protection of user data (hiding any information in the data IDs) if an attacker was able to dump the raw database.

  2. Split the storage component out into its own microservice.

Notes

All work should be committed to a git repository where the commit history can be reviewed. github is fine, but we're also happy for a .tar or similar of the git repository.

Your solution should also be easy to run/verify. To that end please feel free to provide any further instructions, documentation, etc on how to go about the verification process.

Testing

To test, first compile and run the server code

go run .
{"level":"info","port":8080,"time":"2020-10-04T16:25:01Z","message":"starting"}

You should see a log message telling you where the http endpoint is. Add some data to your store via the CLI and get an encryption key back. Note that the key itself is not kept on the server; we hash it so nobody can guess your id.

cd tools/cli
go build .
./cli store <id, eg "a"> <filename, eg cli.go>
1911797e2e9d418b8399fafd79de79f14c6370ae58c2a314195a35bcfdd359ae

To retrieve,

./cli retrieve a 1911797e2e9d418b8399fafd79de79f14c6370ae58c2a314195a35bcfdd359ae
<file contents written to stdout>

yoti's People

Contributors

adamlounds avatar lkdraytonbrown avatar lwithers avatar

Watchers

James Cloos avatar  avatar

yoti's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.