Skip to main content

Helpful tools for building socket applications

Project description

Network Utils

Network utils is a library designed to help make writing socket programs easier. It has builtin methods for setting up hybrid encryption as well as initialing connections and sending files.

Message Terminal

The messsage terminal is a way of sending encrypted messages between the client and server. It has two initialization methods (for client and server) that sets up the encryption. The initialization methods will return None if there is no error.

For the client:

'''

s = #socket code not shown

s.connect((HOST, PORT))

mt = MessageTerminal(s)

mt.initializeAsClient()

mt.close()

'''

For the server:

'''

s = #socket code not shown

s.bind((HOST, PORT))

s.listen()

conn, addr = s.accept()

mt = MessageTerminal(conn)

mt.initializeAsServer()

mt.close()

'''

File Utilites

'''

extractFileBinary(filePath) #reads file binary

writeFileBinary(filePath, data) #write file binary

'''

Pre defined messages

Standard messages that are used for setting up the server, sending files, and errors. '''

#messages

CLOSE_CONN = "!CLOSE_CONN!"

MSG_RECIVED = "!MSG_RECIVED!"

CONN_REQ = "!CONN_REQ!"

CONN_COMF = "!CONN_COMF!"

PING = "!PING!"

PONG = "!PONG!"

SHARE_PUBLIC_KEY = "!SHARE_PUBLIC_KEY!"

SERVE_PUBLIC_KEY = "!SERVE_PUBLIC_KEY!"

START_SYMMETRIC = "!START_SYMMETRIC!"

SYMMETRIC_CONFIRMED = "!SYMMETRIC_CONFIRMED"

FILE_TRANSFER = "!FILE_TRANSFER!"

FILE_RECEIVED = "!FILE_RECEIVED!"

#errors

CONN_ERROR = "!CONN_ERROR!"

ENCRYPTION_ERROR = "!ENCRYPTION_ERROR!"

'''

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

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

Source Distribution

network_utils-1.0.tar.gz (2.8 kB view details)

Uploaded Source

File details

Details for the file network_utils-1.0.tar.gz.

File metadata

  • Download URL: network_utils-1.0.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.10

File hashes

Hashes for network_utils-1.0.tar.gz
Algorithm Hash digest
SHA256 c981be99a654604112b5fb0a77835c7b02195643776ca55cee743781fa07c628
MD5 04e5730c2e57664d9903d321b55a2f72
BLAKE2b-256 7dcbde4e3dab6c56481bb55d622bd4a5fad5a11efc211867564a03eef72e07a1

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