Skip to main content

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!"

'''

Release files for network-utils 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for network-utils 1.0
File Size Uploaded
network_utils-1.0.tar.gz 2.8 kB Details

Release files / network_utils-1.0.tar.gz

Download URL network_utils-1.0.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c981be99a654604112b5fb0a77835c7b02195643776ca55cee743781fa07c628
BLAKE2b-256 checksum
How to use checksums
7dcbde4e3dab6c56481bb55d622bd4a5fad5a11efc211867564a03eef72e07a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.10

Release history Release notifications | RSS feed

This release

1.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page