ハッシュ生成器

MD5、SHA-1、SHA-256、SHA-384、SHA-512ハッシュを生成します。

// about

ツールについて

ハッシュはテキストのデジタル指紋です。文字の長さに関わらず、固定長の文字列に変換します。MD5、SHA-1、SHA-256、SHA-512などのハッシュ値を生成できます。

使い方

  1. ハッシュ化したいテキストを入力します。
  2. アルゴリズム(SHA256やMD5など)を選択します。
  3. 「実行」を押して生成されたハッシュ値をコピーします。

このツールが使われる理由

  • 2つのデータが完全に同一であるかを確認できます。
  • よく使われるSHA-256やMD5アルゴリズムに対応しています。
  • 入力したテキストから即座にハッシュ値を計算します。

よくある質問 (FAQ)

ハッシュ値から元のテキストを復元できますか?

いいえ。ハッシュ関数は不可逆(一方通行)であるため、元の文章には戻せません。

SHA-256はどのような用途に使われますか?

セキュリティやデジタル署名、ファイルの改ざんチェックなどに広く利用されています。

MD5はパスワード保護に安全ですか?

MD5は高速なチェックに向いていますが、セキュリティ目的にはSHA-256が推奨されます。

ガイド · セキュリティ · 4分で読めます

ハッシュ関数をやさしく解説:MD5・SHA-1・SHA-256の違いと正しい使い方

ダウンロードのチェックサム、Gitのコミット ID、ブロックチェーンのアドレスはすべてハッシュ値です。このガイドでは、ハッシュと暗号化の違いと、用途ごとにどのアルゴリズムを選ぶべきかを説明します。

ハッシュ関数は、任意の長さの入力から固定長の短い値を作ります。これをハッシュ値またはダイジェストと呼びます。1単語でも数ギガバイトの動画でも、SHA-256の出力は常に256ビット、つまり16進数64文字です。

SHA-256("hello")  = 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
SHA-256("hello!") = ce06092fb948d9ffac7d1a376e404b26b7575bcc11ee05a4615fef4fec3a308b
MD5("hello")      = 5d41402abc4b2a76b9719d911017c592
良いハッシュ関数の3つの性質、MD5とSHA-1がセキュリティ用途で使われなくなった理由、ファイルの整合性確認やパスワード保存での正しいハッシュの使い方を解説します。
ガイドを読む →
AIで作る

このツールをAIで自作してみましょう

自分用のバージョンが必要なら、作業指示プロンプトをAIチャットに貼り付けるか、スキルファイルをAIコーディングエージェントに保存してください。私たちが開発時に整理した機能、例外、テストケースが含まれています。

プロンプトとスキルは英語で提供しています。AIツールはどの言語でもよく理解できます。

AI作業指示プロンプト

Claude、ChatGPT、GeminiなどのAIチャットにそのまま貼り付けてください。

You are an experienced full-stack web developer. Build a web tool called "ハッシュ生成器" that meets the requirements below.

## Goal

Build a tool that computes MD5, SHA-1, SHA-256 and SHA-512 hashes of text in one go.

## Core features

- Show several algorithms at once
- Output as lower/upper-case hex or Base64
- HMAC mode with a secret key
- Compare two hash values
- Copy button for each result

## Inputs

- Text to hash
- Output format and optional HMAC key

## Outputs

- Hash per algorithm
- Comparison result (match/mismatch)

## Edge cases and handling rules

- Hash the empty string correctly
- Explain that CRLF versus LF line endings change the hash
- Keep the UI responsive for large inputs
- Warn that MD5 and SHA-1 are unsuitable for security

## 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)

- SHA-256('hello') = 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
- MD5('hello') = 5d41402abc4b2a76b9719d911017c592
- 'Hello' and 'hello' produce different hashes

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.md)

Claude CodeなどのAIコーディングエージェントで .claude/skills/build-hash-generator/SKILL.md に保存すると、このツールを作る・直すたびに再利用できます。

---
name: build-hash-generator
description: Use when building or changing a ハッシュ生成器 tool. Build a tool that computes MD5, SHA-1, SHA-256 and SHA-512 hashes of text in one go.
---

# Build: ハッシュ生成器

## Goal

Build a tool that computes MD5, SHA-1, SHA-256 and SHA-512 hashes of text in one go.

## 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

- Show several algorithms at once
- Output as lower/upper-case hex or Base64
- HMAC mode with a secret key
- Compare two hash values
- Copy button for each result

## Inputs

- Text to hash
- Output format and optional HMAC key

## Outputs

- Hash per algorithm
- Comparison result (match/mismatch)

## Rules

- Hash the empty string correctly
- Explain that CRLF versus LF line endings change the hash
- Keep the UI responsive for large inputs
- Warn that MD5 and SHA-1 are unsuitable for security
- 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

- [ ] SHA-256('hello') = 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
- [ ] MD5('hello') = 5d41402abc4b2a76b9719d911017c592
- [ ] 'Hello' and 'hello' produce different hashes

AIに任せるときのコツ

  • 最初の行に使用技術(React、Vue、素のHTMLなど)を書くと、プロジェクトに合ったコードになります。
  • コードを受け取る前に、テストケースを実行して結果を見せるよう依頼しましょう。
  • 本物のパスワード、顧客データ、APIキーは入力せず、サンプル値を使ってください。