SubtleCrypto deriveBits for PBKDF2

Abierto
#345 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
c, javascript
Área
api, security

Línea de trabajo

Start by reading the existing crypto.subtle.importKey implementation and the proposed CryptoAlgorithmDeriveBits base class to understand how crypto operations are wired through the runtime. Implement the scoped PBKDF2 import and deriveBits support, including the specified PRFs and length coercion; done means PBKDF2 keys can be used with deriveBits and deriveKey usages are accepted as stated.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

crypto.subtle.deriveBits with PBKDF2 is needed by Fastly Compute apps that do key derivation for cookie/token schemes. A concrete example: the HUMAN Security (PerimeterX) _px3 cookie flow requires PBKDF2-HMAC-SHA256 (hundreds to thousands of iterations, 384 derived bits split into a 32-byte AES-256 key and 16-byte IV) followed by AES-256-CBC decryption. Without native PBKDF2, a JS implementation costs roughly ~45 ms per request versus ~1 ms natively, which is significant inside a Fastly Compute request handler.

Scope for the first increment:

  • crypto.subtle.importKey("raw", keyData, "PBKDF2", extractable, usages) producing a secret CryptoKey usable for deriveBits/deriveKey (usages restricted to those two).
  • crypto.subtle.deriveBits(algorithm, baseKey, length) wired through a CryptoAlgorithmDeriveBits base class, with the PBKDF2 operation implemented via OpenSSL PKCS5_PBKDF2_HMAC and the optional [EnforceRange] unsigned long length coercion semantics from the spec.
  • SHA-1 / SHA-256 / SHA-384 / SHA-512 PRFs.

Follow-on work (not part of the first PR): deriveKey for PBKDF2, AES-CBC encrypt/decrypt to complete the _px3 flow, and the remaining HKDF/ECDH deriveBits algorithms.

Lenguaje dominante
C
Estrellas
295
Forks
62
Merge medio
1 d 17 h
PR fusionados (30 d)
16

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de bytecodealliance/StarlingMonkey

Todos los issues de bytecodealliance/StarlingMonkey

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.