mirror of
https://github.com/gchq/CyberChef.git
synced 2024-11-02 06:01:02 +01:00
Changed HOTP inputType to byteArray
This commit is contained in:
parent
5d75f8636a
commit
f7e958e7a1
@ -3840,7 +3840,7 @@ const OperationConfig = {
|
||||
"Generate HOTP": {
|
||||
module: "Default",
|
||||
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.",
|
||||
inputType: "string",
|
||||
inputType: "byteArray",
|
||||
outputType: "string",
|
||||
args: [
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
import otp from "otp";
|
||||
import Base64 from "./Base64.js";
|
||||
import Utils from "../Utils.js";
|
||||
|
||||
|
||||
/**
|
||||
* One-Time Password operations.
|
||||
@ -25,7 +25,7 @@ const OTP = {
|
||||
name: args[0],
|
||||
keySize: args[1],
|
||||
codeLength: args[2],
|
||||
secret: Base64.runTo32(Utils.strToByteArray(input), []),
|
||||
secret: Base64.runTo32(input, []),
|
||||
epoch: args[3],
|
||||
timeSlice: args[4]
|
||||
});
|
||||
@ -45,7 +45,7 @@ const OTP = {
|
||||
name: args[0],
|
||||
keySize: args[1],
|
||||
codeLength: args[2],
|
||||
secret: Base64.runTo32(Utils.strToByteArray(input), []),
|
||||
secret: Base64.runTo32(input, []),
|
||||
});
|
||||
const counter = args[3];
|
||||
return `URI: ${otpObj.hotpURL}\n\nPassword: ${otpObj.hotp(counter)}`;
|
||||
|
Loading…
Reference in New Issue
Block a user