---
title: "สุ่มรหัสผ่าน (Password Generator) | iamthana"
description: "สุ่มรหัสผ่านด้วย crypto.getRandomValues เลือกความยาวและชนิดตัวอักษรได้ พร้อมแสดงเอนโทรปีเป็นบิต"
canonical_url: "https://iamthana.com/tools/password-generator"
meta:
  "og:description": "สุ่มรหัสผ่านด้วย crypto.getRandomValues เลือกความยาวและชนิดตัวอักษรได้ พร้อมแสดงเอนโทรปีเป็นบิต"
  "og:image": "https://iamthana.com/_og/s/o_509892c053a5583f.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "สุ่มรหัสผ่าน (Password Generator) | iamthana"
  "twitter:image": "https://iamthana.com/_og/s/o_509892c053a5583f.png"
---

> Index of every page on this site: [llms.txt](https://iamthana.com/llms.txt)

# **สุ่มรหัสผ่าน (Password Generator)**

สุ่มรหัสผ่านด้วย crypto.getRandomValues เลือกความยาวและชนิดตัวอักษรได้ พร้อมแสดงเอนโทรปีเป็นบิต

เอนโทรปี****103 บิต****ระดับดี

**ความยาว**

**จำนวนรหัสผ่าน**

## รหัสผ่านที่สร้าง

1. ••••••••••••••••

คำนวณจากชุดตัวอักษร 88 ตัว ความยาว 16 ตัว และถือว่าแต่ละตัวถูกสุ่มเท่ากันหมด ตัวเลขนี้หักส่วนที่หายไปจากเงื่อนไขให้มีครบทุกชนิดแล้ว

## **อ่านค่าเอนโทรปี**

เอนโทรปีคิดจากความยาวคูณ log2 ของจำนวนตัวอักษรในชุด หน่วยเป็นบิต เพิ่มทีละ 1 บิต จำนวนครั้งที่ต้องเดาก็เพิ่มเป็นสองเท่า

ระดับแบ่งตามบิต ต่ำกว่า 40 เป็นอ่อน 40 ถึง 79 พอใช้ 80 ถึง 111 ดี และ 112 ขึ้นไปแข็งแรง เกณฑ์ 112 อิงค่าต่ำสุดที่ NIST SP 800-57 ยอมรับสำหรับกุญแจเข้ารหัสถึงปี 2030 (หลังจากนั้นต้อง 128 บิต) ส่วน 80 บิตเป็นค่าที่ NIST ถือว่าไม่เพียงพอแล้ว จึงจัดไว้แค่ระดับดี เกณฑ์ 40 เว็บนี้ตั้งเอง

ค่านี้ใช้ได้กับรหัสผ่านที่สุ่มมาตรง ๆ เท่านั้น ถ้าแก้ด้วยมือ หรือเอาไปใช้ซ้ำกับหลายบริการ บิตที่แสดงก็บอกอะไรไม่ได้แล้ว

## **วิธีสุ่ม**

ตัวอักษรทุกตัวมาจาก crypto.getRandomValues ของเบราว์เซอร์ เครื่องมือขอเลขสุ่มจากเบราว์เซอร์ทีละ 32 บิต ถ้าเอามาหารเอาเศษตรง ๆ ตัวอักษรบางตัวจะออกบ่อยกว่าเล็กน้อย เครื่องมือนี้จึงทิ้งเลขที่เกินช่วงหารลงตัวแล้วสุ่มใหม่ (rejection sampling)

เมื่อเปิด "ให้มีครบทุกชนิดที่เลือก" เครื่องมือจะสุ่มทั้งรหัสใหม่จนกว่าจะมีครบ ตำแหน่งไหนก็ไม่ถูกบังคับให้เป็นชนิดใดโดยเฉพาะ แต่รหัสที่เป็นไปได้ลดลง บิตจึงน้อยลงเล็กน้อย

ตัวที่อ่านสับสนคือ 0 O o 1 l I | การตัดออกทำให้ชุดตัวอักษรเล็กลง บิตจึงลดลงด้วย

## **เครื่องมืออื่น ๆ**

- [Security**★ ใหม่ล่าสุด**

  hsts ........ OK

  csp ........ MISSING

  x-frame ..... OK

  referrer .... OK<h3>**HTTP Security Header Checker**</h3>

  ตรวจ HTTP Security Headers ของ URL หรือ header ที่วางเอง พร้อมค่าที่ OWASP แนะนำให้ตั้ง](https://iamthana.com/tools/http-security-header)
- [Security

  $2b$12$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy<h3>**BCrypt Hash Generator**</h3>

  สร้าง bcrypt hash จากรหัสผ่าน และตรวจว่ารหัสผ่านตรงกับ hash หรือไม่](https://iamthana.com/tools/bcrypt-generator)
- [Security

  eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV\_adQssw5c<h3>**JWT Decoder**</h3>

  ถอดรหัส JSON Web Token เพื่อดู Header, Payload และเวลาหมดอายุ โดยไม่ตรวจลายเซ็น](https://iamthana.com/tools/jwt-decoder)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://iamthana.com/#website","@type":"WebSite","inLanguage":"th-TH","name":"iamthana","url":"https://iamthana.com/","publisher":{"@id":"https://iamthana.com/#identity"},"workTranslation":[]},{"@id":"https://iamthana.com/tools/password-generator#webpage","@type":"WebPage","description":"สุ่มรหัสผ่านด้วย crypto.getRandomValues เลือกความยาวและชนิดตัวอักษรได้ พร้อมแสดงเอนโทรปีเป็นบิต","name":"สุ่มรหัสผ่าน (Password Generator)","url":"https://iamthana.com/tools/password-generator","breadcrumb":{"@id":"https://iamthana.com/tools/password-generator#breadcrumb"},"isPartOf":{"@id":"https://iamthana.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://iamthana.com/tools/password-generator"]}]},{"@id":"https://iamthana.com/#identity","@type":"Person","alternateName":"Thana Tingprasom","name":"iamthana","url":"https://iamthana.com","knowsAbout":["AI","SEO","Development","Homelab","Software Development","Python","Ubuntu","Docker"],"sameAs":["https://github.com/iamthana","https://www.linkedin.com/in/thana-tingprasom/","https://www.facebook.com/kttkook"]},{"@id":"https://iamthana.com/tools/password-generator#webapplication","@type":"WebApplication","applicationCategory":"UtilityApplication","applicationSubCategory":"Security","browserRequirements":"Requires JavaScript","description":"สุ่มรหัสผ่านด้วย crypto.getRandomValues เลือกความยาวและชนิดตัวอักษรได้ พร้อมแสดงเอนโทรปีเป็นบิต","inLanguage":"th-TH","isAccessibleForFree":true,"name":"สุ่มรหัสผ่าน (Password Generator)","operatingSystem":"Any","url":"https://iamthana.com/tools/password-generator","author":{"@id":"https://iamthana.com/#identity"},"offers":{"@type":"Offer","price":"0","priceCurrency":"THB"}},{"@id":"https://iamthana.com/tools/password-generator#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://iamthana.com","position":1},{"@type":"ListItem","name":"Tools","item":"https://iamthana.com/tools","position":2},{"@type":"ListItem","name":"สุ่มรหัสผ่าน (Password Generator)","position":3}]}]}
```

## Sitemap

See the full [sitemap](https://iamthana.com/sitemap.md) for all pages.
