Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct setting for algorithm #207

Open
sidlr opened this issue Dec 17, 2020 · 5 comments
Open

Correct setting for algorithm #207

sidlr opened this issue Dec 17, 2020 · 5 comments

Comments

@sidlr
Copy link

sidlr commented Dec 17, 2020

Hello,

Thanks for that great plugin - i have been using it for a while and it always worked for me.

Now I should add a OTP with sha256 as algorithm, but can't find any documentation how to do it. According to the source code, sha1, sha256 and sha512 are supported, but e.g. in the setup dialog, there is no option for selecting the algorithm.

I know, that '30;6' in the TOTP Settings stands for 30s & 6 digit. Tried there various thing to set the algorithm to sha256, but sometimes the settings were wrong or the generated key was still done by sha1.

Is that even possible at the moment or have I just overlooked it?

Thanks for the help.

@dannoe
Copy link
Contributor

dannoe commented Dec 17, 2020

Are you talking about this line?

private static string[] ValidAlgorithms = new[] { "SHA1", "SHA256", "SHA512" };

That's a class for a future improvement of the code and doesn't represent the current support of the different hashing algorithms.

It looks like we only support sha1 atm:

using (var hmac = new HMACSHA1(key, true))

But we would use your issue to track this improvement :)

@sidlr
Copy link
Author

sidlr commented Dec 17, 2020

But we would use your issue to track this improvement :)

Would be great - thanks!

@dannoe
Copy link
Contributor

dannoe commented May 11, 2021

@sidlr I found out that KeePass itself provides different algorithms for generating TOTP codes. Even the sha256
see here: https://keepass.info/help/base/placeholders.html#otp

@sidlr
Copy link
Author

sidlr commented May 14, 2021

@dannoe thanks for the tip! Got wrong codes for the credentials with sha256 at first, but with the latest version (4.48.1) it works.

@OmlineEditor
Copy link

you need to add an input field where you can select an algorithm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants