GithubHelp home page GithubHelp logo

analysis_security's Introduction

PV204_Noise_Protocol_and_TPM

Link to the assignment.

Setup

Requires go 1.16 or newer.

cd client
go get .
cd ../server
go get .
cd ..

Quickstart

Server and client need to run simultaniously and be able to comunicate.

Server quickstart

The registration string will be uniquely generated based on your environment and keys that get generated.

$ pv204-noise-protocol-and-TPM/server$ go run .
Server registration string: O/+BAwEBEVNlcnZlckluZm9ybWF0aW9uAf+CAAECAQhMb2NhdGlvbgEMAAEJUHVibGljS2V5Af+EAAAAGf+DAQEBCVszMl11aW50OAH/hAABBgFAAABG/4IBDjEyNy4wLjAuMTo2NjY2ASAl/87/r37/uTX/kf/Z//z/qgAZ/8b/y2f/21L/mP+k/8YkaHZOV//Nef+u/8BD/6gJAA==

Client quickstart

Securely communicate the registration string from server to client.

# Registration
pv204-noise-protocol-and-TPM/client$ go run . registration --server-string "INSERT REGISTRATION STRING THAT YOU HAVE FROM SERVER" --username "YOUR USERNAME" --keyfile "keyfile.bin"

# Send msg
pv204-noise-protocol-and-TPM/client$ go run . login --keyfile "keyfile.bin" --send-msg "lorem ipsum"

# Receive msgs
pv204-noise-protocol-and-TPM/client$ go run . login --keyfile "keyfile.bin" --receive-msg

# Interactive mode
pv204-noise-protocol-and-TPM/client$ go run . login --keyfile "keyfile.bin" --period 6

# Select correct TPM (if for some reason you have multiple) - Linux only
pv204-noise-protocol-and-TPM/client$ go run . login --keyfile "keyfile.bin" --tpm-path /dev/tpm0
# or for kernel-managed access
pv204-noise-protocol-and-TPM/client$ go run . login --keyfile "keyfile.bin" --tpm-path /dev/tpmrm0

Client CLI help

The argument tpm-path is not used for Windows app. For Linux app it has default /dev/tpm0.

TPM 2.0 allows direct access via /dev/tpm0 (one client at a time), managed access through the tpm2-abrmd resource manager daemon, or kernel-managed access via /dev/tpmrm0. - Excerpt from Arch wiki

Client CLI generic help

pv204-noise-protocol-and-TPM/client$ go run . -h
NAME:
   PV204 Noise TPM chat client - A new cli application

USAGE:
   client.exe [global options] command [command options] [arguments...]

VERSION:
   v0.0.1

COMMANDS:
   registration  Perform a registration
   login         Login and do some action. If send-msg or receive-msg are specified the action(s) will be performed and exited. If they are not specified, interactive interface will be launched.
   help, h       Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h     show help (default: false)
   --version, -v  print the version (default: false)

Client CLI registration help

pv204-noise-protocol-and-TPM/client$ go run . registration -h
NAME:
   client.exe registration - Perform a registration

USAGE:
   client.exe registration [command options] [arguments...]

OPTIONS:
   --server-string value, -s value
   --username value, -u value
   --keyfile value, -k value        (default: "keypair.bin")
   --tpm-path value, -t value       (default: "IGNORED_ON_WINDOWS")
   --help, -h                       show help (default: false)

Client CLI login help

pv204-noise-protocol-and-TPM/client$ go run . login -h
NAME:
   client.exe login - Login and do some action. If send-msg or receive-msg are specified the action(s) will be performed and exited. If they are not specified, interactive interface will be launched.

USAGE:
   client.exe login [command options] [arguments...]

OPTIONS:
   --period value, -p value    Value is in seconds (default: 5)
   --keyfile value, -k value   (default: "keypair.bin")
   --tpm-path value, -t value  (default: "IGNORED_ON_WINDOWS")
   --send-msg value, -m value  Non-interactive mode: A single msg to be sent.
   --receive-msg, -r           Non-interactive mode: Using this flag you can retrieve msgs once. (default: false)
   --help, -h                  show help (default: false)

analysis_security's People

Contributors

2467c 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.