From 62390df2440c5a14c3a4c90604000c52d3c37006 Mon Sep 17 00:00:00 2001 From: jsrobson10 Date: Sat, 30 Mar 2019 18:34:19 +1100 Subject: [PATCH] Got encrypted, stable communication between the server and the client --- README.md | 2 + main.js | 188 ++++++++++++++++++++++- node_modules/buffer-indexof/.travis.yml | 6 + node_modules/buffer-indexof/LICENSE | 20 +++ node_modules/buffer-indexof/README.md | 29 ++++ node_modules/buffer-indexof/index.js | 19 +++ node_modules/buffer-indexof/package.json | 70 +++++++++ node_modules/buffer-indexof/test/test.js | 27 ++++ node_modules/buffer-split/.travis.yml | 4 + node_modules/buffer-split/LICENSE | 20 +++ node_modules/buffer-split/README.md | 40 +++++ node_modules/buffer-split/index.js | 22 +++ node_modules/buffer-split/package.json | 83 ++++++++++ node_modules/buffer-split/test/test.js | 33 ++++ node_modules/fs/package.json | 3 +- node_modules/net/package.json | 3 +- node_modules/node-rsa/package.json | 3 +- node_modules/random-bytes/HISTORY.md | 4 + node_modules/random-bytes/LICENSE | 21 +++ node_modules/random-bytes/README.md | 77 ++++++++++ node_modules/random-bytes/index.js | 101 ++++++++++++ node_modules/random-bytes/package.json | 94 ++++++++++++ settings.json | 3 + 23 files changed, 864 insertions(+), 8 deletions(-) create mode 100644 node_modules/buffer-indexof/.travis.yml create mode 100644 node_modules/buffer-indexof/LICENSE create mode 100644 node_modules/buffer-indexof/README.md create mode 100644 node_modules/buffer-indexof/index.js create mode 100644 node_modules/buffer-indexof/package.json create mode 100644 node_modules/buffer-indexof/test/test.js create mode 100644 node_modules/buffer-split/.travis.yml create mode 100644 node_modules/buffer-split/LICENSE create mode 100644 node_modules/buffer-split/README.md create mode 100644 node_modules/buffer-split/index.js create mode 100644 node_modules/buffer-split/package.json create mode 100644 node_modules/buffer-split/test/test.js create mode 100644 node_modules/random-bytes/HISTORY.md create mode 100644 node_modules/random-bytes/LICENSE create mode 100644 node_modules/random-bytes/README.md create mode 100644 node_modules/random-bytes/index.js create mode 100644 node_modules/random-bytes/package.json create mode 100644 settings.json diff --git a/README.md b/README.md index 6b1ae6f..20b7ee3 100644 --- a/README.md +++ b/README.md @@ -7,3 +7,5 @@ An open source chat server for the chat client # Required libraries - net - fs +- random-bytes +- node-rsa diff --git a/main.js b/main.js index 5adf8d8..ae19f31 100644 --- a/main.js +++ b/main.js @@ -1,19 +1,197 @@ #!/usr/bin/node // Get some libraries +const random_bytes = require("random-bytes"); +const bsplit = require("buffer-split"); +const node_rsa = require("node-rsa"); const net = require("net"); const fs = require("fs"); +// Load the settings +var settings = require("./settings.json"); + +console.log("Ready."); + +function string_decrypt(key, string) +{ + // Convert the string to a buffer + var buff = new Buffer.from(string); + + // Create some new data + var decrypted = new Buffer.alloc(buff.length); + + // Iterate over the string + for(var i=0;i= key.str.length) + { + // Set to zero + key.at.rx = 0; + } + } + + // Return the encrypted data + return decrypted; +} + +function string_encrypt(key, string) +{ + // Convert the string to a buffer + var buff = new Buffer.from(string); + + // Create some new data + var encrypted = new Buffer.alloc(buff.length); + + // Iterate over the string + for(var i=0;i 255) e -= 256; + encrypted[i] = e; + + // Add 1 to the key counter + key.at.tx += 1; + + // Is the key counter out of range + if(key.at.tx >= key.str.length) + { + // Set to zero + key.at.tx = 0; + } + } + + // Return the encrypted data + return encrypted; +} + +function make_encryption_key(string) +{ + // Make a new key + var key = new Object(); + + // Set the varibles + key.str = string; + key.at = new Object(); + key.at.rx = 0; + key.at.tx = 0; + + // Return the key + return key; +} + +function socket_write(socket, data) +{ + // Send the data encrypted with JSON + socket.sock.write(string_encrypt(socket.key, JSON.stringify(data)+"\n")); +} + +function socket_ondata(socket, callback) +{ + // Wait for a response + socket.on('data', function(data) + { + // Decode the data + data = JSON.parse(data); + + // Call the callback + callback(data); + }); +} + +function socket_init(socket, callback, ondata) +{ + // Set the socket + var sock = new Object(); + sock.sock = socket; + sock.new = true; + + // Wait for data + sock.sock.on('data', function(data) + { + // Is the socket new + if(sock.new) + { + // Set sock new + sock.new = false; + + // Load the key + var key = new node_rsa(); + key.importKey(data.toString(), 'public'); + console.log("Loaded the RSA key"); + + // Get some random bytes + random_bytes(settings.encryption_key_size, function(error,string) + { + // Throw an error if there is one + if(error) throw error; + + // Make the key + sock.key = make_encryption_key(string); + console.log("Created an encryption key") + + // Encrypt the key with RSA + var key_encrypted = key.encrypt(sock.key.str, 'base64'); + console.log("Encrypted the key"); + + // Send the size of the key to the client + sock.sock.write(key_encrypted.length.toString()); + console.log("Sent the size of the key:", key_encrypted.length) + + // Send the key to the client + sock.sock.write(key_encrypted.toString()); + console.log("Sent the key to the client"); + + // Call the callback + setTimeout(callback, 10, sock); + }); + } + + else + { + // Decrypt the data + data = string_decrypt(sock.key, data); + + // Split the data by newlines + data = bsplit(data, Buffer("\n")); + + // Iterate over them + for(var i=0;i -1 && buf.length - s < search.length) return -1; + return s; +} diff --git a/node_modules/buffer-indexof/package.json b/node_modules/buffer-indexof/package.json new file mode 100644 index 0000000..1255d14 --- /dev/null +++ b/node_modules/buffer-indexof/package.json @@ -0,0 +1,70 @@ +{ + "_args": [ + [ + "buffer-indexof@~0.0.0", + "/mnt/c/Users/Josua/Desktop/data/nodejs/electron/chat-project/chat-server/node_modules/buffer-split" + ] + ], + "_from": "buffer-indexof@>=0.0.0 <0.1.0", + "_id": "buffer-indexof@0.0.2", + "_inCache": true, + "_installable": true, + "_location": "/buffer-indexof", + "_npmUser": { + "email": "soldair@gmail.com", + "name": "soldair" + }, + "_npmVersion": "1.4.20", + "_phantomChildren": {}, + "_requested": { + "name": "buffer-indexof", + "raw": "buffer-indexof@~0.0.0", + "rawSpec": "~0.0.0", + "scope": null, + "spec": ">=0.0.0 <0.1.0", + "type": "range" + }, + "_requiredBy": [ + "/buffer-split" + ], + "_resolved": "https://registry.npmjs.org/buffer-indexof/-/buffer-indexof-0.0.2.tgz", + "_shasum": "ed0f36b7ae166a66a7cd174c0467ae8dedf008f5", + "_shrinkwrap": null, + "_spec": "buffer-indexof@~0.0.0", + "_where": "/mnt/c/Users/Josua/Desktop/data/nodejs/electron/chat-project/chat-server/node_modules/buffer-split", + "author": { + "name": "Ryan Day" + }, + "bugs": { + "url": "https://github.com/soldair/node-buffer-indexof/issues" + }, + "dependencies": {}, + "description": "find the index of a buffer in a buffe", + "devDependencies": { + "tape": "~1.1.0" + }, + "directories": {}, + "dist": { + "shasum": "ed0f36b7ae166a66a7cd174c0467ae8dedf008f5", + "tarball": "https://registry.npmjs.org/buffer-indexof/-/buffer-indexof-0.0.2.tgz" + }, + "gitHead": "277ab0cedaf14f6d6ae18571e9dd4d0dea1981a0", + "homepage": "https://github.com/soldair/node-buffer-indexof", + "main": "index.js", + "maintainers": [ + { + "name": "soldair", + "email": "soldair@gmail.com" + } + ], + "name": "buffer-indexof", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "url": "git://github.com/soldair/node-buffer-indexof.git" + }, + "scripts": { + "test": "tape test/*.js" + }, + "version": "0.0.2" +} diff --git a/node_modules/buffer-indexof/test/test.js b/node_modules/buffer-indexof/test/test.js new file mode 100644 index 0000000..fdea9b8 --- /dev/null +++ b/node_modules/buffer-indexof/test/test.js @@ -0,0 +1,27 @@ +var test = require('tape'); +var bindexOf = require('../'); + +test("can haz working",function(t){ + + + var newLineBuffer = new Buffer("\n"); + + var b = new Buffer("hi\nho\nsilver"); + + t.equals(bindexOf(new Buffer('a'), new Buffer('abc')), -1, 'should not match') + + t.equals(bindexOf(new Buffer('aaa'), new Buffer('aa'), 2), -1, 'should not match') + + t.equals(bindexOf(b,newLineBuffer),2,'should find newlines'); + + // you can also start from index + + t.equals(bindexOf(b,newLineBuffer,3),5,"should find newlines after offset"); + + // no match === -1 + + t.equals(bindexOf(b,newLineBuffer,6),-1,"should not find newlines where none are."); + + + t.end(); +}) diff --git a/node_modules/buffer-split/.travis.yml b/node_modules/buffer-split/.travis.yml new file mode 100644 index 0000000..cc4dba2 --- /dev/null +++ b/node_modules/buffer-split/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" diff --git a/node_modules/buffer-split/LICENSE b/node_modules/buffer-split/LICENSE new file mode 100644 index 0000000..f6079df --- /dev/null +++ b/node_modules/buffer-split/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2013 Ryan Day + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/buffer-split/README.md b/node_modules/buffer-split/README.md new file mode 100644 index 0000000..d72ca71 --- /dev/null +++ b/node_modules/buffer-split/README.md @@ -0,0 +1,40 @@ + +[![Build Status](https://secure.travis-ci.org/soldair/node-buffer-split.png)](http://travis-ci.org/soldair/node-buffer-split) + +buffer-split +============ + +split a buffer by another buffer. think String.split() + +```js + +var bsplit = require('buffer-split') +, b = new Buffer("this is a buffer i like to split") +, delim = new Buffer('buffer') +, result = bsplit(b,delim) +; + +result.length === 2 + +result[0].toString() === "this is a " + +result[1].toString() === " i like to split" + + +``` + +you may include the delimiter in the result by passing a thrthy value as the third arg. its more efficient if you need it. + +```js +var bsplit = require('buffer-split') +, b = new Buffer("this is a buffer i like to split") +, delim = new Buffer('buffer') +, result = bsplit(b,delim,true) +; + +result[0].toString() === "this is a buffer" + +result[1].toString() === " i like to split" + + +``` diff --git a/node_modules/buffer-split/index.js b/node_modules/buffer-split/index.js new file mode 100644 index 0000000..322f5a0 --- /dev/null +++ b/node_modules/buffer-split/index.js @@ -0,0 +1,22 @@ +var bufferIndexOf = require('buffer-indexof'); + +module.exports = function(buf,splitBuf,includeDelim){ + + var search = -1 + , lines = [] + , move = includeDelim?splitBuf.length:0 + ; + + while((search = bufferIndexOf(buf,splitBuf)) > -1){ + lines.push(buf.slice(0,search+move)); + buf = buf.slice(search+splitBuf.length,buf.length); + } + + lines.push(buf); + + return lines; +} + + + + diff --git a/node_modules/buffer-split/package.json b/node_modules/buffer-split/package.json new file mode 100644 index 0000000..598febd --- /dev/null +++ b/node_modules/buffer-split/package.json @@ -0,0 +1,83 @@ +{ + "_args": [ + [ + "buffer-split", + "/mnt/c/Users/Josua/Desktop/data/nodejs/electron/chat-project/chat-server" + ] + ], + "_from": "buffer-split@latest", + "_id": "buffer-split@1.0.0", + "_inCache": true, + "_installable": true, + "_location": "/buffer-split", + "_nodeVersion": "4.4.4", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/buffer-split-1.0.0.tgz_1465569032148_0.7547089036088437" + }, + "_npmUser": { + "email": "soldair@gmail.com", + "name": "soldair" + }, + "_npmVersion": "3.9.0", + "_phantomChildren": {}, + "_requested": { + "name": "buffer-split", + "raw": "buffer-split", + "rawSpec": "", + "scope": null, + "spec": "latest", + "type": "tag" + }, + "_requiredBy": [ + "#USER" + ], + "_resolved": "https://registry.npmjs.org/buffer-split/-/buffer-split-1.0.0.tgz", + "_shasum": "4427dbff53731b61d7a71aba47f503396613784a", + "_shrinkwrap": null, + "_spec": "buffer-split", + "_where": "/mnt/c/Users/Josua/Desktop/data/nodejs/electron/chat-project/chat-server", + "author": { + "name": "Ryan Day" + }, + "bugs": { + "url": "https://github.com/soldair/node-buffer-split/issues" + }, + "dependencies": { + "buffer-indexof": "~0.0.0" + }, + "description": "split a buffer by another buffer. think String.split()", + "devDependencies": { + "tape": "~1.1.0" + }, + "directories": {}, + "dist": { + "shasum": "4427dbff53731b61d7a71aba47f503396613784a", + "tarball": "https://registry.npmjs.org/buffer-split/-/buffer-split-1.0.0.tgz" + }, + "gitHead": "6d86666a2f7e4dc1f650f254bb11ba90b2d82567", + "homepage": "https://github.com/soldair/node-buffer-split#readme", + "keywords": [ + "binary", + "buffer", + "chunks", + "split" + ], + "main": "index.js", + "maintainers": [ + { + "name": "soldair", + "email": "soldair@gmail.com" + } + ], + "name": "buffer-split", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "url": "git://github.com/soldair/node-buffer-split.git" + }, + "scripts": { + "test": "node test/*.js" + }, + "version": "1.0.0" +} diff --git a/node_modules/buffer-split/test/test.js b/node_modules/buffer-split/test/test.js new file mode 100644 index 0000000..c0c5bf4 --- /dev/null +++ b/node_modules/buffer-split/test/test.js @@ -0,0 +1,33 @@ +var test = require('tape') +, bsplit = require('../') +; + +test("can split",function(t){ + + var b = new Buffer("this is a buffer i like to split") + , delim = new Buffer('buffer') + , result = bsplit(b,delim) + ; + + t.equals(result.length,2,'should have found chunks'); + + t.equals(result[0].toString(),"this is a ","first chunk should not include delim"); + + t.equals(result[1].toString()," i like to split","should have all results"); + + + result = bsplit(b,delim,true); + + t.equals(result[0].toString(),"this is a buffer",'should include delim') + + result = bsplit(new Buffer('foo,'),new Buffer(',')); + + t.equals(result.length,2,"should have all results"); + + result = bsplit(new Buffer('foo'),new Buffer(',')); + + t.equals(result.length,1,"should have all results"); + + t.end(); + +}) diff --git a/node_modules/fs/package.json b/node_modules/fs/package.json index 1cd04ae..bdb5d99 100644 --- a/node_modules/fs/package.json +++ b/node_modules/fs/package.json @@ -26,7 +26,8 @@ "type": "tag" }, "_requiredBy": [ - "#USER" + "#USER", + "/" ], "_resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", "_shasum": "8a7bd37186b6dddf3813f23858b57ecaaf5e41d4", diff --git a/node_modules/net/package.json b/node_modules/net/package.json index 8536090..7926971 100644 --- a/node_modules/net/package.json +++ b/node_modules/net/package.json @@ -25,7 +25,8 @@ "type": "tag" }, "_requiredBy": [ - "#USER" + "#USER", + "/" ], "_resolved": "https://registry.npmjs.org/net/-/net-1.0.2.tgz", "_shasum": "d1757ec9a7fb2371d83cf4755ce3e27e10829388", diff --git a/node_modules/node-rsa/package.json b/node_modules/node-rsa/package.json index 680151d..2cbe11a 100644 --- a/node_modules/node-rsa/package.json +++ b/node_modules/node-rsa/package.json @@ -31,7 +31,8 @@ "type": "tag" }, "_requiredBy": [ - "#USER" + "#USER", + "/" ], "_resolved": "https://registry.npmjs.org/node-rsa/-/node-rsa-1.0.5.tgz", "_shasum": "854dc1b275729d69bc25883f83ca80705db9262e", diff --git a/node_modules/random-bytes/HISTORY.md b/node_modules/random-bytes/HISTORY.md new file mode 100644 index 0000000..8cabd9d --- /dev/null +++ b/node_modules/random-bytes/HISTORY.md @@ -0,0 +1,4 @@ +1.0.0 / 2016-01-17 +================== + + * Initial release diff --git a/node_modules/random-bytes/LICENSE b/node_modules/random-bytes/LICENSE new file mode 100644 index 0000000..c24dbe3 --- /dev/null +++ b/node_modules/random-bytes/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/random-bytes/README.md b/node_modules/random-bytes/README.md new file mode 100644 index 0000000..df5aacc --- /dev/null +++ b/node_modules/random-bytes/README.md @@ -0,0 +1,77 @@ +# random-bytes + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Generate strong pseudo-random bytes. + +This module is a simple wrapper around the Node.js core `crypto.randomBytes` API, +with the following additions: + + * A `Promise` interface for environments with promises. + * For Node.js versions that do not wait for the PRNG to be seeded, this module + will wait a bit. + +## Installation + +```sh +$ npm install random-bytes +``` + +## API + +```js +var randomBytes = require('random-bytes') +``` + +### randomBytes(size, callback) + +Generates strong pseudo-random bytes. The `size` argument is a number indicating +the number of bytes to generate. + +```js +randomBytes(12, function (error, bytes) { + if (error) throw error + // do something with the bytes +}) +``` + +### randomBytes(size) + +Generates strong pseudo-random bytes and return a `Promise`. The `size` argument is +a number indicating the number of bytes to generate. + +**Note**: To use promises in Node.js _prior to 0.12_, promises must be +"polyfilled" using `global.Promise = require('bluebird')`. + +```js +randomBytes(18).then(function (string) { + // do something with the string +}) +``` + +### randomBytes.sync(size) + +A synchronous version of above. + +```js +var bytes = randomBytes.sync(18) +``` + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/random-bytes.svg +[npm-url]: https://npmjs.org/package/random-bytes +[node-version-image]: https://img.shields.io/node/v/random-bytes.svg +[node-version-url]: http://nodejs.org/download/ +[travis-image]: https://img.shields.io/travis/crypto-utils/random-bytes/master.svg +[travis-url]: https://travis-ci.org/crypto-utils/random-bytes +[coveralls-image]: https://img.shields.io/coveralls/crypto-utils/random-bytes/master.svg +[coveralls-url]: https://coveralls.io/r/crypto-utils/random-bytes?branch=master +[downloads-image]: https://img.shields.io/npm/dm/random-bytes.svg +[downloads-url]: https://npmjs.org/package/random-bytes diff --git a/node_modules/random-bytes/index.js b/node_modules/random-bytes/index.js new file mode 100644 index 0000000..9ad930f --- /dev/null +++ b/node_modules/random-bytes/index.js @@ -0,0 +1,101 @@ +/*! + * random-bytes + * Copyright(c) 2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var crypto = require('crypto') + +/** + * Module variables. + * @private + */ + +var generateAttempts = crypto.randomBytes === crypto.pseudoRandomBytes ? 1 : 3 + +/** + * Module exports. + * @public + */ + +module.exports = randomBytes +module.exports.sync = randomBytesSync + +/** + * Generates strong pseudo-random bytes. + * + * @param {number} size + * @param {function} [callback] + * @return {Promise} + * @public + */ + +function randomBytes(size, callback) { + // validate callback is a function, if provided + if (callback !== undefined && typeof callback !== 'function') { + throw new TypeError('argument callback must be a function') + } + + // require the callback without promises + if (!callback && !global.Promise) { + throw new TypeError('argument callback is required') + } + + if (callback) { + // classic callback style + return generateRandomBytes(size, generateAttempts, callback) + } + + return new Promise(function executor(resolve, reject) { + generateRandomBytes(size, generateAttempts, function onRandomBytes(err, str) { + if (err) return reject(err) + resolve(str) + }) + }) +} + +/** + * Generates strong pseudo-random bytes sync. + * + * @param {number} size + * @return {Buffer} + * @public + */ + +function randomBytesSync(size) { + var err = null + + for (var i = 0; i < generateAttempts; i++) { + try { + return crypto.randomBytes(size) + } catch (e) { + err = e + } + } + + throw err +} + +/** + * Generates strong pseudo-random bytes. + * + * @param {number} size + * @param {number} attempts + * @param {function} callback + * @private + */ + +function generateRandomBytes(size, attempts, callback) { + crypto.randomBytes(size, function onRandomBytes(err, buf) { + if (!err) return callback(null, buf) + if (!--attempts) return callback(err) + setTimeout(generateRandomBytes.bind(null, size, attempts, callback), 10) + }) +} diff --git a/node_modules/random-bytes/package.json b/node_modules/random-bytes/package.json new file mode 100644 index 0000000..68c38c9 --- /dev/null +++ b/node_modules/random-bytes/package.json @@ -0,0 +1,94 @@ +{ + "_args": [ + [ + "random-bytes", + "/mnt/c/Users/Josua/Desktop/data/nodejs/electron/chat-project/chat-server" + ] + ], + "_from": "random-bytes@latest", + "_id": "random-bytes@1.0.0", + "_inCache": true, + "_installable": true, + "_location": "/random-bytes", + "_npmUser": { + "email": "doug@somethingdoug.com", + "name": "dougwilson" + }, + "_npmVersion": "1.4.28", + "_phantomChildren": {}, + "_requested": { + "name": "random-bytes", + "raw": "random-bytes", + "rawSpec": "", + "scope": null, + "spec": "latest", + "type": "tag" + }, + "_requiredBy": [ + "#USER" + ], + "_resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz", + "_shasum": "4f68a1dc0ae58bd3fb95848c30324db75d64360b", + "_shrinkwrap": null, + "_spec": "random-bytes", + "_where": "/mnt/c/Users/Josua/Desktop/data/nodejs/electron/chat-project/chat-server", + "bugs": { + "url": "https://github.com/crypto-utils/random-bytes/issues" + }, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + } + ], + "dependencies": {}, + "description": "URL and cookie safe UIDs", + "devDependencies": { + "bluebird": "3.1.1", + "istanbul": "0.4.2", + "mocha": "2.3.4", + "proxyquire": "1.2.0" + }, + "directories": {}, + "dist": { + "shasum": "4f68a1dc0ae58bd3fb95848c30324db75d64360b", + "tarball": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz" + }, + "engines": { + "node": ">= 0.8" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "README.md", + "index.js" + ], + "gitHead": "3dcd47425a3dfe858ee8debcd4db0c1222110bc3", + "homepage": "https://github.com/crypto-utils/random-bytes", + "keywords": [ + "bytes", + "generator", + "random", + "safe" + ], + "license": "MIT", + "maintainers": [ + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + } + ], + "name": "random-bytes", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/crypto-utils/random-bytes.git" + }, + "scripts": { + "test": "mocha --trace-deprecation --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --trace-deprecation --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --trace-deprecation --reporter spec --check-leaks test/" + }, + "version": "1.0.0" +} diff --git a/settings.json b/settings.json new file mode 100644 index 0000000..98944b7 --- /dev/null +++ b/settings.json @@ -0,0 +1,3 @@ +{ + "encryption_key_size": 100000 +}