Skip to main content
Back to challenges

Cryptography · Programming

Timing Attack on Password

Advanced · 4/5
Paid planSpecialist rank required120 points on first solo solve

Challenge brief

A password check function has a timing side-channel. Write code to exploit it.

Vulnerable Comparison

def check_password(input_pwd, correct_pwd):
    for i in range(len(input_pwd)):
        if input_pwd[i] != correct_pwd[i]:
            return False
        time.sleep(0.01)  # Side channel!
    return len(input_pwd) == len(correct_pwd)

Measure timing to discover the password character by character.

Solo practice

Sign in to submit an answer and save your progress.

Sign in to practice