Server

The Server was the initial plan for the project. It is a FastAPI server which makes the Tools available via a REST API. It also provides access to its own SQLite database system.

Endpoints

Endpoint

Function

/

root

/crypto/decrypt

decrypt

/crypto/encrypt

encrypt

/crypto/generateKey

generate_key

/crypto/hash

hash_string

/db/add

add_user

/db/connect

connect

/db/create

create_table

/db/delete

delete_user

/db/deleteall

delete_all_users

/db/get

get_user

/db/getall

get_all_users

/db/list

listTables

/db/update

update_user

/docs

swagger_ui_html

/docs/oauth2-redirect

swagger_ui_redirect

/openapi.json

openapi

/ping

ping

/redoc

redoc_html

Swagger UI

For a better visualization of the API, the Swagger UI is available at /docs.

GET /crypto/encrypt

Encrypt

Encrypts a string with a key.

Parameters:
  • text – The string to encrypt

  • key – [Optional] The key to encrypt with. If not provided, a new key will be generated.

Return:

A dictionary with the encrypted string and the key

Query Parameters:
  • text (string) – (Required)

  • key (string) –

Status Codes:
GET /crypto/decrypt

Decrypt

Decrypts a string with a key.

Parameters:
  • text – The string to decrypt

  • key – The key to decrypt with

Return:

A dictionary with the decrypted string

Query Parameters:
  • text (string) – (Required)

  • key (string) – (Required)

Status Codes:
GET /crypto/generateKey

Generate Key

Generates a key.

Return:

A dictionary with the generated key

Status Codes:
  • 200 OK – Successful Response

GET /crypto/hash

Hash String

Hashes a string.

Parameters:
  • text – The string to hash

  • mode – [Optional] The mode to hash with. Default is sha256

Return:

A dictionary with the hashed string

Query Parameters:
  • text (string) – (Required)

  • mode (string) –

Status Codes:
GET /db/connect

Connect

Status Codes:
  • 200 OK – Successful Response

GET /db/create

Create Table

Status Codes:
  • 200 OK – Successful Response

GET /db/list

Listtables

Status Codes:
  • 200 OK – Successful Response

PUT /db/add

Add User

Query Parameters:
  • username (string) – (Required)

  • password (string) – (Required)

Status Codes:
PATCH /db/update

Update User

Query Parameters:
  • username (string) – (Required)

  • password (string) – (Required)

Status Codes:
DELETE /db/delete

Delete User

Query Parameters:
  • username (string) – (Required)

Status Codes:
GET /db/get

Get User

Query Parameters:
  • username (string) – (Required)

Status Codes:
GET /db/getall

Get All Users

Status Codes:
  • 200 OK – Successful Response

DELETE /db/deleteall

Delete All Users

Query Parameters:
  • you_sure (boolean) –

Status Codes:
GET /ping

Ping

Returns a simple pong.

Return:

A simple pong

Status Codes:
  • 200 OK – Successful Response

GET /

Root

Returns all the routes.

Return:

All the routes

Status Codes:
  • 200 OK – Successful Response