Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Current working server #4

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
59 changes: 3 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,6 @@
# pesupy-chat
# Account System

The project aims to create an end-to-end encrypted chat platform that enables users to securely exchange text messages. It consists of a Server program, which runs on a network-connected computer, and a command-line Client application for users to connect, create accounts, and engage in secure chatting with other account holders on the server.
## with Session Token based Authentication

### Server Program
***

The Server is a socket server that accepts packets from the Client, performing various operations as requested, including account creation, login, and message transmission. Users interested in hosting their own server can execute this on their computer.

### Client Application

The Client program is a command-line interface that provides end-users with a straightforward experience. Upon execution, it displays a Sign Up/Login screen where users can create new accounts or log in to existing ones. Post-login, users can seamlessly communicate with others who have accounts on the server.

### Security Measures

Client messages are securely transmitted using end-to-end encryption, ensuring data confidentiality between the Client, Server, and recipients. Account credentials are also transported securely using the same encryption method to prevent unauthorized access to user accounts. Additionally, account credentials and chat backups are stored in an encrypted format within the Server's MySQL database, providing an extra layer of security.

## Explanation & Installation

### End-to-End Encryption

End-to-end encryption (E2EE) is a robust data encryption method that ensures only the sender and intended recipient can access the data. This is achieved through a pair of mathematically linked keys: a public key used for encryption and a private key used for decryption. E2EE ensures privacy and security by never storing private keys on third-party servers, preventing even service providers from decrypting messages.

### Server Setup

The server setup process involves the following steps:

1. Selection of a folder for server operation files.
2. Creation of MySQL schemas and tables.
3. Generation of an encryption keypair for secure traffic.
4. Password creation for server access protection.
5. Configuration of the network port for incoming connections.

Once set up, the server listens for connections, enabling users to sign up, log in, and send and receive messages.

### Key Pair Usage

To enhance security, this project employs an additional layer of end-to-end encryption, as it does not utilize SSL/TLS due to port restrictions and certificate complexities. This ensures absolute security during data transmission.

### Account Creation

Users can execute the Client program to connect to a hosted server. The account creation process involves entering basic information, such as full name, email (optional), username, and password. The server securely stores this data in its MySQL database and generates a chat encryption keypair for each user.

### Initiating a Chat

Once logged in, users access the main interface, where they can see their chats and start new conversations. They can enter the username of the person they want to chat with and engage in secure messaging. The Client uses SQLite for local data storage.

## Future Enhancements

The project's future enhancements may include:

- Development of a GUI-based Client for user-friendliness.
- Mobile platform Clients (e.g., Android).
- Support for formatted text and various message types (voice, image, video).
- Group chat and file sharing features with end-to-end encryption.
- Cross-server messaging for increased flexibility and security.

This open-source project empowers users to control their chat server's security and functionality while providing a user-friendly experience.

_README.md created by [Si6gma](https://github.com/Si6gma)_
40 changes: 0 additions & 40 deletions ascii_art.txt

This file was deleted.

99 changes: 66 additions & 33 deletions i18n.py
Original file line number Diff line number Diff line change
@@ -1,44 +1,77 @@
class firstrun():
prompt1 = "Could not determine server's "
class firstrun:
setting_not_found = "Could not determine server's {0}"
empty_config = "Server configuration is empty. Deleting..."
prompt2 = "Is this the first time you are running the server?"
ft_question = "Is this the first time you are running the server?"
config_not_found = "Configuration file not found!"
exec = "Server will now run its configuration process"
fix_missing = "Please enter the Server's"
welcome_message = "Welcome to PesuPy Chat Server Software!"
fix_missing = "Please enter the Server's {0}"
welcome_message = "Welcome to the Account System Demonstration Backend"
setup_server_dir = "Please enter the path to a folder where the server can store its files"
keypair_setup = "Setting up Server Keypair..."
initialize_db = "Setting up Databases for use..."
security = "For security reasons, enter server launch password again."
exit = "Server will now exit. Please run it again!"
class savedata():
gui = "Opening file chooser dialog..."
nogui = "Cannot open file chooser! Enter the path manually:"
error = "An error occurred"
write_error = "An error occurred while trying to write server files.\nPlease choose another path"
not_a_dir = "Please enter path to a folder!"
creating = "Folder not accessible."
input_writable = "Please enter a writeable folder path"
created = "Written Server files successfully."
created_new = "Created Server folder successfully."
data_exists = "Previous Installation Detected! Please delete the files or choose another folder."
class database():
host = 'Enter MySQL/MariaDB Server IP Address: '
port = 'Enter MySQL/MariaDB Server Port (leave blank for 3306): '
user = 'Enter Username of user with CREATE privilege: '
passwd = 'Enter Password of the user: '

class passwd():
explain = "\
\
"
input = "Enter the server's launch password: "
confirm = "Enter it again to confirm: "
retry = "Passwords do not match!"

class log():
class tags():
listenaddr = "Enter Server Listen Address: "
listenport = "Enter Server Listen Port: "


class savedata:
gui = "Opening file chooser dialog..."
nogui = "Cannot open file chooser! Enter the path manually:"
error = "An error occurred"
write_error = "An error occurred while trying to write server files.\nPlease choose another path"
not_a_dir = "Please enter path to a folder!"
creating = "Folder not accessible."
input_writable = "Please enter a writeable folder path"
created = "Written Server files successfully."
created_new = "Created Server folder successfully."
data_exists = "Previous Installation Detected! Please delete the files or choose another folder."


class database:
host = 'Enter MySQL/MariaDB Server IP Address: '
port = 'Enter MySQL/MariaDB Server Port (leave blank for 3306): '
user = 'Enter Username of user with CREATE privilege: '
passwd = 'Enter Password of the user: '
creds_not_found = "Could not find database credentials. Rerunning server configuration process"
de_cred_fail = "Error while decrypting database credentials. Check your password\n{}"


class password:
explain = "The server's 'Launch Password' is used to encrypt credentials.\n\
The server will not launch without it."
input = "Enter the server's launch password: "
confirm = "Enter it again to confirm: "
retry = "Passwords do not match!"


class log:
class tags:
info = '[INFO] '
warn = '[WARN] '
error = '[ERR] '
server_start = "Server starting from path {0}...."
debug = '[DEBUG] '

class conn:
attempt = "Remote {0} attempted connection"
init = "Remote {0} initiated connection with UUID: {1}"
disconnected = "Client {0} disconnected due to:\n\t{1}"
db_conn_success = "Connected to database {0}:{1}"
db_conn_err = "Could not connect to database: {}"

class db:
init_success = 'Created schemas successfully'
init_fail = 'Failed to create schemas: {}'

class packet:
pubkey_recv = "Received public key for {}"
signup_attempt = "Client {0} attempted SIGNUP with username '{1}'"
signup_success = "Account creation successful for '{}'."
token_gen = "Generated token for {}"
login_success = "User {0} logged in from {1}"
logout_success = "User {0} logged out from {1}"
captcha_gen = "Generated CAPTCHA for client {0} with code = {1}"
acc_delete = "Account deletion successful for '{}'."
server_start = "Server starting from path {0}...."
server_online = "Server Online!"
server_exit = "Goodbye!"
Binary file modified requirements.txt
Binary file not shown.
Loading