I use Aegis as my 2fa. Today on new token creation I observed that there’s hash function set to SHA-1, later checked all my tokens and the result is same type of encryption used for all. So I have edited all my tokens to SHA-256 as a result my totp doesn’t authenticate. Do I have to rescan my tokens for updating to SHA-256 or it doesn’t work like that?

Security: SHA-1 < SHA-256 < SHA-512

Speed: SHA-1 > SHA-256 > SHA-512

My doubts are: Why can’t we use SHA-256? Is it because TOTP requires less time so faster one(SHA-1) is chosen? Can we use SHA-256 for TOTPs?

  • RvTV95XBeo
    link
    fedilink
    arrow-up
    10
    ·
    6 months ago

    capture the generated codes and time of input in some way, then brute force hashes until they generate one that produces the correct codes at x time

    Given a TOTP key is usually at least 18 characters for a 6-digit code, having only one data point sticks you with something on the order of 10^28 possible keys for a given singular code (way more if case sensitive). You’d need to be regularly intercepting TOTP codes to brute force your way to the right key, and even then it’d only be valid for a single site. At that point it probably means you’ve fully compromised the connecting device or server, at which point, why do you even need the TOTP again?