Coder Social home page Coder Social logo

lipshok-final's Introduction

Framework Smart-Home Kit (FSHK)

Licence Apache2

Logo Golang

This thesis has been developed using GoLang.


How it works

The framework is in the main-app folder, to manage the main server and its interaction.

Once started, it will create its own database file using sqlite, with the name FSHK.db, wherever the program is started. You can choose two ways of starting protocols services :

  • Either enable the protocols using the JSON file called "protocols.json" next to the app (it must follow the template as given in /main-app/protocols.json). This way, the main-app will start its own services.
  • Or you can start your own services, on the device you want, using the different services provided in test/received-*.go. Be sure to forward data to the right IP/port if you move it.

Messaging

Each message must respect the same architecture, except for specified protocols. It must have at least 24 bytes for the message header, and a maximum of 65 536 bytes at most. So, body can contain up to 65 512 bytes.

Repartitions of the header :

  • 0-1 : Data Length
  • 2-14 : Aes IV
  • 15 : Data Type
  • 16-24: Padding (reservation for possible upgrade)

Of course the data length must match the data, otherwise the message won't be processed.

Security

The system uses two distincts encryptions.

The first one, and the most used is AES-128. It is used for most of the communications of the kit, since most of it transits through big packets such as the ones in WebSockets (maxed at 65536 here). A new IV is generated every time for every message, while the MasterKey is hard-coded for every device. Since the encrypted data is not necessarily the same size of its original data, the first bytes must be edited to fit.

The second system is the algorithm PRESENT1, which is an ultra lightweight algorithm, created to be run on low computational units. In some of our cases, such as BLE communications, remote devices have not the memory not the power to compute AES-128 fast enough. In those cases, as the data have very strict limitations, it is an ideal pick.

Protocols

WebSocket

Main-App is managing WebSockets from scratch on port 5001. It's on this websocket that every protocol is forwarded.

UDP

This software allows UDP packets to be received on the port 5010 Then, it forwards it to the main app, to register everything.

If something is received, the service will acknowledge it using a return message {"data":"OK"} everytime. If you do not receive it, your message has not been received.

TCP

This software allows TCP packets to be received on the port 5020 Then, it forwards it to the main app, to register everything.

If something is received, the service will acknowledge it using a return message {"data":"OK"} everytime. If you do not receive it, your message has not been received.

Bluetooth Low Energy

BLE is managed internally using a WebSocket listening on Port 5030. Every device must have its own adapter to connect through it. An example of such a device can be observed in test/wristband-ble.go.

Web Interface

A web interface is available once the program is started, on the port 5002. It will interact with the server using a specific websocket designed to this effect.

Authors

Kévin Chapron

License

Copyright 2020 Kévin Chapron.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

1 Bogdanov A. et al. (2007) PRESENT: An Ultra-Lightweight Block Cipher. In: Paillier P., Verbauwhede I. (eds) Cryptographic Hardware and Embedded Systems - CHES 2007. CHES 2007. Lecture Notes in Computer Science, vol 4727. Springer, Berlin, Heidelberg.

lipshok-final's People

Contributors

kevinchapron avatar

Stargazers

FlorentinTh 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.