Saltar al contenido
uencoder

Implement rate limiting a prevent brute-force attacks

Rate limiting caps el número de requests per time window, preventing brute-force, credential stuffing, y DoS attacks. Aprender token bucket y sliding window algoritmos.

  1. 1

    Rate limiting restricts how many requests a client can make in a time window. Common algorithms: (1) Fixed window — simple but allows bursts at window boundaries; (2) Sliding window — smoother, tracks requests in a rolling window; (3) Token bucket — allows bursts up to a capacity, refills at a steady rate.

  2. 2
    Calculadora de hash →

    Hash the client identifier (IP, user ID, API key) to use as a rate limit key. Use SHA-256 to avoid storing raw IPs. The hash maps to a counter in a fast store (Redis, in-memory map).

  3. 3
    Generador de HMAC →

    Sign the rate limit state (count, window start) with an HMAC to prevent tampering. If using client-side rate limiting (e.g., JWT-based), the signed token prevents the client from resetting their own counter.

  4. 4

    For brute-force protection on login: limit to 5 attempts per 15 minutes per account, and 10 per IP. Use exponential backoff — each failed attempt increases the wait time. After 5 failures, lock the account and require email verification. For API rate limiting: 100 requests/minute for free tier, 1000 for paid. Return 429 Too Many Requests with a Retry-After header.

Preguntas frecuentes

Token bucket vs sliding window?
Token bucket allows controlled bursts (up to bucket capacity) then steady-state rate — good for APIs where occasional bursts are acceptable. Sliding window enforces a strict limit in any window — better for security-critical endpoints like login. Choose based on whether bursts are acceptable.
How do I handle distributed rate limiting?
Use a shared store (Redis, Memcached) so all servers see the same counters. For high throughput, use a sliding window with Lua scripting in Redis (atomic check-and-increment). For global rate limiting at the edge, use CDN features (Cloudflare, AWS WAF).

Flujos que resuelven esta tarea

Hash contenido y codificar como Base64
Calcular un hash de la entrada y codificar el resumen como Base64 para transporte compacto.
CANALIZACIÓN
Hash texto y verificar integridad
Calcular un hash del texto de entrada y compararlo con un hash esperado para verificar la integridad.
CANALIZACIÓN
Hash texto y verificar con suma CRC32
Calcular tanto un hash criptográfico SHA-256 como una suma de verificación CRC32 para verificación de integridad de datos.
CANALIZACIÓN
Firmar HMAC y luego codificar en Base64
Generar firma HMAC y luego codificar en Base64 para encabezados de autenticación de API.
CANALIZACIÓN
Firmar HMAC y verificar
Generar una firma HMAC para un mensaje y verificarla contra una firma esperada.
CANALIZACIÓN
Firmar HMAC una cadena de solicitud API
Generar una firma HMAC-SHA256 para un payload de solicitud para autenticar llamadas API.
CANALIZACIÓN
Hash MD5 y luego codificar en Base58
Calcular hash MD5 y luego codificar como Base58 para representación compacta.
CANALIZACIÓN
Comparación de velocidad multi-hash
Hash la entrada y comparar múltiples algoritmos de hash para comparar su velocidad y salida.
CANALIZACIÓN
Generar contraseña y hash
Generar una contraseña aleatoria y luego hash para almacenamiento seguro.
CANALIZACIÓN
Hash SHA3-256 con suma CRC32
Calcular hash SHA3-256 y luego suma CRC32 para verificación dual de integridad.
CANALIZACIÓN
Hash SHA-512 y luego Hex
Calcular hash SHA-512 y luego codificar como Hex para legibilidad.
CANALIZACIÓN
Invertir texto y hash
Invertir texto y luego calcular el hash SHA-256 del resultado invertido.
CANALIZACIÓN
Mezclar texto y hash
Mezclar texto y luego hash del resultado mezclado.
CANALIZACIÓN

Herramientas relacionadas