gchq / gchq/CyberChef

Bug report: Generate TOTP needs From Base32

Open
#1,682 2 comments 3 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
35.8k
Forks
4.1k
Avg merge
2d 26m
Merged PRs (30d)
33

Description

**Describe the bug**
If I want to use the "Generate TOTP" and add the secret in the input it generates a TOTP password for another key. By searching the source code it seems like the input gets Base32 encoded before it is used. So it seems like it is changing the secret and therefor never be able to create the correct TOTP password without the use of "From Base32". As I want to use it for google authenticator it seems to be wrong for me.

**To Reproduce**
I generated examples using the demo CyberChef.

If you just use the "Generate TOTP" it converts the input secret to Base32 which changes it (see otpauth link in the result):
https://gchq.github.io/CyberChef/#recipe=Generate_TOTP('',32,6,0,30)&input=SkJTV1kzRFBFSFBLM1BYUA

How it should be in my eyes (see the otpauth link, it contains now the correct input secret):
https://gchq.github.io/CyberChef/#recipe=From_Base32('A-Z2-7%3D',true)Generate_TOTP('',32,6,0,30)&input=SkJTV1kzRFBFSFBLM1BYUA

**Expected behaviour**
Input secret should be used as TOTP secret and also be shown in the otpauth of the result.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.