[DiscordArchive] did u mark v1 as deprecated or so too?
[DiscordArchive] did u mark v1 as deprecated or so too?
Archived author: Fabian • Posted: 2024-01-02T16:15:52.529000+00:00
Original source
did u mark v1 as deprecated or so too?
Archived author: ZaDarkSide • Posted: 2024-01-02T16:15:55.348000+00:00
Original source
```PHP
function CalculateSRP6Verifier($email, $password, $salt)
{
// algorithm constants
$g = gmp_init(2);
$N = gmp_init('86A7F6DEEB306CE519770FE37D556F29944132554DED0BD68205E27F3231FEF5A10108238A3150C59CAF7B0B6478691C13A6ACF5E1B5ADAFD4A943D4A21A142B800E8A55F8BFBAC700EB77A7235EE5A609E350EA9FC19F10D921C2FA832E4461B7125D38D254A0BE873DFC27858ACB3F8B9F258461E4373BC3A6C2A9634324AB', 16);
// calculate first then calculate the second hash; at last convert to integer (little-endian)
$h = gmp_import(hash('sha256', ($salt . hash('sha256', strtoupper($email. ':' . substr($password, 0, 16)), true), true), 1, GMP_LSW_FIRST);
// convert back to byte array, within a 128 pad; remember zeros go on the end in little-endian
return str_pad(gmp_export(gmp_powm($g, $h, $N), 1, GMP_LSW_FIRST), 128, chr(0), STR_PAD_RIGHT);
}
```
Archived author: Fabian • Posted: 2024-01-02T16:16:24.188000+00:00
Original source
I mean.. people shouldnt have many issues migrating their old php code. there is like no real difference besides the modulus and maybe g (when they sued really old stuff)
Archived author: ZaDarkSide • Posted: 2024-01-02T16:16:33.821000+00:00
Original source
updated this it also truncates the $password to 16
Archived author: Fabian • Posted: 2024-01-02T16:16:47.622000+00:00
Original source
update it to v2 instead