agentleFS
dtsongdtsong/agentic-council/skills/cipher-protocol-analysis/SKILL.md

protocol-analysis

Skill0 starsChanged 6 months agoApache-2.0View on GitHub

Use when analyzing cryptographic protocol security by modeling state machines, enumerating transitions, and identifying desynchronization, replay, downgrade, and session binding vulnerabilities. Covers protocol handshakes, session management, and negotiation integrity. Do not use for implementation-level crypto review (use crypto-review) or post-quantum assessment (use pqc-readiness).

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No user-provided values are used in commands or file paths.

    line 38
  2. Distinctive:

    Document state variables maintained at each state (keys, nonces, sequence numbers)

    line 47
  3. Distinctive:

    Check that protocol sessions are properly bound:

    line 66
  4. Distinctive:

    All messages within a session are cryptographically bound to the session ID

    line 68

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Protocol Analysis

Purpose

Model cryptographic protocols as state machines, enumerate state transitions, and identify vulnerabilities including desynchronization, replay attacks, downgrade attacks, and session binding failures.

Scope Constraints

Reads protocol specifications, message sequence diagrams, and implementation source code. Does not modify files or execute code. Does not interact with live protocol endpoints or perform active testing.

Inputs

  • Protocol specification or implementation under analysis
  • Message sequence diagrams or protocol description
  • Participant roles and trust relationships
  • Security properties the protocol should provide (authentication, confidentiality, integrity, forward secrecy)
  • Deployment context (network model, adversary capabilities)

Input Sanitization

No user-provided values are used in commands or file paths. All inputs are treated as read-only analysis targets.

Procedure

Step 1: Model Protocol State Machine

Define the protocol as a state machine for each participant:

  • Enumerate all states (initial, waiting, authenticated, established, error, closed)
  • Define all valid transitions with triggering messages
  • Identify terminal states and error recovery paths
  • Document state variables maintained at each state (keys, nonces, sequence numbers)

Step 2: Enumerate State Transitions

For each state transition, document:

  • Triggering condition (message received, timeout, local event)
  • Validation checks performed before transition
  • State variables updated during transition
  • Messages sent as a result of transition
  • What happens on invalid input at this state

Step 3: Check for Desync and Replay

Analyze the protocol for synchronization vulnerabilities:

  • Replay: Can any message be replayed to cause a state transition? Are nonces/timestamps checked?
  • Desynchronization: Can an attacker cause participants to disagree on the current state?
  • Reordering: Is message ordering enforced? Can out-of-order messages cause incorrect state transitions?
  • Reflection: Can messages from one direction be reflected back to the sender?
  • Interleaving: Can messages from different sessions be mixed?

Step 4: Verify Session Binding

Check that protocol sessions are properly bound:

  • Session identifiers are unique and unpredictable
  • All messages within a session are cryptographically bound to the session ID
  • Channel binding prevents man-in-the-middle relay (TLS channel binding, etc.)
  • Session resumption does not weaken security properties
  • Concurrent sessions do not share mutable state

Step 5: Assess Downgrade Resistance

Analyze the protocol's resistance to version/algorithm downgrade:

  • Is the version/algorithm negotiation authenticated?
  • Can an attacker force a weaker cipher suite?
  • Is there a mechanism to prevent rollback to older protocol versions?
  • Are negotiation messages included in the session transcript hash?
  • Are there minimum security floor requirements that cannot be negotiated away?

Compaction resilience: If context was lost during a long session, re-read the Inputs section to reconstruct what system is being analyzed, then resume from the earliest incomplete step.

Output Format

Protocol State Machine

[Initial] ──ClientHello──→ [WaitServerHello]
                                    │
                          ServerHello│
                                    ▼
                           [WaitFinished]
                                    │
                             Finished│
                                    ▼
                            [Established]

State Transition Table

Current StateInputValidationNext StateOutputNotes
InitialClientHelloVersion checkWaitServerHello—Nonce generated
..................

Vulnerability Assessment

IDCategoryDescriptionSeverityRecommendation
P1ReplayServerHello lacks nonce bindingHighInclude client nonce in server response
...............

Security Properties Verification

  • Mutual authentication: [Verified/Failed/N/A]
  • Forward secrecy: [Verified/Failed/N/A]
  • Replay resistance: [Verified/Failed/N/A]
  • Downgrade resistance: [Verified/Failed/N/A]

Handoff

  • Hand off to crypto-review if cryptographic implementation issues are discovered during protocol analysis.
  • Hand off to prover/formal-spec if the protocol requires formal verification of state machine properties.

Quality Checks

  • Complete state machine modeled for all participants
  • All state transitions have explicit validation checks
  • Invalid input handling defined for every state
  • Replay resistance verified (nonce/timestamp checking)
  • Session binding verified (session ID, channel binding)
  • Downgrade resistance verified (authenticated negotiation)
  • Error states do not leak information or allow recovery to an insecure state

Evolution Notes

<!-- Observations appended after each use -->

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.