ComputerCraft Forums

ComputerCraft => Programs => Topic started by: ProdbyShway on Nov 29, 2025, 10:30 AM

Title: 🔐 Ultimate CC:Tweaked Door Security Network
Post by: ProdbyShway on Nov 29, 2025, 10:30 AM
Ultimate Door Authentication & Security System (CC:Tweaked)

A Complete, Secure, Multi-Component Access Control Network for Your Base



I've spent the last couple weeks engineering a full-scale, enterprise-grade door authentication network in ComputerCraft / CC:Tweaked. The end result is a polished system that behaves like real-world access control: central server, door controllers, encrypted codes, remote admin, logs, lockdown mode, fobs, terminals — the works.
This isn't "a keypad with redstone."
This is an actual security infrastructure.
Below is the full breakdown of features, architecture, and how it all works.

SYSTEM OVERVIEW
The full system consists of five major components:
1. AUTH SERVER (Core Brain)
Computer w/ Wireless Modem
Features:
- Stores all door data
- Verifies PIN codes
- Sends "open" commands to controllers
- Handles remote admin logins
- Processes all admin commands
- Handles lockdown mode
- Maintains persistent audit logs
- Sends heartbeats to door controllers
- Automatically registers controllers if the server restarts
2. DOOR CONTROLLERS (Per-Door Redstone Units)
1 Computer w/ Wireless Modem (per door)
Features:
- Register themselves to the server with a door tag
- Listen for "open" events sent by the server
- Pulse redstone to unlock the door
- Re-register automatically if the server restarts
- Respond to heartbeat messages so the server knows they're online
3. KEYPAD COMPUTERS (Standalone Touchscreen Entry Terminals)
2 Computers w/ Wireless Modems per door + optional monitor (entry & exit)
Requires advanced computer for monitor
Features:
    - Display a touchscreen numeric keypad (auto-scaled layout)
    - Mask PIN entry (****)
    - Send PINs to the server using the "verify" request
    - Receive "granted/denied" from the server
    - Show visual feedback on the screen
    - Automatically reconnect to the server if it reboots
    - Require no local door data (secure — all logic server-side)
    - Behave identical to a real-world access panel
- Keypads are the primary entry method for regular users.
4. REMOTE ADMIN POCKET COMPUTER (Secure Admin Console)
Advanced Ender Pocket Computer
Features:
- Secure remote admin login (timestamp + signature)
- Encrypted session token
- Auto-timeout for inactive sessions
- Add/remove door PINs
- Create or delete doors
- Change door open durations
- Trigger lockdown ON/OFF remotely
- Remotely open any door
- View the system audit logs
- Screen clears on logout
5. DOOR FOB POCKET COMPUTER (Player Access Device)
Advanced Ender Pocket Computer
Features:
- Auto-discovers all door tags from the server
- User selects a door from the list
- User enters PIN
- Server returns access granted/denied
- Behaves exactly like a keypad


SECURITY FEATURES
Features:
- Admin PIN is securely hashed
- No plaintext PINs stored or logged
- Console and remote admin use session-based authentication
- Remote login is protected by HMAC-style timestamp signatures
- Logs redact sensitive info
- Lockdown mode blocks all access attempts
- Everything is centralized and authoritative
AUDIT LOGGING
Features:
The system stores up to 1000 log entries, including:
- pin_attempt
- pin_add / pin_del
- controller_register / unregister
- door_open
- remote_open
- lockdown_on / lockdown_off
- server_start
Logs can be viewed from:
- The admin console
- The remote admin pocket computer


TECHNICAL ARCHITECTURE
NETWORKING
- Uses Rednet with strict message types
- Controllers receive OPEN_EVENT packets
- Keypads and fobs receive VERIFY_RESULT packets
- Heartbeats run on a dedicated channel
- Server handles all messaging centrally
PERSISTENCE
- door_db.json (door tags, pins, open times)
- admin.json (hashed admin pin)
- door_logs.json (audit logs)
PARALLEL PROCESSING
The server uses parallel.waitForAny to run:
- Network handler
- Console handler
- Autosave
- Heartbeat loop
USE CASES
- Bank vaults
- Restricted laboratories
- Base entrances
- Private bunkers
- Police stations / RP servers
- Multi-floor secure buildings
- Armories and storage rooms
- Sci-fi airlocks or energy doors


WHY THIS SYSTEM IS SPECIAL
Compared to typical keypad scripts, this system includes:
- Central authentication server
- Distributed controllers
- Remote administration interface
- Lockdown mode
- Full audit logging
- Door fobs
- Session-based authentication
- Hashed PINs
- Automatic controller recovery
- Modular, extensible architecture
- Production-ready code quality
This works more like a real facility access network than a simple redstone build.


Use the pastebins included below
Advanced Computers with Modems
Auth Server (Brain): https://pastebin.com/8WF0ugwm
Door Controller: https://pastebin.com/vxvsBAyW
Keypad: https://pastebin.com/sPRatJEK
Advanced Pocket Computer with Modem
Pocket Admin (Remote Auth): https://pastebin.com/ZckYgwgw
Pocket Keypad: https://pastebin.com/MciCSwjj
Title: 🔐 Ultimate CC:Tweaked Door Security Network
Post by: BrisingrAerowing on Dec 07, 2025, 06:27 PM
This is cool. Something I'd like to see is support for More Peripherials magnetic cards as I want to use those in my bunker. That might require quite a bit of rework though.

EDIT: Made a door with this.

(https://camo.tmpim.com/62f4cffded62078c1bad14808222887d0c9e7d47/68747470733a2f2f692e6962622e636f2f33356b347773427a2f323032352d31322d30372d31342d31322d35392e706e67)