secure-registration

Secure Registration Prototype (Julia)

This is a small prototype security system for user registration and login, built in Julia.

Julia SQLite

Features (assignment minimum + secure design)

User data is stored locally in data/users.db (SQLite user database). Audit events are written to data/audit.db.

System dependencies

Pages

Run

  1. Ensure Julia is installed.
  2. Use a local Julia package depot (keeps packages out of global user depot):
    • export JULIA_DEPOT_PATH="$PWD/.julia"
  3. Install the packages
    • julia --project=. -e 'using Pkg; Pkg.resolve(); Pkg.instantiate()'
  4. Quick dev run (installs deps locally and runs the server):
    • julia --project=. devserver.jl
  5. Open:
    • http://127.0.0.1:8080

Least-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.

Configuration (env)

MFA (TOTP)

MFA is required by default (APP_REQUIRE_MFA=1).

Dev 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.

Common password list

src/Security.jl loads src/passwords/most-common-passwords.txt (≈100k entries) and penalizes those passwords heavily.

Requirements (Python-style)

See requirements-julia.txt (for familiarity only). Julia installs from Project.toml.

Files

Preview

Register

alt text

Login

alt text