Skip to content

Write complete cryptographic primitives specification#9

Open
XiaoSaGe99 wants to merge 1 commit into
AnonVote:mainfrom
XiaoSaGe99:feat/crypto-spec
Open

Write complete cryptographic primitives specification#9
XiaoSaGe99 wants to merge 1 commit into
AnonVote:mainfrom
XiaoSaGe99:feat/crypto-spec

Conversation

@XiaoSaGe99

Copy link
Copy Markdown

Summary

This PR expands specs/crypto.md from basic parameter tables into a complete formal specification of the five AnonVote cryptographic primitives, covering security properties, failure modes, implementation references, and supporting documentation.

Changes

Per-primitive sections (5 primitives)

Each primitive now includes:

  • Algorithm and parameters (existing tables preserved)
  • Security property — formal description of the cryptographic guarantee (e.g., preimage resistance, IND-CCA2, unpredictability)
  • Failure modes table — each failure mode with consequence and severity rating (Critical/High/Medium/Low)
  • Implementation reference — annotated code snippet from AnonVote/js — src/crypto.ts

New sections

  • Dependency diagram — ASCII flow chart showing how the five primitives compose into the full vote lifecycle (eligibility → token issuance → vote casting → tallying)
  • Primitive dependency table — maps each primitive to its dependencies and caller
  • Key management — generation, storage, lifecycle stages, rotation procedure
  • Threat model — honest documentation of what is protected (6 items) and what is NOT protected (6 items, with recommended mitigations)

Design rationale notes

  • GCM vs CBC comparison table with explanation of why GCM was chosen
  • Why hashToken deliberately omits normalization (unlike hashIdentifier)
  • Why decryptVote must throw on auth tag failure rather than returning silently

Acceptance criteria met

  • specs/crypto.md covers all five primitives with algorithm, input/output format, security property, and failure modes
  • Key management section is included
  • Dependency diagram shows how primitives compose
  • Threat model honestly covers what is and is not protected
  • A technical reviewer who has not read any other AnonVote repo can understand the full crypto layer from this document alone

Closes #1

Expand specs/crypto.md from basic parameter tables to a full formal
specification covering all acceptance criteria:

For each of the 5 primitives:
- Algorithm and parameters
- Input format and constraints
- Output format and guarantees
- Security property being enforced (preimage resistance,
  unpredictability, IND-CCA2, authenticated decryption)
- Failure modes with severity ratings
- Implementation reference with code from AnonVote/js

Additional sections:
- Dependency diagram showing how primitives compose
- Primitive dependency table
- Key management section (generation, storage, lifecycle, rotation)
- Complete threat model (protected and NOT protected against)

Closes AnonVote#1
@Just-Bamford

Copy link
Copy Markdown
Contributor

@XiaoSaGe99 you know i didnt assign you to this issue right ? even if i merge this youre not getting the points

I can see your application on my dashboard so i dont know how to assign you

@XiaoSaGe99

Copy link
Copy Markdown
Author

Hi @Just-Bamford, thanks for the heads-up! I wasn't aware of the GrantFox workflow. Could you let me know how I can be properly assigned? I'm happy to follow whatever process you need — whether that's me claiming the issue through the GrantFox dashboard, or whatever works on your end. Please let me know and I'll take care of it right away.

@Just-Bamford

Copy link
Copy Markdown
Contributor

@XiaoSaGe99 I can see your application on the contributors app but I can't see it on my maintainer dashboard, I don't know its thats a bug or what. Maybe try applying to other issues on my repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Write the AnonVote cryptographic primitives spec

2 participants