Skip to main content

An implementation of a WebSocket authentication scheme, unsecured ws://

Project description

sb_auth (SeqBuild Authenticator)

Work in progress

A WebSocket authentication schematic b/t two devices, both using the Seqbuild library.

Simple client-server layout. Authentication allows for file read/write operations to take place between the two devices.

NOTE
The current websocket implementation uses the unsecured ws:// protocol instead of the secured wss:// one. The development of this authenticator has not advanced into production-level mode.

This codebase works for local WiFi networks but otherwise, more code with third-party services must be used for secured communication.

Description

There are three perspectives for use:

  • local (server or client side): offline mode, used to modify read/write settings and delete bunk Comm Lang key files.
  • server: can serve an unspecified number of clients. Every authenticated client has read/write access to permitted files/folders.
  • client: can access one server at a time to read/write permitted files.

The procedure in which a client interacts with a server goes so:

  1. Client sends IP address and port number (default is 8765, variable<DEFAULT_PORT>), and connects to the server.
  2. Client inputs username. If server has no registered username, it sends client a new Comm Lang file key. This is a script, containing a primary generator pseudo-random number generator G, that can be executed by seqbuild's Comm Lang interpreter. Client stores this Comm Lang file key and sets the number of past iterations i_p to 0.
  3. Client is required to output q integers from generator G, q specified by the server and in the range of DEFAULT_SB_AUTH_KEYSIZE_RANGE, default set to [24,58], every time client prompts to read/write a file.
  4. When the number of past iterations i_p of G passes a number q2, specified by the server and in the range of DEFAULT_SB_AUTH_INDEX_RANGE, default set to [627,1450), server sends client a new Comm Lang file key.

Server does not require any user input. Client requires user to input IP address/port, as well as for read/write operations to permitted files.

On the server side, every username it has stored in its client directory is associated with a file for file+folder exclusions. These exclusions prohibit the client from read/write operations concerning them.

Default File Naming

  • Server Side:

    • username directory file is @ user_data/server_dir.
    • directory file stores Comm Lang key file names and generator index (number of past iterations) for every username.
    • directory file column layout is
      • username
      • Comm Lang key filepath
      • primary generator name
      • generator index
      • number of sessions key has been used
    • every username U has a Comm Lang file key @ user_data/commond_U.txt.
    • default permissions file is @ user_data/default_user_permissions.txt.
    • every username U has an exclusion file @ user_data/permissions_U.txt.
  • Client Side:

    • username directory file is @ user_data/client_dir.
    • column layout is virtually identical to that of server side.
    • every server of IP address I and port Q is assigned a Comm Lang key file.

The Identity Aspect

Websocket has the problem of authentication. If a username's Comm Lang file key for a
server is shared between > 1 devices, those devices can all access the server under
the same username.

For a server with a fixed IP address and port combination, a device can only access it
through one username, given how the file naming convention goes.

Technicals Behind the Generator Key

The program used to generator Comm Lang key files is seqbuild @
Seqbuild. Specifically, the Comm Lang file generator is @ the file face/easy_gen_struct.py. There may be instances where the key may be a generator such that two different devices output different sequences of integers. So the Comm Lang key file generator is not guaranteed to be stable.

Usage

Go into this directory, and run this script:

from sb_auth.exec import * 

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sb_auth-0.0.1.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sb_auth-0.0.1-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file sb_auth-0.0.1.tar.gz.

File metadata

  • Download URL: sb_auth-0.0.1.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for sb_auth-0.0.1.tar.gz
Algorithm Hash digest
SHA256 792933d42683e6e300b27261146bf92a71112e9a08cfac95518008be7fac54ad
MD5 c8b00088b13fb6eb99b0f0e3d18960ba
BLAKE2b-256 3e136f15c243ecf5b7f8d49d55bdb1b91dd49331b4d73c23ffb8d72032f5fc0a

See more details on using hashes here.

File details

Details for the file sb_auth-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: sb_auth-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for sb_auth-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0b7b0f16c733bba311111fb1d9179797b810f1c74e42bcc45b95e3fe190c7909
MD5 942e1e03052f149997a91b99205682a9
BLAKE2b-256 16dc5f8305d27cedbe365b1d22217a955e883f8e233a54118a79100c1a69f872

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page