Color scheme: Dark
You are here: start » en » Documentation » Post-Quantum Cryptography » WvdS Crypto Service overview » Reference » Windows JSON protocol

Windows JSON protocol

This page describes every request and response of the Windows form. The types in win/src/protocol.rs are authoritative.

Transport

  • The service listens on one or more named pipes; without a configuration, on \\.\pipe\wvds_crypto. For which pipes a configuration file opens, see Build features and configuration.
  • A request is exactly one line of UTF-8 JSON terminated by \n. The response is also one line. You can send any number of requests in sequence over one connection.
  • Binary data is Base64 per RFC 4648 with padding (=).
  • Several clients can be connected at the same time.

Common fields

Every request carries operation and request_id. You choose the request_id; the service echoes it unchanged.

Every response to a parseable request contains:

FieldTypeContent
idstringUUID the service assigns to the response
request_idstringfrom the request
timestampnumbertime of the response, milliseconds since 1970-01-01 UTC
successbooleantrue on success
errorobjectonly on failure: code, message, optionally details
duration_usnumberprocessing time in microseconds

If the line isn't valid JSON or a required field is missing, the service responds only with {"success":false,"error":{"code":"INVALID_REQUEST","message":"…"}}, without request_id.

Operations

operationRequest fieldsAdditional response fields
info–version, algorithms, status, uptime_seconds, requests_processed, keys_stored
keygenalgorithm, optional levelkey_id, algorithm, and public_key for key pairs
aes_encryptkey_id, plaintext, optional aadciphertext, nonce, tag, key_id
aes_decryptkey_id, ciphertext, nonce, tag, optional aadplaintext
ml_dsa_signkey_id, messagesignature, signature_size
ml_dsa_verifypublic_key, message, signature, levelvalid
ml_kem_encapsulatepublic_key, levelciphertext, shared_secret
ml_kem_decapsulatekey_id, ciphertextshared_secret
export_public_keykey_idpublic_key, algorithm
hkdfikm, length, optional salt, infoderived_key

Fields with binary content are Base64: plaintext, aad, ciphertext, nonce, tag, message, signature, public_key, shared_secret, ikm, salt, info, derived_key. key_id and length are numbers.

algorithm and level

PurposeAccepted values
keygen.algorithmAES-256-GCM, AES256, AES; ML-DSA, ML-DSA-44, ML-DSA-65, ML-DSA-87; ML-KEM, ML-KEM-512, ML-KEM-768, ML-KEM-1024 (case-insensitive)
level for ML-DSAML-DSA-44, ML-DSA-65, ML-DSA-87, ml-dsa-44 …, or just 44, 65, 87
level for ML-KEMML-KEM-512, ML-KEM-768, ML-KEM-1024, ml-kem-512 …, or just 512, 768, 1024

A keygen with ML-DSA or ML-KEM and no level generates ML-DSA-65 or ML-KEM-768. An unknown level results in UNSUPPORTED_ALGORITHM.

Notes on individual operations

  • aes_encrypt generates the nonce itself and returns it in the response. Store nonce and tag with the ciphertext; aes_decrypt needs both.
  • ml_dsa_verify reports an invalid signature as a success with "valid": false. Always check valid, not just success.
  • hkdf: The service treats a salt or info that isn't valid Base64 as empty. Validate the encoding before you send. The maximum output is 8160 bytes (255 × 32).

Example

Request:

{"operation":"keygen","request_id":"k1","algorithm":"ML-KEM","level":"ML-KEM-768"}

Response (shortened):

{"id":"5d1c…","request_id":"k1","timestamp":1760788800000,"success":true,"duration_us":412,"key_id":2741182583,"algorithm":"ML-KEM-768","public_key":"…"}
en/wiki/pqcrypt/svc/reference/windows-json-protocol.txt · Last modified: by Wolfgang van der Stille