Skip to content

Commit 9d99a6b

Browse files
committed
v2.0.0: AES-256-GCM transport, PIN lockout, HOTP, QR import/export, Astro website
Security: - AES-256-GCM replaces XOR for all web transport - PIN-encrypted device key via PBKDF2-HMAC-SHA256 - Persistent PIN lockout (5 attempts, survives reboots) - Secure memory wipe before deep sleep Features: - HOTP support (offline, no NTP required) - SHA1/SHA256/SHA512, 6/8 digits, 30s/60s periods - QR code import and export for TOTP keys - Password generator in web cabinet Website: - Astro static site with browser flasher, user guide, backup tools - GitHub Actions: auto-deploy site, auto-build firmware on tag push fix: serve firmware binaries from GitHub Pages with correct paths chore: force-add v2.0.0 firmware binaries (override .gitignore)
1 parent bd45374 commit 9d99a6b

87 files changed

Lines changed: 18081 additions & 4964 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy-site.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Deploy Website to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths:
7+
- 'website/**'
8+
- '.github/workflows/deploy-site.yml'
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
concurrency:
17+
group: pages
18+
cancel-in-progress: false
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Install, build, and upload
28+
uses: withastro/action@v3
29+
with:
30+
path: ./website
31+
node-version: 22
32+
33+
deploy:
34+
needs: build
35+
runs-on: ubuntu-latest
36+
environment:
37+
name: github-pages
38+
url: ${{ steps.deployment.outputs.page_url }}
39+
steps:
40+
- name: Deploy to GitHub Pages
41+
id: deployment
42+
uses: actions/deploy-pages@v4
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Build and Release Firmware
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
ref: master
19+
token: ${{ secrets.GITHUB_TOKEN }}
20+
21+
- name: Cache PlatformIO
22+
uses: actions/cache@v4
23+
with:
24+
path: ~/.platformio
25+
key: platformio-${{ hashFiles('platformio.ini') }}
26+
27+
- name: Set up Python
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: '3.11'
31+
32+
- name: Install PlatformIO and esptool
33+
run: pip install platformio esptool
34+
35+
- name: Build firmware
36+
run: pio run -e lilygo-t-display
37+
38+
- name: Merge binaries
39+
run: |
40+
esptool --chip esp32 merge-bin \
41+
-o merged-firmware.bin \
42+
--flash-mode dio \
43+
--flash-freq 40m \
44+
--flash-size 4MB \
45+
0x1000 .pio/build/lilygo-t-display/bootloader.bin \
46+
0x8000 .pio/build/lilygo-t-display/partitions.bin \
47+
0x10000 .pio/build/lilygo-t-display/firmware.bin
48+
49+
- name: Copy binaries to website
50+
run: |
51+
mkdir -p website/public/firmware
52+
cp .pio/build/lilygo-t-display/bootloader.bin website/public/firmware/bootloader.bin
53+
cp .pio/build/lilygo-t-display/partitions.bin website/public/firmware/partitions.bin
54+
cp .pio/build/lilygo-t-display/firmware.bin website/public/firmware/firmware.bin
55+
cp merged-firmware.bin website/public/firmware/merged-firmware.bin
56+
57+
- name: Update manifest version
58+
run: |
59+
TAG=${GITHUB_REF#refs/tags/}
60+
cat > website/public/firmware/manifest.json << EOF
61+
{
62+
"name": "SecureGen",
63+
"version": "${TAG}",
64+
"new_install_prompt_erase": true,
65+
"builds": [
66+
{
67+
"chipFamily": "ESP32",
68+
"parts": [
69+
{ "path": "/SecureGen/firmware/bootloader.bin", "offset": 4096 },
70+
{ "path": "/SecureGen/firmware/partitions.bin", "offset": 32768 },
71+
{ "path": "/SecureGen/firmware/firmware.bin", "offset": 65536 }
72+
]
73+
}
74+
]
75+
}
76+
EOF
77+
78+
- name: Commit firmware to repo
79+
run: |
80+
git config user.name "github-actions[bot]"
81+
git config user.email "github-actions[bot]@users.noreply.github.com"
82+
git add website/public/firmware/
83+
git commit -m "firmware: update binaries for ${GITHUB_REF#refs/tags/}"
84+
git push origin master
85+
86+
- name: Create GitHub Release
87+
uses: softprops/action-gh-release@v2
88+
with:
89+
files: |
90+
merged-firmware.bin
91+
.pio/build/lilygo-t-display/bootloader.bin
92+
.pio/build/lilygo-t-display/partitions.bin
93+
.pio/build/lilygo-t-display/firmware.bin

.gitignore

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
.env
99

1010
# ⚠️ SECURITY: Internal documentation - DO NOT PUBLISH
11-
SECURITY_INTERNAL.md
12-
docs/security/SECURITY_AUDIT_INTERNAL.md
1311

1412
# Private assets
1513
assets/archive(private)/
@@ -25,10 +23,20 @@ assets/archive(private)/
2523
Thumbs.db
2624

2725
# Build artifacts
26+
compile_commands.json
2827
*.bin
2928
*.elf
3029
*.map
3130

3231
# IDE specific
3332
.idea/
3433
*.iml
34+
.cache
35+
36+
# Website build artifacts
37+
website/node_modules/
38+
website/dist/
39+
website/.astro/
40+
41+
# Firmware binaries (never commit, always from Releases)
42+
website/public/firmware/*.bin

.vscode/settings.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{
2+
}

CHANGELOG.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Changelog
2+
3+
## [2.0.0] — March 2026
4+
5+
### Security
6+
- **AES-GCM transport encryption** — replaced XOR with AES-256-GCM for all web communications
7+
- **PIN-encrypted device key** — master key file is now encrypted with PIN + salt via PBKDF2-HMAC-SHA256 (AES-256-CBC)
8+
- **PBKDF2 iterations increased** to 25,000 (PIN unlock, login, export)
9+
- **Persistent PIN lockout** — failed attempt counter survives reboots; device locks permanently after 5 total attempts
10+
- **Secure memory wipe** before deep sleep — device key, TOTP secrets, passwords, and session keys zeroed from RAM
11+
12+
### Encryption & Key Management
13+
- Reworked encryption and decryption system for device key, passwords, and TOTP secrets
14+
- Added `decrypt_export.html` — offline HTML tool for decrypting exports, editing keys and passwords, and creating key files without the device
15+
16+
### TOTP / HOTP
17+
- **HOTP support** — counter-based codes work in Offline and AP modes, independent of internet or time sync
18+
- **Extended algorithm support** — SHA1 / SHA256 / SHA512, 6 and 8 digit codes, configurable period (30s / 60s)
19+
- **QR code import** — add TOTP keys by scanning a QR code (camera or file upload)
20+
- **QR code export** — display any TOTP key as QR code on the device screen and in the web interface
21+
- Hold both buttons on HOTP screen to force-refresh the current code
22+
23+
### Web Interface & API
24+
- Fixed broken import/export system
25+
- Reduced number of requests from ESP32 to web server — improved performance
26+
- Added password generation support in web cabinet
27+
28+
### Hardware & Stability
29+
- Fixed crashes on battery power when pressing buttons
30+
- Added QR code for WiFi connection in AP mode — scan to connect instantly
31+
- Captive portal support in AP mode and WiFi setup flow
32+
- Hold both buttons on PIN screen → deep sleep (shutdown)
33+
34+
### Logging
35+
- Debug logging disabled in production builds
36+
- Runtime log level configurable without reflashing — see [Logging System](docs/development/LOGGING_SYSTEM.md)
37+
38+
---
39+
40+
## Roadmap
41+
42+
See [README → Roadmap](README.md#-roadmap) for planned features.

0 commit comments

Comments
 (0)