Stax
Tools

ตัวสร้างแฮช

สร้างแฮช SHA-1, SHA-256, SHA-384 และ SHA-512 ได้ทันที

Hash generator คืออะไร?

SHA-256 เทียบกับ SHA-512

การใช้ Hashing ในทางปฏิบัติ

Hash generator ใช้ฟังก์ชัน hash แบบ cryptographic กับข้อมูลนำเข้าและสร้างสตริง hex ความยาวคงที่ — ค่า hash ข้อมูลนำเข้าเดิมให้ผลลัพธ์เดิมเสมอ เปลี่ยนแม้แต่อักขระหนึ่งตัวและค่า hash จะเปลี่ยนอย่างสิ้นเชิง ทำให้เหมาะสำหรับการตรวจสอบความสมบูรณ์ของข้อมูลและการจัดเก็บรหัสผ่านอย่างปลอดภัย

SHA-256 สร้าง hash 256 บิต (64 อักขระ hex) SHA-512 สร้าง hash 512 บิต (128 อักขระ hex) ทั้งคู่ปลอดภัย SHA-256 ใช้กันแพร่หลายกว่าและเร็วกว่าเล็กน้อยบนระบบ 32 บิต SHA-512 มีระยะความปลอดภัยที่ใหญ่กว่าและเร็วกว่าบนระบบ 64 บิต

วิศวกรด้านความปลอดภัยตรวจสอบความสมบูรณ์ของซอฟต์แวร์ที่ดาวน์โหลดโดยเปรียบเทียบ SHA-256 hash กับ checksum ที่ผู้ผลิตเผยแพร่ ทีม DevOps รวม hash checks ใน CI/CD pipelines เพื่อตรวจจับการเปลี่ยนแปลงไฟล์ระหว่างขั้นตอน build นักพัฒนา backend สร้าง SHA-256 hashes เป็น ETags สำหรับ HTTP caching headers ระบบ Content addressable storage อย่าง Git, IPFS และ Docker ใช้ SHA-256 hashes เป็นตัวระบุเนื้อหา

เครื่องมือนี้ใช้ crypto.subtle.digest() — Web Crypto API ดั้งเดิมของเบราว์เซอร์ ใช้ได้กับเบราว์เซอร์สมัยใหม่ทุกตัว ฟังก์ชันทำงานแบบ asynchronous บน ArrayBuffer ของข้อมูลที่เข้ารหัส UTF-8 ผลลัพธ์เป็น byte array ดิบที่แปลงเป็นสตริง hexadecimal เนื่องจาก Web Crypto API อยู่ในเบราว์เซอร์แล้ว ไม่จำเป็นต้องใช้ไลบรารีภายนอกและข้อมูลไม่เคยออกจากอุปกรณ์ของคุณ

SHA-1 ถูกยกเลิกสำหรับลายเซ็นดิจิทัลและใบรับรองในปี 2017 หลังนักวิจัยแสดงให้เห็นการโจมตี collision ในทางปฏิบัติ อย่างไรก็ตาม ยังใช้ในบริบทที่ไม่ใช่ด้านความปลอดภัยที่ไม่ต้องการความต้านทาน collision: Git ใช้ SHA-1 สำหรับ object IDs อย่าใช้ SHA-1 สำหรับการ hash รหัสผ่าน ลายเซ็นดิจิทัล หรือการสร้างใบรับรอง

  • ความสมบูรณ์ของไฟล์: ดาวน์โหลดไฟล์และตรวจสอบว่า SHA-256 hash ตรงกับที่ผู้ผลิตเผยแพร่
  • การเก็บรหัสผ่าน: ไม่ควรเก็บรหัสผ่านธรรมดา — เก็บค่า hash (พร้อม salt) bcrypt และ Argon2 ดีกว่าสำหรับจุดประสงค์นี้
  • การยืนยันตัวตน API: HMAC-SHA256 ใช้เซ็น API requests ใน AWS, Stripe และ API สมัยใหม่ส่วนใหญ่

คำถามที่พบบ่อย

What is a cryptographic hash?
A hash function takes any input and produces a fixed-length string (the hash or digest). The same input always produces the same hash. Even a single character change produces a completely different hash. Hashes are one-way — you can't reverse a hash to get the original input.
Which algorithm should I use?
SHA-256 for most purposes — it's the current standard used in TLS, code signing, and password storage. SHA-512 offers more security at slightly more cost. SHA-1 is broken for security purposes (don't use for signatures or certificates) but still used for checksums and Git object IDs.
Is my data sent to a server?
No. This tool uses the browser's built-in Web Crypto API (crypto.subtle.digest). Your text is hashed locally and never leaves your device.
What is a hash used for?
Verifying file integrity (checksums), storing passwords securely (with a salt), digital signatures, data deduplication, and generating unique identifiers. SHA-256 is what Bitcoin uses to secure its blockchain.
Why no MD5?
MD5 is cryptographically broken — collisions (two different inputs producing the same hash) can be generated in seconds. We only include secure algorithms. If you need to verify an MD5 checksum from a third-party source, any terminal has md5sum built in.

เครื่องมือที่เกี่ยวข้อง