Compare commits

..
8 Commits
Author SHA1 Message Date
n1474335 bf833991bf 5.19.2 2017-09-06 16:09:36 +00:00
n1474335 615357c977 Corrected travis config logic 2017-09-06 16:06:37 +00:00
n1474335 19f23127b9 Updated travis config to create a new branch when building a tagged release 2017-09-06 16:04:11 +00:00
n1474335 2ea6d9437f 5.19.1 2017-09-06 10:28:41 +00:00
n1474335 833b6d67a6 Updated package-lock.json to fix tagged builds 2017-09-06 10:28:35 +00:00
n1474335 04c1adc5f0 5.19.0 2017-09-05 17:59:16 +00:00
n1474335 8e8f6a0284 Merge branch 'feature-otp' 2017-09-05 17:59:02 +00:00
n1474335 68bf1d123e Added 'Generate HOTP' and 'Generate TOTP' operations 2017-09-05 17:53:54 +00:00
6 changed files with 989 additions and 871 deletions

No files matched your search

+1
View File
@@ -4,6 +4,7 @@ node_js:
install: npm install
before_script:
- npm install -g grunt
- if [ "$TRAVIS_TAG" ]; then git checkout -b travis-build; fi
script:
- grunt lint
- grunt test
+867 -869
View File
File diff suppressed because it is too large. Load diff
+2 -1
View File
@@ -1,6 +1,6 @@
{
"name": "cyberchef",
"version": "5.18.1",
"version": "5.19.2",
"description": "The Cyber Swiss Army Knife for encryption, encoding, compression and data analysis.",
"author": "n1474335 <n1474335@gmail.com>",
"homepage": "https://gchq.github.io/CyberChef",
@@ -82,6 +82,7 @@
"lodash": "^4.17.4",
"moment": "^2.17.1",
"moment-timezone": "^0.5.11",
"otp": "^0.1.3",
"sladex-blowfish": "^0.8.1",
"sortablejs": "^1.5.1",
"split.js": "^1.2.0",
+2
View File
@@ -300,6 +300,8 @@ const Categories = [
"Detect File Type",
"Scan for Embedded Files",
"Generate UUID",
"Generate TOTP",
"Generate HOTP",
"Render Image",
"Remove EXIF",
"Extract EXIF",
+62 -1
View File
@@ -29,6 +29,7 @@ import MS from "../operations/MS.js";
import NetBIOS from "../operations/NetBIOS.js";
import Numberwang from "../operations/Numberwang.js";
import OS from "../operations/OS.js";
import OTP from "../operations/OTP.js";
import PublicKey from "../operations/PublicKey.js";
import Punycode from "../operations/Punycode.js";
import QuotedPrintable from "../operations/QuotedPrintable.js";
@@ -3635,7 +3636,67 @@ const OperationConfig = {
}
]
},
"Generate TOTP": {
description: "The Time-based One-Time Password algorithm (TOTP) is an algorithm that computes a one-time password from a shared secret key and the current time. It has been adopted as Internet Engineering Task Force standard RFC 6238, is the cornerstone of Initiative For Open Authentication (OATH), and is used in a number of two-factor authentication systems. A TOTP is an HOTP where the counter is the current time.<br><br>Enter the secret as the input or leave it blank for a random secret to be generated. T0 and T1 are in seconds.",
run: OTP.runTOTP,
inputType: "byteArray",
outputType: "string",
args: [
{
name: "Name",
type: "string",
value: ""
},
{
name: "Key size",
type: "number",
value: 32
},
{
name: "Code length",
type: "number",
value: 6
},
{
name: "Epoch offset (T0)",
type: "number",
value: 0
},
{
name: "Interval (T1)",
type: "number",
value: 30
}
]
},
"Generate HOTP": {
description: "The HMAC-based One-Time Password algorithm (HOTP) is an algorithm that computes a one-time password from a shared secret key and an incrementing counter. It has been adopted as Internet Engineering Task Force standard RFC 4226, is the cornerstone of Initiative For Open Authentication (OATH), and is used in a number of two-factor authentication systems.<br><br>Enter the secret as the input or leave it blank for a random secret to be generated.",
run: OTP.runHOTP,
inputType: "string",
outputType: "string",
args: [
{
name: "Name",
type: "string",
value: ""
},
{
name: "Key size",
type: "number",
value: 32
},
{
name: "Code length",
type: "number",
value: 6
},
{
name: "Counter",
type: "number",
value: 0
}
]
},
};
export default OperationConfig;
+55
View File
@@ -0,0 +1,55 @@
import otp from "otp";
import Base64 from "./Base64.js";
/**
* One-Time Password operations.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2017
* @license Apache-2.0
*
* @namespace
*/
const OTP = {
/**
* Generate TOTP operation.
*
* @param {byteArray} input
* @param {Object[]} args
* @returns {string}
*/
runTOTP: function(input, args) {
const otpObj = otp({
name: args[0],
keySize: args[1],
codeLength: args[2],
secret: Base64.runTo32(input, []),
epoch: args[3],
timeSlice: args[4]
});
return `URI: ${otpObj.totpURL}\n\nPassword: ${otpObj.totp()}`;
},
/**
* Generate HOTP operation.
*
* @param {byteArray} input
* @param {Object[]} args
* @returns {string}
*/
runHOTP: function(input, args) {
const otpObj = otp({
name: args[0],
keySize: args[1],
codeLength: args[2],
secret: Base64.runTo32(input, []),
});
const counter = args[3];
return `URI: ${otpObj.hotpURL}\n\nPassword: ${otpObj.hotp(counter)}`;
},
};
export default OTP;