Giter Site home page Giter Site logo

mustafatufan / log-signer Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.42 MB

An interview test project from 2019. Company: Guardtime. Country: Estonia. Result: Failed.

Home Page: https://guardtime.com

License: MIT License

Java 72.04% HTML 27.96%
java java-8 hash-trees binary-trees merkle-tree logging signing log-signer spring-boot interview

log-signer's Introduction

Log Signer

๐Ÿ” Log Signer is an project to save log files and to verify log lines later.

Features

1. Upload a log file.

File Upload

2. A sign file is going to be created automatically. (.merkle)

File List

3. You could verify any log line in the log file by viewing merkle path of the log line.

Verify

Verify2

Introduction

There are several possibilities to sign a log file. One could:

  1. Sign the file as a whole
  2. Sign each row separately
  3. Hash the rows and sign those hashes
  4. Hash the rows, chain them and sign the last member of the chain

There is also a 5. possibility which has some advantages over before mentioned 4, allowing to prove the integrity of each row and the whole log file at the same time. An additional benefit is the possibility to extract separate rows without exposing the rest of the content. This solution has a name โ€“ hash tree (a.k.a. Merkle tree).

Binary Tree

Your task has two parts:

  1. Write a solution for signing any random log file
    • Input log file is a plaintext file with each event in a separate row. You could use any existing human-readable log file or create your own.
  2. Write a solution for extracting the hash chain for any row from the tree
    • Input should be the plaintext row for which to extract the hash chain.
    • The output should be the hash chain from the row (leaf of the tree) to the single hash representing the whole log file (the root of the tree).
You will immediately stumble upon two problems.
  1. Signing: For the signing of the root hash you can write an empty class or if you have access to the gateway, use our SDK to sign it.
  2. Building the tree: The picture on top of this page might look easy but the reality is different. In case of balanced tree you would have n2 leaves, but what about those cases where the tree is unbalanced? The solution is up to you.

License

MIT

log-signer's People

Contributors

mustafatufan avatar

Watchers

 avatar

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.