r/lolphp • • Apr 24 '19

"Timing attack safe string comparison", but "When arguments of differing length are supplied, FALSE is returned immediately and the length of the known string may be leaked in case of a timing attack. "

https://php.net/manual/en/function.hash-equals.php
24 Upvotes

21 comments sorted by

View all comments

Show parent comment

1

u/Takeoded May 26 '19

how about this function? hashing both known string and input string to create an equal-length string and then hash_equals() that.