wycheproof
Fungsinya
Skill ini memeriksa kode kripto terhadap kumpulan vektor uji publik yang mencakup serangan yang diketahui dan input yang rumit. Skill ini untuk developer dan auditor yang ingin memastikan pustaka menanganinya dengan benar.
Kapan dipakai
- βSaat Anda ingin menguji kode AES, RSA, ECDSA, atau ECDH terhadap kasus uji standar.
- βSaat Anda perlu memeriksa pustaka terhadap serangan yang diketahui dan kasus tepi.
- βSaat tes Wycheproof gagal dan Anda perlu memahami alasannya.
Link skill
https://github.com/trailofbits/skills/blob/main/plugins/testing-handbook-skills/skills/wycheproof/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βSaya ingin menjalankan implementasi ECDSA kami terhadap vektor uji Wycheproof dan melihat kasus mana yang gagal.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agen memuat vektor uji, mengelompokkannya berdasarkan ukuran kunci dan atribut lain, lalu memeriksa setiap hasil dengan flag lulus atau gagal yang diharapkan. Kegagalan didaftar bersama input penyebabnya.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
Pertanyaan umum
Apa itu vektor uji?
Itu adalah kumpulan nilai input dan output yang harus ditangani implementasi yang benar dengan cara yang sudah diketahui.
Algoritma apa saja yang dicakup?
Skill ini menyebut AES, RSA, ECDSA, ECDH, dan lainnya.
Bagaimana cara membaca kegagalan?
Skill ini menjelaskan cara membaca kegagalan agar Anda bisa mengetahui apa yang salah.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 8.0k
- Peringkat
- #12724
- Lisensi
- CC-BY-SA-4.0
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
audit-context-building
8.0kMembantu agent Anda mempelajari basis kode yang belum dikenal sebelum tinjauan keamanan, dengan memetakan apa yang diasumsikan, dijamin, dan bergantung pada setiap fungsi.
algorand-vulnerability-scanner
8.0kMembantu agent Anda memindai smart contract Algorand, yang ditulis dalam TEAL atau PyTeal, untuk 11 masalah keamanan umum seperti serangan rekeying dan biaya yang tidak diperiksa.
audit-prep-assistant
8.0kMembantu agent Anda menyiapkan basis kode untuk tinjauan keamanan dari luar, dengan analisis statis, cakupan tes, pembersihan kode mati, dan dokumentasi yang jelas.
cairo-vulnerability-scanner
8.0kMembantu agent Anda memindai smart contract Cairo di StarkNet untuk 6 masalah serius, termasuk overflow aritmetika, pesan lintas lapisan yang berisiko, dan replay tanda tangan.
Skill serupa
test-driven-development
311kMengajari agent Anda menulis tes yang gagal dulu, melihatnya gagal, lalu menulis kode terkecil yang lulus, sebelum membangun fitur atau perbaikan apa pun.
verification-before-completion
311kMengajari agent Anda menjalankan pemeriksaan nyata dan membaca keluarannya sebelum menyatakan tugas, perbaikan, atau build sudah selesai atau lulus.
migrate-to-shoehorn
310kMengganti type cast berisiko di file tes Anda dengan pustaka shoehorn, sehingga tes bisa memakai data parsial dan tetap lulus pemeriksaan tipe.