Giter Site home page Giter Site logo

wisdom-words's Introduction

Wisdom - A Word of Wisdom TCP Server

The Wisdom project is a simple and secure TCP server that sends wisdom quotes to connected clients. To protect against DDoS attacks, the server utilizes a Proof-of-Work (PoW) mechanism using SHA-256 for client validation.

Technologies Used

  • Go
  • Docker

Algorithm: SHA-256

The SHA-256 algorithm is famously used in Bitcoin's PoW mechanism. Its capability to be both secure and adjustable makes it a time-tested choice for PoW algorithms. The server uses the SHA-256 algorithm for PoW validation. We chose SHA-256 for its versatility and adaptability for various use-cases:

  • Simplicity: The straightforwardness of the SHA-256 algorithm makes it an excellent choice for simpler devices. Its implementation is not overly complicated, making it accessible for a wide range of hardware.

  • Configurable Difficulty: One of the primary advantages of using SHA-256 is its adjustable difficulty level. By modifying the number of leading zeros required in the hash, you can control how long it takes to solve the challenge. This adaptability allows you to set the time for solving a single request, which is particularly useful for mitigating DDoS attacks without overwhelming genuine clients.

Server Configuration

Difficulty Level

The --difficulty parameter allows you to set the level of computational difficulty for the PoW validation from the server-side. Clients do not need to adjust this parameter; it's entirely controlled by the server. Recommended values are between 5-8, and the default value is 5.

Run with Docker

To build and run the server using Docker, execute the following command:

make run-server

To build and run the client using Docker, execute the following command:

make run-client

How to run

Server go run cmd/server/server.go --network=tcp --address=0.0.0.0:8080 --difficulty=5

Client go run cmd/client/client.go --network=tcp --address=0.0.0.0:8080

Dificulty can be configured with param difficulty.

Recommended value 5-8.

Default value: 4

Further improvements

  • Use logger Zap/Logrus
  • Consider adding memory consuming algorithms to avoid attacks from GPU f.e. Scrypt or Argon2

wisdom-words's People

Contributors

vladimirdu avatar voltento 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.