How can OTP (one time password) be protected against brute force attacks?

2.1k views Asked by At

We have a feature in our application that ask for a six digit OTP before doing certain functions. It is sent via SMS and expiration is 5 mins. There has been an internal penetration test that exposed that this is vulnerable to brute-force attacks. What can we do programmatically to prevent this?

1

There are 1 answers

0
RK_15 On
  • Use a long text for OPT like 6-10 chars long. Which will provide a lot of combinations factorial(N). Which will be a very big number that no ordinary system can guess that OTP in 5 minutes.
  • Use not only numbers but also characters which can make your OTP more strong.