Deployed the page to Github Pages.
This commit is contained in:
parent
1d79754e93
commit
2c89899458
62797 changed files with 6551425 additions and 15279 deletions
18
node_modules/cryptiles/.npmignore
generated
vendored
Normal file
18
node_modules/cryptiles/.npmignore
generated
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
.idea
|
||||
*.iml
|
||||
npm-debug.log
|
||||
dump.rdb
|
||||
node_modules
|
||||
results.tap
|
||||
results.xml
|
||||
npm-shrinkwrap.json
|
||||
config.json
|
||||
.DS_Store
|
||||
*/.DS_Store
|
||||
*/*/.DS_Store
|
||||
._*
|
||||
*/._*
|
||||
*/*/._*
|
||||
coverage.*
|
||||
lib-cov
|
||||
|
5
node_modules/cryptiles/.travis.yml
generated
vendored
Executable file
5
node_modules/cryptiles/.travis.yml
generated
vendored
Executable file
|
@ -0,0 +1,5 @@
|
|||
language: node_js
|
||||
|
||||
node_js:
|
||||
- 0.10
|
||||
|
24
node_modules/cryptiles/LICENSE
generated
vendored
Executable file
24
node_modules/cryptiles/LICENSE
generated
vendored
Executable file
|
@ -0,0 +1,24 @@
|
|||
Copyright (c) 2012-2013, Eran Hammer.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Eran Hammer nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL ERAN HAMMER BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
6
node_modules/cryptiles/README.md
generated
vendored
Normal file
6
node_modules/cryptiles/README.md
generated
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
cryptiles
|
||||
=========
|
||||
|
||||
General purpose crypto utilities
|
||||
|
||||
[](http://travis-ci.org/hueniverse/cryptiles)
|
68
node_modules/cryptiles/lib/index.js
generated
vendored
Executable file
68
node_modules/cryptiles/lib/index.js
generated
vendored
Executable file
|
@ -0,0 +1,68 @@
|
|||
// Load modules
|
||||
|
||||
var Crypto = require('crypto');
|
||||
var Boom = require('boom');
|
||||
|
||||
|
||||
// Declare internals
|
||||
|
||||
var internals = {};
|
||||
|
||||
|
||||
// Generate a cryptographically strong pseudo-random data
|
||||
|
||||
exports.randomString = function (size) {
|
||||
|
||||
var buffer = exports.randomBits((size + 1) * 6);
|
||||
if (buffer instanceof Error) {
|
||||
return buffer;
|
||||
}
|
||||
|
||||
var string = buffer.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, '');
|
||||
return string.slice(0, size);
|
||||
};
|
||||
|
||||
|
||||
exports.randomBits = function (bits) {
|
||||
|
||||
if (!bits ||
|
||||
bits < 0) {
|
||||
|
||||
return Boom.internal('Invalid random bits count');
|
||||
}
|
||||
|
||||
var bytes = Math.ceil(bits / 8);
|
||||
try {
|
||||
return Crypto.randomBytes(bytes);
|
||||
}
|
||||
catch (err) {
|
||||
return Boom.internal('Failed generating random bits: ' + err.message);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Compare two strings using fixed time algorithm (to prevent time-based analysis of MAC digest match)
|
||||
|
||||
exports.fixedTimeComparison = function (a, b) {
|
||||
|
||||
if (typeof a !== 'string' ||
|
||||
typeof b !== 'string') {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
var mismatch = (a.length === b.length ? 0 : 1);
|
||||
if (mismatch) {
|
||||
b = a;
|
||||
}
|
||||
|
||||
for (var i = 0, il = a.length; i < il; ++i) {
|
||||
var ac = a.charCodeAt(i);
|
||||
var bc = b.charCodeAt(i);
|
||||
mismatch += (ac === bc ? 0 : 1);
|
||||
}
|
||||
|
||||
return (mismatch === 0);
|
||||
};
|
||||
|
||||
|
33
node_modules/cryptiles/package.json
generated
vendored
Executable file
33
node_modules/cryptiles/package.json
generated
vendored
Executable file
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"name": "cryptiles",
|
||||
"description": "General purpose crypto utilities",
|
||||
"version": "0.2.2",
|
||||
"author": "Eran Hammer <eran@hueniverse.com> (http://hueniverse.com)",
|
||||
"contributors": [],
|
||||
"repository": "git://github.com/hueniverse/cryptiles",
|
||||
"main": "index",
|
||||
"keywords": [
|
||||
"cryptography",
|
||||
"security",
|
||||
"utilites"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=0.8.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"boom": "0.4.x"
|
||||
},
|
||||
"devDependencies": {
|
||||
"lab": "0.1.x",
|
||||
"complexity-report": "0.x.x"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "make test-cov"
|
||||
},
|
||||
"licenses": [
|
||||
{
|
||||
"type": "BSD",
|
||||
"url": "http://github.com/hueniverse/cryptiles/raw/master/LICENSE"
|
||||
}
|
||||
]
|
||||
}
|
101
node_modules/cryptiles/test/index.js
generated
vendored
Executable file
101
node_modules/cryptiles/test/index.js
generated
vendored
Executable file
|
@ -0,0 +1,101 @@
|
|||
// Load modules
|
||||
|
||||
var Lab = require('lab');
|
||||
var Cryptiles = require('../lib');
|
||||
|
||||
|
||||
// Declare internals
|
||||
|
||||
var internals = {};
|
||||
|
||||
|
||||
// Test shortcuts
|
||||
|
||||
var expect = Lab.expect;
|
||||
var before = Lab.before;
|
||||
var after = Lab.after;
|
||||
var describe = Lab.experiment;
|
||||
var it = Lab.test;
|
||||
|
||||
|
||||
describe('Cryptiles', function () {
|
||||
|
||||
describe('#randomString', function () {
|
||||
|
||||
it('should generate the right length string', function (done) {
|
||||
|
||||
for (var i = 1; i <= 1000; ++i) {
|
||||
expect(Cryptiles.randomString(i).length).to.equal(i);
|
||||
}
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it('returns an error on invalid bits size', function (done) {
|
||||
|
||||
expect(Cryptiles.randomString(99999999999999999999).message).to.equal('Failed generating random bits: Argument #1 must be number > 0');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
describe('#randomBits', function () {
|
||||
|
||||
it('returns an error on invalid input', function (done) {
|
||||
|
||||
expect(Cryptiles.randomBits(0).message).to.equal('Invalid random bits count');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
describe('#fixedTimeComparison', function () {
|
||||
|
||||
var a = Cryptiles.randomString(50000);
|
||||
var b = Cryptiles.randomString(150000);
|
||||
|
||||
it('should take the same amount of time comparing different string sizes', function (done) {
|
||||
|
||||
var now = Date.now();
|
||||
Cryptiles.fixedTimeComparison(b, a);
|
||||
var t1 = Date.now() - now;
|
||||
|
||||
now = Date.now();
|
||||
Cryptiles.fixedTimeComparison(b, b);
|
||||
var t2 = Date.now() - now;
|
||||
|
||||
expect(t2 - t1).to.be.within(-20, 20);
|
||||
done();
|
||||
});
|
||||
|
||||
it('should return true for equal strings', function (done) {
|
||||
|
||||
expect(Cryptiles.fixedTimeComparison(a, a)).to.equal(true);
|
||||
done();
|
||||
});
|
||||
|
||||
it('should return false for different strings (size, a < b)', function (done) {
|
||||
|
||||
expect(Cryptiles.fixedTimeComparison(a, a + 'x')).to.equal(false);
|
||||
done();
|
||||
});
|
||||
|
||||
it('should return false for different strings (size, a > b)', function (done) {
|
||||
|
||||
expect(Cryptiles.fixedTimeComparison(a + 'x', a)).to.equal(false);
|
||||
done();
|
||||
});
|
||||
|
||||
it('should return false for different strings (size, a = b)', function (done) {
|
||||
|
||||
expect(Cryptiles.fixedTimeComparison(a + 'x', a + 'y')).to.equal(false);
|
||||
done();
|
||||
});
|
||||
|
||||
it('should return false when not a string', function (done) {
|
||||
|
||||
expect(Cryptiles.fixedTimeComparison('x', null)).to.equal(false);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue