mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-26 17:56:15 -04:00
Merge pull request #1966 from exactlyaron/fix/generate-totp-issue-1964
Fix Generate TOTP & HOPT
This commit is contained in:
commit
95c6406d05
6 changed files with 5247 additions and 3267 deletions
|
@ -575,12 +575,11 @@ Top Drawer`, {
|
|||
}),
|
||||
|
||||
it("Generate HOTP", () => {
|
||||
const result = chef.generateHOTP("Cut The Mustard", {
|
||||
name: "colonel",
|
||||
const result = chef.generateHOTP("JBSWY3DPEHPK3PXP", {
|
||||
});
|
||||
const expected = `URI: otpauth://hotp/colonel?secret=IN2XIICUNBSSATLVON2GC4TE
|
||||
const expected = `URI: otpauth://hotp/?secret=JBSWY3DPEHPK3PXP&algorithm=SHA1&digits=6&counter=0
|
||||
|
||||
Password: 034148`;
|
||||
Password: 282760`;
|
||||
assert.strictEqual(result.toString(), expected);
|
||||
}),
|
||||
|
||||
|
|
|
@ -11,12 +11,12 @@ import TestRegister from "../../lib/TestRegister.mjs";
|
|||
TestRegister.addTests([
|
||||
{
|
||||
name: "Generate HOTP",
|
||||
input: "12345678901234567890",
|
||||
expectedOutput: "URI: otpauth://hotp/OTPAuthentication?secret=GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ\n\nPassword: 755224",
|
||||
input: "JBSWY3DPEHPK3PXP",
|
||||
expectedOutput: `URI: otpauth://hotp/?secret=JBSWY3DPEHPK3PXP&algorithm=SHA1&digits=6&counter=0\n\nPassword: 282760`,
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Generate HOTP",
|
||||
args: ["", 32, 6, 0],
|
||||
args: ["", 6, 0], // [Name, Code length, Counter]
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue