moved from 'git.xdrm.io/schastsp' to 'git.xdrm.io/logauth/schastsp' + add readme

This commit is contained in:
Adrien Marquès 2018-07-24 15:31:38 +02:00
parent 7c92d5c8ac
commit 65f08ff10e
12 changed files with 112 additions and 26 deletions

86
README.md Normal file
View File

@ -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 <u>one-way algorithms</u>.
- 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 <u>synchronization key</u> (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;
```

View File

@ -3,9 +3,9 @@ package client
import ( import (
"errors" "errors"
"fmt" "fmt"
"git.xdrm.io/schastsp/internal/keyset" "git.xdrm.io/logauth/schastsp/internal/keyset"
"git.xdrm.io/schastsp/context" "git.xdrm.io/logauth/schastsp/context"
"git.xdrm.io/schastsp/internal/scha" "git.xdrm.io/logauth/schastsp/internal/scha"
"io" "io"
) )

View File

@ -3,10 +3,10 @@ package client
import ( import (
"encoding/binary" "encoding/binary"
"fmt" "fmt"
"git.xdrm.io/schastsp/internal/keyset" "git.xdrm.io/logauth/schastsp/internal/keyset"
"git.xdrm.io/schastsp/internal/scha" "git.xdrm.io/logauth/schastsp/internal/scha"
"git.xdrm.io/schastsp/internal/timeid" "git.xdrm.io/logauth/schastsp/internal/timeid"
"git.xdrm.io/schastsp/internal/xor" "git.xdrm.io/logauth/schastsp/internal/xor"
) )
/* (1) Updates 'key' and 'sync' with files /* (1) Updates 'key' and 'sync' with files

View File

@ -1,7 +1,7 @@
package client; package client;
import ( import (
"git.xdrm.io/schastsp/internal/keyset" "git.xdrm.io/logauth/schastsp/internal/keyset"
"fmt" "fmt"
"path/filepath" "path/filepath"
"errors" "errors"

View File

@ -5,8 +5,8 @@ import (
"os" "os"
"flag" "flag"
"fmt" "fmt"
"git.xdrm.io/schastsp/context" "git.xdrm.io/logauth/schastsp/context"
"git.xdrm.io/schastsp/client" "git.xdrm.io/logauth/schastsp/client"
) )
func main(){ func main(){

View File

@ -1,13 +1,13 @@
package main package main
import ( import (
"git.xdrm.io/schastsp/internal/scha" "git.xdrm.io/logauth/schastsp/internal/scha"
"time" "time"
"os" "os"
"flag" "flag"
"fmt" "fmt"
"git.xdrm.io/schastsp/context" "git.xdrm.io/logauth/schastsp/context"
"git.xdrm.io/schastsp/server" "git.xdrm.io/logauth/schastsp/server"
) )
func main(){ func main(){

View File

@ -6,9 +6,9 @@ import (
"os" "os"
"flag" "flag"
"fmt" "fmt"
"git.xdrm.io/schastsp/context" "git.xdrm.io/logauth/schastsp/context"
"git.xdrm.io/schastsp/client" "git.xdrm.io/logauth/schastsp/client"
"git.xdrm.io/schastsp/server" "git.xdrm.io/logauth/schastsp/server"
) )
/* Store target config paths */ /* Store target config paths */

View File

@ -3,8 +3,8 @@ package keyset
import ( import (
"encoding/binary" "encoding/binary"
"errors" "errors"
"git.xdrm.io/schastsp/context" "git.xdrm.io/logauth/schastsp/context"
"git.xdrm.io/schastsp/internal/scha" "git.xdrm.io/logauth/schastsp/internal/scha"
"io" "io"
) )

View File

@ -2,8 +2,8 @@ package keyset
import ( import (
"bytes" "bytes"
"git.xdrm.io/schastsp/context" "git.xdrm.io/logauth/schastsp/context"
"git.xdrm.io/schastsp/internal/scha" "git.xdrm.io/logauth/schastsp/internal/scha"
"testing" "testing"
) )

View File

@ -3,7 +3,7 @@ package scha
import ( import (
"errors" "errors"
"crypto/sha512" "crypto/sha512"
"git.xdrm.io/schastsp/internal/xor" "git.xdrm.io/logauth/schastsp/internal/xor"
) )
/* (0) Static /* (0) Static

View File

@ -2,12 +2,12 @@ package server
import ( import (
"fmt" "fmt"
"git.xdrm.io/schastsp/internal/scha" "git.xdrm.io/logauth/schastsp/internal/scha"
"io" "io"
"os" "os"
"path/filepath" "path/filepath"
"errors" "errors"
"git.xdrm.io/schastsp/context" "git.xdrm.io/logauth/schastsp/context"
) )
const DEBUG = false const DEBUG = false

View File

@ -4,9 +4,9 @@ import (
"encoding/binary" "encoding/binary"
"errors" "errors"
"fmt" "fmt"
"git.xdrm.io/schastsp/internal/scha" "git.xdrm.io/logauth/schastsp/internal/scha"
"git.xdrm.io/schastsp/internal/timeid" "git.xdrm.io/logauth/schastsp/internal/timeid"
"git.xdrm.io/schastsp/internal/xor" "git.xdrm.io/logauth/schastsp/internal/xor"
"os" "os"
) )