Cryptography Fundamentals in Wikantik

Wikantik prioritizes the security of user data and system integrity through robust cryptographic practices. The core logic for these operations resides in the wikantik-util module within CryptoUtil.java.

Password Hashing

Wikantik uses salted password hashing to protect user credentials. When a user creates or updates a password, the system generates a random salt, combines it with the password, and hashes the result.

Supported Algorithms

The system supports two hashing formats, prefixed for identification:

  1. {bcrypt} (Current default): Used for new and re-hashed passwords. The work factor is 12 (DEFAULT_BCRYPT_COST), roughly 150 to 250 ms per hash on current hardware, and it is embedded in each stored hash, so raising it later affects only newly written hashes. Passwords longer than 72 bytes are truncated, as bcrypt does. A legacy hash is transparently re-hashed to bcrypt on the owner's next successful login.
  2. {SHA-256} (Legacy, still verifiable): Salted SHA-256, kept working so existing accounts migrate transparently rather than being locked out.

Salted SHA-1 ({SSHA}) and unsalted SHA-1 ({SHA}) are no longer supported — a stored value in either format never verifies, and it is left untouched (not migrated) on a failed attempt.

Storage Format

A bcrypt entry is stored as {bcrypt} followed by the standard $2a$ bcrypt string, which carries its own salt and cost. A legacy {SHA-256} entry is the Base64 encoding of the hash followed by the salt. The algorithm prefix lets CryptoUtil.verifySaltedPassword choose the matching verification logic.

Password policy

New passwords are checked by PasswordValidator, which follows NIST 800-63B: length rather than composition rules, plus a blocklist of common passwords. The settings are wikantik.password.minLength (default 8), wikantik.password.maxLength (default 128) and wikantik.password.blocklist.enabled (default true). Repeated failed logins are slowed per account by wikantik.login.throttling (default true).

API Key Management

Wikantik has its own bearer API keys and also holds credentials for a few external services.

Best Practices

Transport Security (TLS)

Wikantik is designed to run behind a TLS-terminating reverse proxy (like Nginx, Apache, or Cloudflare).

See Also


Cluster Hub: Wikantik Platform Development Hub: Architecture, MCP Protocols, and Agent Briefings (wikantik-development)