From 37f1678940e3da329a019092a32b4db50ad79183 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E1=9E=87=E1=9E=B6=E1=9E=84=E1=9E=8C=E1=9E=B8=E1=9E=93=20?=
=?UTF-8?q?=E1=9E=92=E1=9E=B8?=
<316307659+dda994179-beep@users.noreply.github.com>
Date: Thu, 20 Aug 2026 04:23:37 +0700
Subject: [PATCH 1/2] docs: add DIT Racing 2.2 PIN Security architecture
diagram
---
DIT_RACING_2.2_PIN_SECURITY.md | 123 +++++++++++++++++++++++++++++++++
1 file changed, 123 insertions(+)
create mode 100644 DIT_RACING_2.2_PIN_SECURITY.md
diff --git a/DIT_RACING_2.2_PIN_SECURITY.md b/DIT_RACING_2.2_PIN_SECURITY.md
new file mode 100644
index 000000000000..8521de579390
--- /dev/null
+++ b/DIT_RACING_2.2_PIN_SECURITY.md
@@ -0,0 +1,123 @@
+# DIT RACING 2.2 — PIN Security
+
+## User flow
+- First use: Settings → សុវត្ថិភាព → កំណត់ PIN.
+- On next app launch: PIN screen appears before protected content.
+- Settings can change or disable the PIN after current PIN verification.
+- Wrong PIN clears the field and shows an error.
+
+## Security
+The PIN is not stored as plain text; the app stores a SHA-256 digest.
+For stronger protection of sensitive stored data, Android recommends using
+the Android Keystore for encryption keys and cryptographic operations.
+
+## Architecture Overview
+
+```mermaid
+graph TD
+ User["👤 User"]
+ App["📱 DIT Racing App"]
+
+ subgraph AppLayers["Application Layers"]
+ UI["UI Layer
PIN Input Screen"]
+ Logic["Business Logic
PIN Verification"]
+ Storage["Data Layer
Local Storage"]
+ end
+
+ subgraph Security["🔒 Security Layer"]
+ Hash["SHA-256
Hashing"]
+ Keystore["Android Keystore
Encryption Keys"]
+ end
+
+ subgraph OnFirstLaunch["First Use Flow"]
+ Settings["Settings Page"]
+ Security_Menu["សុវត្ថិភាព Menu"]
+ SetPIN["កំណត់ PIN Dialog"]
+ end
+
+ subgraph OnNextLaunch["Subsequent Launches"]
+ PINCheck["PIN Verification Screen"]
+ Validate["Validate against stored
SHA-256 digest"]
+ ProtectedContent["Access Protected Content"]
+ Error["Show Error & Clear Field"]
+ end
+
+ User -->|Opens App| App
+ App -->|First Time| OnFirstLaunch
+ Settings -->|Navigate| Security_Menu
+ Security_Menu -->|Select| SetPIN
+ SetPIN -->|User enters PIN| Hash
+ Hash -->|SHA-256 digest| Keystore
+ Keystore -->|Store encrypted| Storage
+
+ App -->|Subsequent Launches| OnNextLaunch
+ PINCheck -->|User enters PIN| Validate
+ Validate -->|Match| ProtectedContent
+ Validate -->|No Match| Error
+ Error -->|Retry| PINCheck
+
+ Validate -->|Request encryption key| Keystore
+ Storage -.->|Retrieve encrypted digest| Validate
+
+ classDef security fill:#ff6b6b,stroke:#c92a2a,color:#fff
+ classDef ui fill:#4c6ef5,stroke:#364fc7,color:#fff
+ classDef storage fill:#ffd93d,stroke:#f59f00,color:#000
+ classDef flow fill:#51cf66,stroke:#2f9e44,color:#fff
+
+ class Hash,Keystore security
+ class UI,PINCheck,Error ui
+ class Storage storage
+ class OnFirstLaunch,OnNextLaunch flow
+```
+
+## System Components
+
+### UI Layer
+- **PIN Input Screen**: Secure input field for PIN entry
+- **Settings Navigation**: Access security settings
+- **Error Display**: Show feedback for incorrect PIN attempts
+
+### Business Logic
+- **PIN Verification**: Compare user input against stored digest
+- **First-time Setup**: Initialize PIN on first launch
+- **Settings Management**: Change or disable PIN with verification
+
+### Data Layer
+- **Local Storage**: Persists encrypted PIN digest
+- **Encrypted State**: Protects sensitive configuration
+
+### Security Layer
+- **SHA-256 Hashing**: One-way cryptographic hash of PIN
+- **Android Keystore**: Stores and manages encryption keys securely
+ - Hardware-backed when available
+ - Prevents key extraction
+ - OS-level protection
+
+## Security Flow
+
+1. **Initial PIN Setup**
+ - User enters PIN in Settings → សុវត្ថិភាព → កំណត់ PIN
+ - PIN is hashed using SHA-256
+ - Hash is encrypted using Android Keystore
+ - Encrypted digest stored in local storage
+
+2. **PIN Verification on Launch**
+ - PIN screen appears before protected content
+ - User enters PIN
+ - Input is hashed with SHA-256
+ - Compare against stored encrypted digest
+ - Match → Grant access | No match → Clear field and show error
+
+3. **PIN Management**
+ - Changing PIN requires current PIN verification first
+ - Disabling PIN requires verification
+ - Updates re-hash and re-encrypt using Keystore
+
+## Best Practices Implemented
+
+✅ PIN stored as SHA-256 digest (not plaintext)
+✅ Android Keystore for encryption key management
+✅ Error feedback without exposing sensitive details
+✅ Clear input field on failed attempts
+✅ Secure on-launch verification
+✅ Settings-based management with verification gate
From 74e35b7f652b9f0ed04f74bffca6a3e82cc441f6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E1=9E=87=E1=9E=B6=E1=9E=84=E1=9E=8C=E1=9E=B8=E1=9E=93=20?=
=?UTF-8?q?=E1=9E=92=E1=9E=B8?=
<316307659+dda994179-beep@users.noreply.github.com>
Date: Thu, 20 Aug 2026 05:28:24 +0700
Subject: [PATCH 2/2] Create Google
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
ហាងជួសជុលម៉ូតូ ឌីនធី 090833814 090804863
---
Google | 1 +
1 file changed, 1 insertion(+)
create mode 100644 Google
diff --git a/Google b/Google
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/Google
@@ -0,0 +1 @@
+