use more bits from the users' seed and parse into various subkeys
This commit is contained in:
@@ -3,11 +3,13 @@ define([
|
|||||||
'/bower_components/chainpad-listmap/chainpad-listmap.js',
|
'/bower_components/chainpad-listmap/chainpad-listmap.js',
|
||||||
'/bower_components/chainpad-crypto/crypto.js',
|
'/bower_components/chainpad-crypto/crypto.js',
|
||||||
'/common/cryptpad-common.js',
|
'/common/cryptpad-common.js',
|
||||||
|
'/bower_components/tweetnacl/nacl-fast.min.js',
|
||||||
'/bower_components/scrypt-async/scrypt-async.min.js',
|
'/bower_components/scrypt-async/scrypt-async.min.js',
|
||||||
'/bower_components/jquery/dist/jquery.min.js',
|
'/bower_components/jquery/dist/jquery.min.js',
|
||||||
], function (Config, Listmap, Crypto, Cryptpad) {
|
], function (Config, Listmap, Crypto, Cryptpad) {
|
||||||
var $ = window.jQuery;
|
var $ = window.jQuery;
|
||||||
var Scrypt = window.scrypt;
|
var Scrypt = window.scrypt;
|
||||||
|
var Nacl = window.nacl;
|
||||||
|
|
||||||
Cryptpad.styleAlerts();
|
Cryptpad.styleAlerts();
|
||||||
|
|
||||||
@@ -50,7 +52,7 @@ define([
|
|||||||
input.salt,
|
input.salt,
|
||||||
8, // memoryCost (n)
|
8, // memoryCost (n)
|
||||||
1024, // block size parameter (r)
|
1024, // block size parameter (r)
|
||||||
48, // dkLen
|
128, // dkLen
|
||||||
undefined && 200, // interruptStep
|
undefined && 200, // interruptStep
|
||||||
function (S) {
|
function (S) {
|
||||||
print("Login took " + ((+new Date()) -time )+ "ms");
|
print("Login took " + ((+new Date()) -time )+ "ms");
|
||||||
@@ -62,7 +64,17 @@ define([
|
|||||||
|
|
||||||
var read = function (proxy) {
|
var read = function (proxy) {
|
||||||
console.log("Proxy ready!");
|
console.log("Proxy ready!");
|
||||||
|
|
||||||
|
var otime = +new Date(proxy.atime)
|
||||||
|
|
||||||
var atime = proxy.atime = ('' + new Date());
|
var atime = proxy.atime = ('' + new Date());
|
||||||
|
|
||||||
|
if (otime) {
|
||||||
|
print("Last visit was " +
|
||||||
|
(((+new Date(atime)) - otime) / 1000) +
|
||||||
|
" seconds ago");
|
||||||
|
}
|
||||||
|
|
||||||
proxy.ctime = proxy.ctime || atime;
|
proxy.ctime = proxy.ctime || atime;
|
||||||
proxy.schema = proxy.schema || 'login_data';
|
proxy.schema = proxy.schema || 'login_data';
|
||||||
print(JSON.stringify(proxy, null, 2), 'pre');
|
print(JSON.stringify(proxy, null, 2), 'pre');
|
||||||
@@ -93,8 +105,14 @@ define([
|
|||||||
var authenticated = function (password, next) {
|
var authenticated = function (password, next) {
|
||||||
console.log("Authenticated!");
|
console.log("Authenticated!");
|
||||||
var secret = {};
|
var secret = {};
|
||||||
|
|
||||||
secret.channel = password.slice(0, 32);
|
secret.channel = password.slice(0, 32);
|
||||||
secret.key = password.slice(32);
|
secret.key = password.slice(32, 48);
|
||||||
|
secret.junk = password.slice(48, 64); // consider reordering things
|
||||||
|
secret.curve = password.slice(64, 96);
|
||||||
|
secret.ed = password.slice(96, 128);
|
||||||
|
|
||||||
|
print(JSON.stringify(secret, null, 2), 'pre');
|
||||||
|
|
||||||
var config = {
|
var config = {
|
||||||
websocketURL: Config.websocketURL,
|
websocketURL: Config.websocketURL,
|
||||||
|
|||||||
Reference in New Issue
Block a user