Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hashkit

Agentic-first hash computation and verification service. The agent IS the interface.

Compute MD5, SHA1, SHA224, SHA256, SHA384, SHA512 hashes. Verify data integrity. Generate HMAC signatures. Plain text API, agent-driven, single Go binary with JSON file storage.

Quick Start

# Build
make build

# Run (defaults to :7700)
./hashkit

# Compute a hash
curl -X POST http://localhost:7700/hash -d 'algorithm=sha256&input=hello'
# → algorithm=sha256 input=hello digest=2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824

# Verify a hash
curl -X POST http://localhost:7700/verify -d 'algorithm=sha256&input=hello&digest=2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824'
# → algorithm=sha256 input=hello expected=... computed=... match=true

# Compute HMAC
curl -X POST http://localhost:7700/hmac -d 'algorithm=sha256&key=secret&input=hello'
# → algorithm=sha256 key=secret input=hello digest=88aab3ede8d3adf94d26ab90a312bd23...

# List algorithms
curl http://localhost:7700/algorithms
# → md5, sha1, sha224, sha256, sha384, sha512

# Get help
curl http://localhost:7700/help

Auth Flow

# 1. Request OTP
curl -X POST http://localhost:7700/auth/request -d 'email=user@example.com'
# OTP is logged to stderr in dev mode

# 2. Verify OTP → get bearer token
curl -X POST http://localhost:7700/auth/verify -d 'email=user@example.com&code=123456'
# → token=tk_xxxxx

# 3. Use token for authenticated endpoints
curl -H "Authorization: Bearer tk_xxxxx" http://localhost:7700/hashes

API Reference

Public Endpoints

Method Path Description
GET /help Operating manual for agents
GET /.well-known/agent.md Same as /help
POST /auth/request Request OTP (email)
POST /auth/verify Verify OTP → bearer token (email, code)
POST /hash Compute hash (algorithm, input)
POST /verify Verify hash (algorithm, input, digest)
POST /hmac Compute HMAC (algorithm, key, input)
GET /algorithms List supported algorithms
POST /mcp MCP JSON-RPC 2.0 endpoint

Authenticated Endpoints

Method Path Description
POST /hashes Save hash (algorithm, input, workspace?)
GET /hashes List saved hashes (workspace?)
DELETE /hashes Delete saved hash (handle, workspace?)
POST /hmacs Save HMAC (algorithm, key, input, workspace?)
GET /hmacs List saved HMACs (workspace?)
DELETE /hmacs Delete saved HMAC (handle, workspace?)
POST /workspaces Create workspace (name, plan?)
GET /workspaces List workspaces
GET /audit View audit log (workspace?)

MCP Tools

  • compute_hash — Compute a hash digest
  • verify_hash — Verify a hash matches input
  • compute_hmac — Compute an HMAC signature
  • list_algorithms — List supported algorithms
  • save_hash — Save a hash with a short handle
  • list_hashes — List saved hashes

Configuration

Source Variable Flag Default
Listen address HASHKIT_ADDR -addr :7700
Data file HASHKIT_DATA -data hashkit-data.json
Token secret HASHKIT_SECRET -secret random

Config priority: defaults < env < flags.

Supported Algorithms

  • Hash: md5, sha1, sha224, sha256, sha384, sha512
  • HMAC: md5, sha1, sha256, sha512

Build

make build    # CGO_ENABLED=0, single binary
make test     # go test -race
make vet      # go vet

License

MIT

About

Agentic-first hash computation and verification service. Compute MD5, SHA1, SHA256, SHA512 hashes, verify data integrity, and generate HMAC signatures. Plain text API, agent-driven, single Go binary.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages