This is a small prototype security system for user registration and login, built in Julia.
argon2 tool (with fallback to PBKDF2-HMAC-SHA256 if missing)sqlite3 CLI)sid cookie), security headers, honeypot field, basic UA blockingUser data is stored locally in data/users.db (SQLite user database).
Audit events are written to data/audit.db.
sqlite3 (user DB + audit DB are written via the SQLite CLI)argon2 (Argon2id password hashing; otherwise PBKDF2-HMAC-SHA256 is used)qrencode (renders QR codes for TOTP setup; without it the page shows the secret and otpauth:// URL)/ home/register registration (password coach + CAPTCHA + PoW)/login login (CAPTCHA + PoW + adaptive risk controls)/mfa/setup enable/reset TOTP/mfa/verify verify TOTP during login/password/change password change (policy enforced)/login or /register redirects to /account.export JULIA_DEPOT_PATH="$PWD/.julia"julia --project=. -e 'using Pkg; Pkg.resolve(); Pkg.instantiate()'julia --project=. devserver.jlhttp://127.0.0.1:8080Least-privilege note: do not run as root; the app only needs to write to data/ and uses restrictive permissions (umask 077, data/ as 0700).
Dev note: devserver.jl reads .env and will create/update it with missing values (including APP_SERVER_SECRET, APP_PEPPER, and APP_PW_TAG_KEY) so local secrets stay stable across restarts.
APP_HOST / APP_PORT: bind address/port (defaults 127.0.0.1:8080)APP_SERVER_SECRET: required; used for signing short-lived tokensAPP_PEPPER: recommended; server-side pepper mixed into password hashingAPP_COOKIE_SECURE: set to 1 only behind HTTPS (adds cookie Secure and enables HSTS)APP_REQUIRE_MFA: 1 by defaultAPP_POW_BITS / APP_POW_LOGIN_BITS: PoW difficulty (registration/login)APP_MFA_SETUP_TOKEN_TTL_SECONDS / APP_MFA_VERIFY_TOKEN_TTL_SECONDS: signed token TTLs for MFA flowsAPP_LOG_REQUESTS / APP_AUDIT_STDOUT: request logging and audit stdout logging (enabled by devserver.jl)MFA is required by default (APP_REQUIRE_MFA=1).
/account)./mfa/verify and then to /account on successDev UX note: /mfa/verify includes a short-lived signed token in the query/form so verification can still proceed if the browser drops the session cookie during redirects.
src/Security.jl loads src/passwords/most-common-passwords.txt (≈100k entries) and penalizes those passwords heavily.
See requirements-julia.txt (for familiarity only). Julia installs from Project.toml.
devserver.jl – dev runner (instantiate + seed + run server)src/DevTools.jl – seeding utilitiessrc/Security.jl – hashing, password strength, captcha, PoW, TOTPsrc/Storage.jl – SQLite user DB (schema + users + honeywords + password history + rate limits)server.jl – web entry pointsrc/WebServer.jl – HTTP.jl web server routes and web security controlssrc/SecureRegApp.jl – package entrypoint
