%%{init: {"theme": "base", "themeVariables": {"primaryColor": "#fabd2f", "primaryTextColor": "#282828", "primaryBorderColor": "#b57614", "lineColor": "#7c6f64", "secondaryColor": "#83a598", "tertiaryColor": "#b8bb26", "background": "#fbf1c7", "mainBkg": "#ebdbb2", "fontFamily": "Tahoma, sans-serif"}}}%% flowchart LR subgraph Era1["ยุค Plain Text / Unsafe Storage"] A["Plain Passwordรั่วแล้วใช้ได้ทันที"] end subgraph Era2["ยุค Fast Hash / Weak Hash"] B["MD5/SHA1เร็วเกินไปสำหรับ password"] C["Rainbow Tableเดาจากตารางสำเร็จรูป"] end subgraph Era3["ยุค Password Hash / Adaptive Hash"] D["Saltค่าสุ่มต่อ password"] E["bcrypt Costปรับความยากได้"] end A --> B --> C --> D --> E
%%{init: {"theme": "base", "themeVariables": {"primaryColor": "#fabd2f", "primaryTextColor": "#282828", "primaryBorderColor": "#b57614", "lineColor": "#7c6f64", "secondaryColor": "#83a598", "tertiaryColor": "#b8bb26", "background": "#fbf1c7", "mainBkg": "#ebdbb2", "fontFamily": "Tahoma, sans-serif"}}}%% flowchart TD A["Registerสมัครสมาชิก"] --> B["Plain Passwordรหัสผ่านที่กรอก"] B --> C["bcrypt.hashhash + salt"] C --> D["Store Hashเก็บ hash"] E["Loginเข้าสู่ระบบ"] --> F["bcrypt.compareเทียบ input กับ hash"] D --> F F --> G{"Valid?ถูกต้องไหม"} G -->|Yes| H["Login Successเข้าสู่ระบบสำเร็จ"] G -->|No| I["Rejectปฏิเสธ"]