def detectEavesdrop(key1, key2, errorRate):
    """Return True if Alice and Bob detect Eve's interference, False otherwise."""
    if len(key1) == 0 or len(key2) == 0:
        return True
    if len(key1) != len(key2):
        return True

    tolerance = errorRate * 1.2
    mismatch = sum([1 for k in range(len(key1)) if key1[k] != key2[k]])
    if abs((float(mismatch) / len(key1)) - errorRate) > tolerance:
        return True

    return False