From 65f08ff10e5f763dfb083902b2c5bec265765e60 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Tue, 24 Jul 2018 15:31:38 +0200 Subject: [PATCH] moved from 'git.xdrm.io/schastsp' to 'git.xdrm.io/logauth/schastsp' + add readme --- README.md | 86 ++++++++++++++++++++++++++++++++++ client/client.go | 6 +-- client/client.internal.go | 8 ++-- client/config.go | 2 +- cmd/client/client.go | 4 +- cmd/server/server.go | 6 +-- cmd/simple/simple.go | 6 +-- internal/keyset/keyset.go | 4 +- internal/keyset/keyset_test.go | 4 +- internal/scha/hash.go | 2 +- server/server.go | 4 +- server/server.internal.go | 6 +-- 12 files changed, 112 insertions(+), 26 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..28bc0f3 --- /dev/null +++ b/README.md @@ -0,0 +1,86 @@ +# SCHA/STSP + +**Copyright (C) 2017 xdrm-brackets** + + + +[![Go version](https://img.shields.io/badge/go_version-1.10.3-blue.svg)](https://golang.org/doc/go1.10) + +[![Go Report Card](https://goreportcard.com/badge/git.xdrm.io/logauth/schastsp)](https://goreportcard.com/report/git.xdrm.io/logauth/schastsp) +[![Go doc](https://godoc.org/git.xdrm.io/logauth/schastsp?status.svg)](https://godoc.org/git.xdrm.io/logauth/schastsp) + + +## Overview + +---- + +This software defines and uses its own protocol which bundles 2 technologies : + +- Stateless Cyclic Hash Algorithm +- Stateless Time Scrambling Protocol + +It is meant to be used over request/response stateless networking and has been designed with HTTP in mind. The protocol only covers the generation and management of a pair of *tokens* which are hexadecimal strings. These are sent inside each request and a pair also has to be sent back to the sender. These tokens are mainly sent in the HTTP `Authorization` header for HTTP requests and responses. + + + +**Features** + +Beyond security issues, this protocol has some additional features : + +- **Trust Chain** - Each exchange between the server and the client is bound to the previous one. Each request is unique and can only give information about previous ones, not future ones. This principle ensures the server that no-one can be faking the client (unless someone has access to its key). + + > If an attacker can guess (*e.g. bruteforce*) a successful request and gain access to the server - if he hasn't the client's key - it is fairly impossible that he also guesses the next request. + + > A resynchronization protocol is featured in this package in order for a client to regain ownership on the trust chain if lost (by network issue or by an attack). + +- **Time-awareness** - A request is only valid a short amount of time after its generation. This amount is usually the maximum transmission time. + + > Any MITM that catches the client's request to change its content only has a minimum time to forward it. As a result - if the amount is well chosen - any request modification is blocked by the time it takes. + +- [TODO] + + + + + +**Security** + +The aim of this package is to provide a **secure** authentication system between a server and its clients. Secure is defined as follows : + +- No *man-in-the-middle* (MITM) can gather enough information to fake any client. Every data sent over the network is the result of one or more one-way algorithms. +- Neither a protocol understanding nor the source code can help an attacker fake a client or find useful information among requests. +- The server has no secret key other than the synchronization key (used once to bind the client). The server has no clue what each client's key is, in fact it knows as much as a *MITM*. + + + + + +## Requirements + +---- + +You need a recent machine with `go` installed. + +> This package has not been tested under the version **1.10**. + + + +## Installation + +---- + +Download the package with `go get` : + +```bash +go get git.xdrm.io/logauth/schastsp +``` + + + +Build the executables : + +```bash +go install git.xdrm.io/logauth/schastsp/cmd/client; +go install git.xdrm.io/logauth/schastsp/cmd/server; +``` + diff --git a/client/client.go b/client/client.go index e554cf8..d0303e1 100644 --- a/client/client.go +++ b/client/client.go @@ -3,9 +3,9 @@ package client import ( "errors" "fmt" - "git.xdrm.io/schastsp/internal/keyset" - "git.xdrm.io/schastsp/context" - "git.xdrm.io/schastsp/internal/scha" + "git.xdrm.io/logauth/schastsp/internal/keyset" + "git.xdrm.io/logauth/schastsp/context" + "git.xdrm.io/logauth/schastsp/internal/scha" "io" ) diff --git a/client/client.internal.go b/client/client.internal.go index 12c4ccc..39295cc 100644 --- a/client/client.internal.go +++ b/client/client.internal.go @@ -3,10 +3,10 @@ package client import ( "encoding/binary" "fmt" - "git.xdrm.io/schastsp/internal/keyset" - "git.xdrm.io/schastsp/internal/scha" - "git.xdrm.io/schastsp/internal/timeid" - "git.xdrm.io/schastsp/internal/xor" + "git.xdrm.io/logauth/schastsp/internal/keyset" + "git.xdrm.io/logauth/schastsp/internal/scha" + "git.xdrm.io/logauth/schastsp/internal/timeid" + "git.xdrm.io/logauth/schastsp/internal/xor" ) /* (1) Updates 'key' and 'sync' with files diff --git a/client/config.go b/client/config.go index a04974b..5f1e33d 100644 --- a/client/config.go +++ b/client/config.go @@ -1,7 +1,7 @@ package client; import ( - "git.xdrm.io/schastsp/internal/keyset" + "git.xdrm.io/logauth/schastsp/internal/keyset" "fmt" "path/filepath" "errors" diff --git a/cmd/client/client.go b/cmd/client/client.go index 98bfd71..759cd8b 100644 --- a/cmd/client/client.go +++ b/cmd/client/client.go @@ -5,8 +5,8 @@ import ( "os" "flag" "fmt" - "git.xdrm.io/schastsp/context" - "git.xdrm.io/schastsp/client" + "git.xdrm.io/logauth/schastsp/context" + "git.xdrm.io/logauth/schastsp/client" ) func main(){ diff --git a/cmd/server/server.go b/cmd/server/server.go index 4ff2357..ca5329d 100644 --- a/cmd/server/server.go +++ b/cmd/server/server.go @@ -1,13 +1,13 @@ package main import ( - "git.xdrm.io/schastsp/internal/scha" + "git.xdrm.io/logauth/schastsp/internal/scha" "time" "os" "flag" "fmt" - "git.xdrm.io/schastsp/context" - "git.xdrm.io/schastsp/server" + "git.xdrm.io/logauth/schastsp/context" + "git.xdrm.io/logauth/schastsp/server" ) func main(){ diff --git a/cmd/simple/simple.go b/cmd/simple/simple.go index f77f16f..d902e93 100644 --- a/cmd/simple/simple.go +++ b/cmd/simple/simple.go @@ -6,9 +6,9 @@ import ( "os" "flag" "fmt" - "git.xdrm.io/schastsp/context" - "git.xdrm.io/schastsp/client" - "git.xdrm.io/schastsp/server" + "git.xdrm.io/logauth/schastsp/context" + "git.xdrm.io/logauth/schastsp/client" + "git.xdrm.io/logauth/schastsp/server" ) /* Store target config paths */ diff --git a/internal/keyset/keyset.go b/internal/keyset/keyset.go index b259e1a..7c9d1c7 100644 --- a/internal/keyset/keyset.go +++ b/internal/keyset/keyset.go @@ -3,8 +3,8 @@ package keyset import ( "encoding/binary" "errors" - "git.xdrm.io/schastsp/context" - "git.xdrm.io/schastsp/internal/scha" + "git.xdrm.io/logauth/schastsp/context" + "git.xdrm.io/logauth/schastsp/internal/scha" "io" ) diff --git a/internal/keyset/keyset_test.go b/internal/keyset/keyset_test.go index 7d7074f..01da793 100644 --- a/internal/keyset/keyset_test.go +++ b/internal/keyset/keyset_test.go @@ -2,8 +2,8 @@ package keyset import ( "bytes" - "git.xdrm.io/schastsp/context" - "git.xdrm.io/schastsp/internal/scha" + "git.xdrm.io/logauth/schastsp/context" + "git.xdrm.io/logauth/schastsp/internal/scha" "testing" ) diff --git a/internal/scha/hash.go b/internal/scha/hash.go index bcfaed3..fb099b7 100644 --- a/internal/scha/hash.go +++ b/internal/scha/hash.go @@ -3,7 +3,7 @@ package scha import ( "errors" "crypto/sha512" - "git.xdrm.io/schastsp/internal/xor" + "git.xdrm.io/logauth/schastsp/internal/xor" ) /* (0) Static diff --git a/server/server.go b/server/server.go index 5a3cc15..0f6a02e 100644 --- a/server/server.go +++ b/server/server.go @@ -2,12 +2,12 @@ package server import ( "fmt" - "git.xdrm.io/schastsp/internal/scha" + "git.xdrm.io/logauth/schastsp/internal/scha" "io" "os" "path/filepath" "errors" - "git.xdrm.io/schastsp/context" + "git.xdrm.io/logauth/schastsp/context" ) const DEBUG = false diff --git a/server/server.internal.go b/server/server.internal.go index 5a5bb8f..08c53af 100644 --- a/server/server.internal.go +++ b/server/server.internal.go @@ -4,9 +4,9 @@ import ( "encoding/binary" "errors" "fmt" - "git.xdrm.io/schastsp/internal/scha" - "git.xdrm.io/schastsp/internal/timeid" - "git.xdrm.io/schastsp/internal/xor" + "git.xdrm.io/logauth/schastsp/internal/scha" + "git.xdrm.io/logauth/schastsp/internal/timeid" + "git.xdrm.io/logauth/schastsp/internal/xor" "os" )