BSD-3-Clause licensed and maintained by Kazu Yamamoto
This version can be pinned in stack with:crypto-token-0.2.1@sha256:f909da34713f94b251a29c6588f0a47e81d576f255ad1b47000924aef4169a2f,1326

Module documentation for 0.2.1

Used by 2 packages in nightly-2026-10-28(full list with versions):

Encrypted tokens/tickets to keep state in the client side.

Changes

ChangeLog for crypto-token

0.2.1

  • tokenLifetime is exact. A token carries its issue time and is refused once older than tokenLifetime; before, it could expire up to one interval early.
  • A tokenLifetime shorter than interval, or spanning 65536 intervals or more, no longer makes every token operation divide by zero. spawnTokenManager throws an IOError for a non-positive interval.
  • The AES-GCM nonce is 96 bits, the length GCM is designed for, rather than 64.
  • The token header is encrypted rather than masked, so tokens no longer reveal how their counters relate.
  • The rotation thread survives a failed rotation, and its wait no longer overflows a 32-bit Int.
  • Tokens are 14 bytes longer: an 8-byte issue time and a 16-byte header instead of 10. Tokens never outlive the process that made them, so no token from an earlier version is affected.
  • The lower bound on base moves to 4.11, where GHC.Clock is.