Zum Inhalt springen
Skillpedia
Tests8.0k · #12724

wycheproof

Was er macht

Dieser Skill prüft Krypto-Code gegen eine öffentliche Sammlung von Testvektoren, die bekannte Angriffe und knifflige Eingaben enthalten. Er richtet sich an Entwickler und Auditoren, die bestätigen wollen, dass eine Bibliothek sie korrekt behandelt.

Wann du ihn nutzt

  • ✓Wenn du AES-, RSA-, ECDSA- oder ECDH-Code gegen Standardfälle testen willst.
  • ✓Wenn du eine Bibliothek gegen bekannte Angriffe und Grenzfälle prüfen musst.
  • ✓Wenn ein Wycheproof-Test fehlschlägt und du verstehen musst, warum.

Link zum Skill

https://github.com/trailofbits/skills/blob/main/plugins/testing-handbook-skills/skills/wycheproof/SKILL.md

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/trailofbits/skills/blob/main/plugins/testing-handbook-skills/skills/wycheproof/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Ich will unsere ECDSA-Implementierung gegen die Wycheproof-Testvektoren laufen lassen und sehen, welche Fälle fehlschlagen.”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Der Agent lädt die Testvektoren, gruppiert sie nach Schlüsselgröße und anderen Merkmalen und prüft jedes Ergebnis gegen das erwartete Bestanden- oder Durchgefallen-Kennzeichen. Fehlschläge werden mit der Eingabe aufgelistet, die sie verursacht hat.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von GitHub.

Wycheproof

Wycheproof is an extensive collection of test vectors designed to verify the correctness of cryptographic implementations and test against known attacks. Originally developed by Google, it is now a community-managed project where contributors can add test vectors for specific cryptographic constructions.

Background

Key Concepts

Concept Description
Test vector Input/output pair for validating crypto implementation correctness
Test group Collection of test vectors sharing attributes (key size, IV size, curve)
Result flag Indicates if test should pass (valid), fail (invalid), or is acceptable
Edge case testing Testing for known vulnerabilities and attack patterns

Why This Matters

Cryptographic implementations are notoriously difficult to get right. Even small bugs can:

  • Expose private keys
  • Allow signature forgery
  • Enable message decryption
  • Create consensus problems when different implementations accept/reject the same inputs

Wycheproof has found vulnerabilities in major libraries including OpenJDK's SHA1withDSA, Bouncy Castle's ECDHC, and the elliptic npm package.

When to Use

Apply Wycheproof when:

  • Testing cryptographic implementations (AES-GCM, ECDSA, ECDH, RSA, etc.)
  • Validating that crypto code handles edge cases correctly
  • Verifying implementations against known attack vectors
  • Setting up CI/CD for cryptographic libraries
  • Auditing third-party crypto code for correctness

Consider alternatives when:

  • Testing for timing side-channels (use constant-time testing tools instead)
  • Finding new unknown bugs (use fuzzing instead)
  • Testing custom/experimental cryptographic algorithms (Wycheproof only covers established algorithms)

Quick Reference

Scenario Recommended Approach Notes
AES-GCM implementation Use aes_gcm_test.json 316 test vectors across 44 test groups
ECDSA verification Use ecdsa_*_test.json for specific curves Tests signature malleability, DER encoding
ECDH key exchange Use ecdh_*_test.json Tests invalid curve attacks
RSA signatures Use rsa_*_test.json Tests padding oracle attacks
ChaCha20-Poly1305 Use chacha20_poly1305_test.json Tests AEAD implementation

Testing Workflow

Phase 1: Setup                 Phase 2: Parse Test Vectors
┌─────────────────┐          ┌─────────────────┐
│ Add Wycheproof  │    →     │ Load JSON file  │
│ as submodule    │          │ Filter by params│
└─────────────────┘          └─────────────────┘
         ↓                            ↓
Phase 4: CI Integration        Phase 3: Write Harness
┌─────────────────┐          ┌─────────────────┐
│ Auto-update     │    ←     │ Test valid &    │
│ test vectors    │          │ invalid cases   │
└─────────────────┘          └─────────────────┘

Repository Structure

The Wycheproof repository is organized as follows:

┣ 📜 README.md       : Project overview
┣ 📂 doc             : Documentation
┣ 📂 java            : Java JCE interface testing harness
┣ 📂 javascript      : JavaScript testing harness
┣ 📂 schemas         : Test vector schemas
┣ 📂 testvectors     : Test vectors
┗ 📂 testvectors_v1  : Updated test vectors (more detailed)

The essential folders are testvectors and testvectors_v1. While both contain similar files, testvectors_v1 includes more detailed information and is recommended for new integrations.

Supported Algorithms

Wycheproof provides test vectors for a wide range of cryptographic algorithms:

Category Algorithms
Symmetric Encryption AES-GCM, AES-EAX, ChaCha20-Poly1305
Signatures ECDSA, EdDSA, RSA-PSS, RSA-PKCS1
Key Exchange ECDH, X25519, X448
Hashing HMAC, HKDF
Curves secp256k1, secp256r1, secp384r1, secp521r1, ed25519, ed448

Test File Structure

Each JSON test file tests a specific cryptographic construction. All test files share common attributes:

"algorithm"         : The name of the algorithm tested
"schema"            : The JSON schema (found in schemas folder)
"generatorVersion"  : The version number
"numberOfTests"     : The total number of test vectors in this file
"header"            : Detailed description of test vectors
"notes"             : In-depth explanation of flags in test vectors
"testGroups"        : Array of one or multiple test groups

Test Groups

Te

Häufige Fragen

Was ist ein Testvektor?

Eine Sammlung von Eingabe- und Ausgabewerten, die eine korrekte Implementierung auf bekannte Weise verarbeiten muss.

Welche Algorithmen werden abgedeckt?

Der Skill nennt AES, RSA, ECDSA, ECDH und weitere.

Wie lese ich einen Fehlschlag?

Der Skill erklärt, wie man einen Fehlschlag liest, damit du erkennst, was schiefgelaufen ist.

Details

Originalbeschreibung des Autors

Validates cryptographic implementations against Project Wycheproof's test vectors, which encode known attacks and edge cases across AES, RSA, ECDSA, ECDH, and more. Covers loading test vectors, mapping result flags onto pass and fail expectations, and reading a failure. Use when testing a crypto implementation against known attacks, checking a library against standard test vectors, or investigating why two implementations disagree on the same input.

repo: trailofbits/skills

Beliebtheit

GitHub-Sterne
8.0k
Platz im Ranking
#12724
Lizenz
CC-BY-SA-4.0
Aktualisiert
2.11.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills