Testeur de chiffrement AES-256-GCM

Testez le chiffrement AES-256-GCM avec une phrase secrète et PBKDF2.

// about

À propos de cet outil

L’outil chiffre avec AES-256-GCM et dérive une clé avec PBKDF2-SHA-256. Il sert à apprendre et tester localement, pas à remplacer la gestion des clés en production.

Comment l’utiliser

  1. Saisissez le texte à chiffrer ou le résultat à déchiffrer.
  2. Saisissez la même phrase et choisissez Chiffrer ou Déchiffrer.
  3. Copiez le résultat sans réutiliser un secret de production.

Pourquoi utiliser cet outil

  • Testez AES sans envoyer le texte en clair.
  • Utilisez une phrase secrète et des itérations PBKDF2 réglables.
  • La sortie contient les informations nécessaires au déchiffrement.

Foire Aux Questions (FAQ)

Puis-je l’utiliser en production ?

Non. Utilisez une conception cryptographique vérifiée et un coffre de clés géré.

Guides · Sécurité · 8 min de lecture

Les fonctions de hachage simplement : MD5, SHA-1 ou SHA-256 et comment les utiliser

Sommes de contrôle de téléchargement, identifiants de commit Git et adresses de blockchain sont tous des valeurs de hachage. Ce guide explique en quoi le hachage diffère du chiffrement et quel algorithme choisir selon l'usage.

Une fonction de hachage prend une entrée de n'importe quelle longueur et produit une courte valeur de longueur fixe, appelée hachage ou empreinte. Que vous hachiez un mot ou une vidéo de plusieurs gigaoctets, SHA-256 produit toujours 256 bits, soit 64 caractères hexadécimaux.

SHA-256("hello")  = 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
SHA-256("hello!") = ce06092fb948d9ffac7d1a376e404b26b7575bcc11ee05a4615fef4fec3a308b
MD5("hello")      = 5d41402abc4b2a76b9719d911017c592
Les propriétés d'une bonne fonction de hachage, pourquoi MD5 et SHA-1 sont abandonnés, et bien hacher pour l'intégrité des fichiers et les mots de passe.
Lire le guide →
Le créer avec l'IA

Créez cet outil vous-même avec l'IA

Besoin de votre propre version ? Copiez le prompt dans un chat IA ou enregistrez le fichier de skill pour un agent de code IA. Ils décrivent les fonctionnalités, cas limites et tests que nous avons utilisés.

Le prompt et le skill sont fournis en anglais, que les outils d'IA comprennent parfaitement.

Prompt de consigne IA

Collez-le tel quel dans Claude, ChatGPT ou Gemini.

You are an experienced full-stack web developer. Build a web tool called "Testeur de chiffrement AES" that meets the requirements below.

## Goal

Build a tester that encrypts and decrypts text with AES-256-GCM using a password.

## Core features

- Encrypt and decrypt modes
- Derive the key from the password with PBKDF2 and a high iteration count
- Random salt and 12-byte IV for every encryption
- Output salt + IV + ciphertext as one Base64 string
- Copy result

## Inputs

- Plain text or Base64 ciphertext
- Password

## Outputs

- Base64 ciphertext or decrypted plain text
- Summary of algorithm and parameters

## Edge cases and handling rules

- Show 'authentication failed' for a wrong password or tampered ciphertext
- Reject empty passwords
- Explain that the same plain text encrypts differently each time
- Use the Web Crypto API so keys and text never leave the browser

## Implementation requirements

- Build it as a single page (HTML, CSS, JavaScript) that runs entirely in the browser, and never send the user's input to a server.
- Make the UI responsive and easy to use on mobile; label every input and keep everything keyboard accessible.
- Add a Copy button for results and show clear, friendly error messages for invalid input.
- Keep the core logic in functions separate from the UI so it can be unit-tested.

## Definition of done (test cases)

- Encrypt then decrypt with the same password returns the original
- Changing one character of the ciphertext makes decryption fail
- Encrypting the same input twice gives different output

First outline your implementation plan in at most five lines, then write the complete code, and finally explain how to check the test cases above.

Skill (SKILL.md)

Enregistrez-le sous .claude/skills/build-encryption-tester/SKILL.md pour qu'un agent comme Claude Code le réutilise à chaque modification de l'outil.

---
name: build-encryption-tester
description: Use when building or changing a Testeur de chiffrement AES tool. Build a tester that encrypts and decrypts text with AES-256-GCM using a password.
---

# Build: Testeur de chiffrement AES

## Goal

Build a tester that encrypts and decrypts text with AES-256-GCM using a password.

## Workflow

1. Review the required features, inputs and outputs below and ask about anything missing first.
2. Implement the core logic as pure functions separate from the UI.
3. Check the logic against the test cases in the verification list.
4. Build a responsive UI with an input form, a result area and a Copy button.
5. Reproduce each edge case listed under Rules and refine the error messages.

## Core features

- Encrypt and decrypt modes
- Derive the key from the password with PBKDF2 and a high iteration count
- Random salt and 12-byte IV for every encryption
- Output salt + IV + ciphertext as one Base64 string
- Copy result

## Inputs

- Plain text or Base64 ciphertext
- Password

## Outputs

- Base64 ciphertext or decrypted plain text
- Summary of algorithm and parameters

## Rules

- Show 'authentication failed' for a wrong password or tampered ciphertext
- Reject empty passwords
- Explain that the same plain text encrypts differently each time
- Use the Web Crypto API so keys and text never leave the browser
- Build it as a single page (HTML, CSS, JavaScript) that runs entirely in the browser, and never send the user's input to a server.

## Verification

- [ ] Encrypt then decrypt with the same password returns the original
- [ ] Changing one character of the ciphertext makes decryption fail
- [ ] Encrypting the same input twice gives different output

Conseils pour travailler avec l'IA

  • Indiquez votre stack (React, Vue, HTML pur…) dès la première ligne pour obtenir un code adapté.
  • Demandez à l'IA d'exécuter les tests listés et d'en montrer les résultats avant d'accepter le code.
  • Ne collez jamais de vrais secrets, données clients ou clés d'API ; utilisez des exemples.