Skip to content

Repository files navigation

Text Security

Simple API that authenticates users via login:password using SHA-512 crypt ($6$) and returns a decrypted access string.

How it works

  1. GET /<prefix>/login:password
  2. Server looks up the user in a JSON file
  3. Verifies the password against the stored SHA-512 crypt hash
  4. Decrypts the access field using the password (OpenSSL AES-256-CBC)
  5. Returns the decrypted access string as text/plain

JSON file format

{
  "users": [
    {
      "login": "ivan",
      "password": "$6$O0pY1wVZvyPo9g9L$...",
      "access": "U2FsdGVkX1+YNcwyHYyz..."
    }
  ]
}

Configuration

Variable Default Description
HOST 0.0.0.0 Listen address
PORT 8080 Listen port
PREFIX (required) URL path prefix
JSON_FILE data.json Path to JSON file

Build & run

go build -o server .
JSON_FILE=data/data.json PREFIX=/api ./server

Docker

docker compose up

Mount a volume with your data.json to /data/data.json.

About

WEB returns a decrypted access string

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages