STTP - new generation Secure TBM Transfer Protocol.
STTP works over HTTP and it very similar to TLS. It is a kind of poor copy of HTTPS.
Picture taken from
Installation
npm install sttp
Tutorial
-
To use in nodejs backend call
var sttp = require("sttp")
. -
To use in browser attach
bundle.sttp.js
script from./node_modules/sttp/
directory. And usesttp
global variable.
AuthDataPacker
AuthDataPacker
uses on initializing handshake to share AES-key.
Usage:
var sttp = ; // server:// create and share somehow RSA public key with clientvar keys = sttpkeys;var rsaKeys = keys; // by default 1024// rsaKeys : { public, private }// Share rsaKeys.public // client:// get RSA public key from server and // send encrypted with rsaKeys.public generated aesKeyvar aesKey = keys; // 128 bit key var AuthDataPacker = sttpAuthDataPacker; var packer = rsaKeyspublic;var authData = packer;// transfer authData using some channel to server // server:// get authData from client, decrypt it and save somewherevar packer = rsaKeysprivate;var data = packer;// save aesKey to correspoing user in database// and start using DataPacker
DataPacker
DataPacker
uses for transfering main information it uses AES-128 for encryption(aesKey is transfering AuthDataPacker
).
Usage:
var DataPacker = sttp;var data = projectName : "sttp" contributors : "Alik" "Kevin" "Sergey" ; var packer = aesKey;var packedData = packer; // transfer packedData using some channel// and on other end do the following:// P.S. use the same aesKey var packer = aesKey;var data = packer; // use data...
Example
Also you can look at example of using sttp
in nodejs web application.
Contribution
Read git conventions before.
Make sure that you are using nodejs 6+
git clone https://github.com/alikhil/sttpnpm install
Run tests:
npm test