From 2858f2cbeb8bce9f6ae8a0abe864a73810e85672 Mon Sep 17 00:00:00 2001
From: Dominik Fuhrmann <dominik.fuhrmann@devalchemy.de>
Date: Wed, 25 Dec 2024 20:48:54 +0100
Subject: [PATCH] new try

---
 new/client.py                                 | 182 ++++++++++++++++++
 new/generateKeys.py                           |  19 ++
 new/private.pem                               |  27 +++
 new/public.pem                                |   9 +
 new/server.py                                 | 161 ++++++++++++++++
 .../certificates}/ca-cert.pem                 |   0
 .../certificates}/ca-cert.srl                 |   0
 {certificates => old/certificates}/ca-key.pem |   0
 .../certificates}/server-cert.pem             |   0
 .../certificates}/server-key.pem              |   0
 {certificates => old/certificates}/server.csr |   0
 .../communicationScripts}/client.c            |   0
 .../communicationScripts}/client.py           |   0
 .../communicationScripts}/elias/client.c      |   0
 .../communicationScripts}/elias/client.py     |   0
 .../communicationScripts}/elias/server.c      |   0
 .../communicationScripts}/elias/server.py     |   0
 .../communicationScripts}/server.c            |   0
 .../communicationScripts}/server.py           |   0
 .../decryptionScripts}/aes-128bit.py          |   0
 .../decryptionScripts}/aes-256bit.py          |   0
 .../decryptionScripts}/blowfish-128bit.py     |   0
 .../decryptionScripts}/blowfish-64bit.py      |   0
 .../decryptionScripts}/rc4-64bit.py           |   0
 .../decryptionScripts}/rc4-8bit.py            |   0
 .../decryptionScripts}/twofish-128bit.py      |   0
 .../decryptionScripts}/twofish-256bit.py      |   0
 readme.md => old/readme.md                    |   0
 {setup => old/setup}/certificateCreation.sh   |   0
 old/setup/certificates/ca-cert.pem            |  24 +++
 old/setup/certificates/ca-cert.srl            |   1 +
 old/setup/certificates/ca-key.pem             |  28 +++
 old/setup/certificates/server-cert.pem        |  22 +++
 old/setup/certificates/server-key.pem         |  28 +++
 old/setup/certificates/server.csr             |  18 ++
 {setup => old/setup}/decryption.sh            |   0
 {setup => old/setup}/pythonInstallation.sh    |   0
 {setup => old/setup}/wolfsslInstallation.sh   |   0
 {testData => old/testData}/test.txt           |   0
 39 files changed, 519 insertions(+)
 create mode 100644 new/client.py
 create mode 100644 new/generateKeys.py
 create mode 100644 new/private.pem
 create mode 100644 new/public.pem
 create mode 100644 new/server.py
 rename {certificates => old/certificates}/ca-cert.pem (100%)
 rename {certificates => old/certificates}/ca-cert.srl (100%)
 rename {certificates => old/certificates}/ca-key.pem (100%)
 rename {certificates => old/certificates}/server-cert.pem (100%)
 rename {certificates => old/certificates}/server-key.pem (100%)
 rename {certificates => old/certificates}/server.csr (100%)
 rename {communicationScripts => old/communicationScripts}/client.c (100%)
 rename {communicationScripts => old/communicationScripts}/client.py (100%)
 rename {communicationScripts => old/communicationScripts}/elias/client.c (100%)
 rename {communicationScripts => old/communicationScripts}/elias/client.py (100%)
 rename {communicationScripts => old/communicationScripts}/elias/server.c (100%)
 rename {communicationScripts => old/communicationScripts}/elias/server.py (100%)
 rename {communicationScripts => old/communicationScripts}/server.c (100%)
 rename {communicationScripts => old/communicationScripts}/server.py (100%)
 rename {decryptionScripts => old/decryptionScripts}/aes-128bit.py (100%)
 rename {decryptionScripts => old/decryptionScripts}/aes-256bit.py (100%)
 rename {decryptionScripts => old/decryptionScripts}/blowfish-128bit.py (100%)
 rename {decryptionScripts => old/decryptionScripts}/blowfish-64bit.py (100%)
 rename {decryptionScripts => old/decryptionScripts}/rc4-64bit.py (100%)
 rename {decryptionScripts => old/decryptionScripts}/rc4-8bit.py (100%)
 rename {decryptionScripts => old/decryptionScripts}/twofish-128bit.py (100%)
 rename {decryptionScripts => old/decryptionScripts}/twofish-256bit.py (100%)
 rename readme.md => old/readme.md (100%)
 rename {setup => old/setup}/certificateCreation.sh (100%)
 mode change 100755 => 100644
 create mode 100644 old/setup/certificates/ca-cert.pem
 create mode 100644 old/setup/certificates/ca-cert.srl
 create mode 100644 old/setup/certificates/ca-key.pem
 create mode 100644 old/setup/certificates/server-cert.pem
 create mode 100644 old/setup/certificates/server-key.pem
 create mode 100644 old/setup/certificates/server.csr
 rename {setup => old/setup}/decryption.sh (100%)
 rename {setup => old/setup}/pythonInstallation.sh (100%)
 rename {setup => old/setup}/wolfsslInstallation.sh (100%)
 rename {testData => old/testData}/test.txt (100%)

diff --git a/new/client.py b/new/client.py
new file mode 100644
index 0000000..afd75b1
--- /dev/null
+++ b/new/client.py
@@ -0,0 +1,182 @@
+import socket
+import json
+import logging
+from colorlog import ColoredFormatter
+from Crypto.Cipher import DES, Blowfish, ARC4, PKCS1_OAEP
+from Crypto.PublicKey import RSA
+from Crypto.Util.Padding import pad
+from Crypto.Random import get_random_bytes
+import base64
+
+# Add USER INPUT logging to system
+USER_INPUT = 25
+logging.addLevelName(USER_INPUT, "USER INPUT")
+
+def user_input(msg, *args, **kwargs):
+    logging.log(USER_INPUT, msg, *args, **kwargs)
+
+# Configure colored logging
+log_formatter = ColoredFormatter(
+    "%(asctime)s - %(log_color)s%(levelname)-12s%(reset)s - %(message)s",
+    datefmt="%Y-%m-%d %H:%M:%S",
+    log_colors={
+        'DEBUG': 'cyan',
+        'INFO': 'green',
+        'WARNING': 'yellow',
+        'ERROR': 'red',
+        'CRITICAL': 'magenta',
+        'USER INPUT': 'blue',
+    }
+)
+
+# Show logs on terminal
+console_handler = logging.StreamHandler()
+console_handler.setFormatter(log_formatter)
+
+logging.basicConfig(level=logging.DEBUG, handlers=[console_handler])
+
+# Send data to server
+def send_message_to_server(host, port, algorithm, key, key_length, encrypted_message, encrypted_key):
+    data = {
+        'algorithm': algorithm,
+        'key_length': key_length,
+        'encrypted_key': encrypted_key,
+        'encrypted_message': encrypted_message
+    }
+    
+    # Start connection to server and send data
+    logging.info("Connecting to server...")
+    with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
+        try:
+            s.connect((host, port))
+            logging.info(f"Connected to server at {host}:{port}")
+            s.sendall(json.dumps(data).encode())
+            logging.info("Data sent to server.")
+        except Exception as e:
+            logging.error(f"Connection error: {e}")
+
+# Encrypt user message according to selected algorithm and key length
+def encrypt_message(algorithm, key, message):
+    logging.info(f"Starting encryption with algorithm: {algorithm}")
+    
+    if algorithm == 'DES':
+        cipher = DES.new(key, DES.MODE_CBC)
+        ciphertext = cipher.encrypt(pad(message.encode(), DES.block_size))
+        encrypted_message = base64.b64encode(cipher.iv + ciphertext).decode()
+        logging.info("DES encryption successful.")
+        return encrypted_message
+    
+    elif algorithm == 'Blowfish':
+        cipher = Blowfish.new(key, Blowfish.MODE_CBC)
+        ciphertext = cipher.encrypt(pad(message.encode(), Blowfish.block_size))
+        encrypted_message = base64.b64encode(cipher.iv + ciphertext).decode()
+        logging.info("Blowfish encryption successful.")
+        return encrypted_message
+    
+    elif algorithm == 'RC4':
+        cipher = ARC4.new(key)
+        ciphertext = cipher.encrypt(message.encode())
+        encrypted_message = base64.b64encode(ciphertext).decode()
+        logging.info("RC4 encryption successful.")
+        return encrypted_message
+    
+    else:
+        logging.error("Unsupported encryption algorithm.")
+        raise ValueError("Unsupported encryption algorithm")
+
+# Encrypt the key using RSA public key
+def encrypt_key_with_rsa(public_key, key):
+    cipher = PKCS1_OAEP.new(public_key)
+    encrypted_key = cipher.encrypt(key)
+    return base64.b64encode(encrypted_key).decode()
+
+# Load the RSA public key (for encrypting the symmetric key)
+def load_public_key():
+    with open('public.pem', 'rb') as public_file:
+        public_key = RSA.import_key(public_file.read())
+    return public_key
+
+def main():
+    host = 'localhost'
+    port = 12345
+    
+    # Load the public RSA key (for encrypting the symmetric key)
+    public_key = load_public_key()
+    
+    while True:
+        # User input for encryption settings
+        logging.info("Starting the client...")
+        
+        print("Choose encryption algorithm:")
+        print("1. DES")
+        print("2. Blowfish")
+        print("3. RC4")
+        
+        encryption_choice = int(input("Select: "))
+        
+        if encryption_choice == 1:
+            algorithm = 'DES'
+            key = get_random_bytes(8)
+            key_length = 64
+        
+        elif encryption_choice == 2:
+            algorithm = 'Blowfish'
+            print("Choose key length:")
+            print("1. 64-bit")
+            print("2. 128-bit")
+            key_length_choice = int(input("Select: "))
+            
+            if key_length_choice == 1:
+                key = get_random_bytes(8)
+                key_length = 64
+            elif key_length_choice == 2:
+                key = get_random_bytes(16)
+                key_length = 128
+            else:
+                logging.error("Invalid choice for key length.")
+                print("Invalid choice!")
+                continue
+            
+        elif encryption_choice == 3:
+            algorithm = 'RC4'
+            print("Choose key length:")
+            print("1. 64-bit")
+            print("2. 128-bit")
+            key_length_choice = int(input("Select: "))
+            
+            if key_length_choice == 1:
+                key = get_random_bytes(8)
+                key_length = 64
+            elif key_length_choice == 2:
+                key = get_random_bytes(16)
+                key_length = 128
+            else:
+                logging.error("Invalid choice for key length.")
+                print("Invalid choice!")
+                continue
+        
+        else:
+            logging.error("Invalid choice for encryption algorithm.")
+            print("Invalid choice!")
+            continue
+        
+        # Get user message
+        message = input("Message: ")
+        
+        logging.info(f"Selected: {algorithm}, Key length: {key_length}")
+        encrypted_message = encrypt_message(algorithm, key, message)
+        
+        # Encrypt the key with the RSA public key
+        encrypted_key = encrypt_key_with_rsa(public_key, key)
+        
+        # Send the data to the server
+        send_message_to_server(host, port, algorithm, key, key_length, encrypted_message, encrypted_key)
+        
+        # Connection open or closed
+        again = input("Do you want to send another message? (y/n): ").strip().lower()
+        if again != 'y':
+            logging.info("Exiting client...")
+            break
+
+if __name__ == '__main__':
+    main()
\ No newline at end of file
diff --git a/new/generateKeys.py b/new/generateKeys.py
new file mode 100644
index 0000000..015c5ab
--- /dev/null
+++ b/new/generateKeys.py
@@ -0,0 +1,19 @@
+from Crypto.PublicKey import RSA
+from Crypto.Random import get_random_bytes
+
+# Generiere RSA-Schlüssel und speichere sie
+def main():
+    private_key = RSA.generate(2048)
+    public_key = private_key.publickey()
+    
+    # Speichern der privaten und öffentlichen Schlüssel
+    with open('private.pem', 'wb') as private_file:
+        private_file.write(private_key.export_key())
+    
+    with open('public.pem', 'wb') as public_file:
+        public_file.write(public_key.export_key())
+        
+    print("RSA-Schlüssel wurden generiert und gespeichert.")
+
+if __name__ == '__main__':
+    main()
diff --git a/new/private.pem b/new/private.pem
new file mode 100644
index 0000000..44a3031
--- /dev/null
+++ b/new/private.pem
@@ -0,0 +1,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vdg8E/yap
+YomrZvrc6yYdbhaKgRkl5GP0p2/6qUCKe0OyUaUCgYByhIBg7EOSMc6diAVgp0Iw
+I7AHmTMbLVju/VvStxIadutCh68lezaMsyrXWuI2d4aeNib/JOvFqCgsBPsvfoKi
+96TeQ/JP+d+g/pnOvils7oVfFIO7LSb9Mp+XM52yc4egpTxL5SkqIT0iYnsVnHRH
+AQPEdryYsH6w9WDnMtkyCQKBgQCSgNzsRJeQwkl4ucQCIY8WnlRMzCW1O2v0Toum
+Vazx8LxwO7yp/sw+Hl5Wjb3e2vyiE1XC8QIeLp/qQfhmcV+bP/EFO8UiiEBImTAT
+FPXjvsuRLzQk3h0+eroR3ZMIaFsBobcN8sWYtW4Y2Fk8dc9v3QDxaVGoVb5zkSVr
+FYy1BQKBgQCT/MuEAW0G7auTJH9FHhI7HzagHIZPphQi5KGG6N0CnGiTV6J2idgO
+KEQQpcyKAEry6nTl3NjMDpnqOt2e8bOO3Yjtqrs6axQe6Kef/kwRFZhTF4dFXJcB
+Dk4xNAtPKoyzMrxMV1Xz64L5xl8G9VClsHDfRTH9glfqnOle+eUveg==
+-----END RSA PRIVATE KEY-----
\ No newline at end of file
diff --git a/new/public.pem b/new/public.pem
new file mode 100644
index 0000000..1094f76
--- /dev/null
+++ b/new/public.pem
@@ -0,0 +1,9 @@
+-----BEGIN PUBLIC KEY-----
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3rQBwcolop8zkonx/+Js
+yvWtMGBxdXBNRufBnc5nIF+pKjpcBTLTdlZx2K85Xj1Rz1waGOdf78oBECfeOb6c
+keLm86JliQlKS9vkEROuxfagO5jz2qW/BHuYIbxS0O9vdrShoC8tw+qci1pMsVu7
+IBLHMO+mJ3NLVCv9HL+fAYRntrpEyx+j9HdZqmyJRriWrHCjN1/dnJoUt5dABGXT
+Iny0BlUQJE5CrfP7oGb0fCvzO5MsSy5/W9rl2O8bZLbbNXJxDoWzsM87YLL7SqUw
+q2SDZpy6DPO+NW9S3tqplwoI+CqjtId5t9FbZ/eQJXSm2bCUAl8MMToUQp9385ew
+3wIDAQAB
+-----END PUBLIC KEY-----
\ No newline at end of file
diff --git a/new/server.py b/new/server.py
new file mode 100644
index 0000000..4a65146
--- /dev/null
+++ b/new/server.py
@@ -0,0 +1,161 @@
+import socket
+import json
+import logging
+from colorlog import ColoredFormatter
+from Crypto.Cipher import DES, Blowfish, ARC4, PKCS1_OAEP
+from Crypto.PublicKey import RSA
+from Crypto.Util.Padding import unpad
+import base64
+
+# Add USER INPUT logging to system
+USER_INPUT = 25
+logging.addLevelName(USER_INPUT, "USER INPUT")
+
+def user_input(msg, *args, **kwargs):
+    logging.log(USER_INPUT, msg, *args, **kwargs)
+
+# Configure colored logging
+log_formatter = ColoredFormatter(
+    "%(asctime)s - %(log_color)s%(levelname)-12s%(reset)s - %(message)s",
+    datefmt="%Y-%m-%d %H:%M:%S",
+    log_colors={
+        'DEBUG': 'cyan',
+        'INFO': 'green',
+        'WARNING': 'yellow',
+        'ERROR': 'red',
+        'CRITICAL': 'magenta',
+        'USER INPUT': 'blue',
+    }
+)
+
+# Show logs on terminal
+console_handler = logging.StreamHandler()
+console_handler.setFormatter(log_formatter)
+
+logging.basicConfig(level=logging.DEBUG, handlers=[console_handler])
+
+# Load RSA private key (for decrypting the symmetric key)
+def load_private_key():
+    with open('private.pem', 'rb') as private_file:
+        private_key = RSA.import_key(private_file.read())
+    return private_key
+
+# Load RSA public key (for encrypting the symmetric key)
+def load_public_key():
+    with open('public.pem', 'rb') as public_file:
+        public_key = RSA.import_key(public_file.read())
+    return public_key
+
+# Manage client connection
+def handle_client(conn, addr, private_key):
+    logging.info(f"Handling client {addr}")
+    
+    # Receive up to 1024 Bytes data from client
+    data = conn.recv(1024).decode()
+    logging.info(f"Received data from client {addr}.")
+    
+    # Manage received JSON data and extract information
+    try:
+        data = json.loads(data)
+        algorithm = data['algorithm']
+        key_length = data['key_length']
+        encrypted_key = base64.b64decode(data['encrypted_key'])
+        encrypted_message = data['encrypted_message']
+        logging.info(f"Algorithm: {algorithm}, Key Length: {key_length}")
+        user_input(f"Received data from client {addr}: Algorithm: {algorithm}, Key Length: {key_length}, Encrypted message: {encrypted_message}")
+    except json.JSONDecodeError as e:
+        logging.error(f"Error decoding data: {e}")
+        conn.close()
+        return
+    
+    # Decrypt the symmetric key using RSA
+    key = decrypt_symmetric_key(private_key, encrypted_key)
+    logging.info(f"Decrypted symmetric key from client {addr}.")
+    
+    # Decrypt the message using the symmetric key
+    decrypted_message = decrypt_message(algorithm, key, encrypted_message)
+    logging.info(f"Decrypted message from client {addr}: {decrypted_message}")
+    
+    # Respond to the client
+    response = {
+        "status": "success",
+        "decrypted_message": decrypted_message
+    }
+    conn.sendall(json.dumps(response).encode())
+    logging.info(f"Sent response to client {addr}")
+
+# Decrypt the symmetric key using RSA private key
+def decrypt_symmetric_key(private_key, encrypted_key):
+    cipher = PKCS1_OAEP.new(private_key)
+    key = cipher.decrypt(encrypted_key)
+    logging.info(f"Decrypted symmetric key: {key.hex()}")
+    return key
+
+# Decrypt received message using the symmetric key
+def decrypt_message(algorithm, key, encrypted_message):
+    logging.info(f"Starting decryption with algorithm: {algorithm}")
+    
+    # Transform received message into binaries
+    encrypted_message = base64.b64decode(encrypted_message)
+    logging.info(f"Encrypted message: {encrypted_message.hex()}")
+    
+    if algorithm == 'DES':
+        iv = encrypted_message[:8]
+        ciphertext = encrypted_message[8:]
+        logging.info(f"IV: {iv.hex()}, Ciphertext: {ciphertext.hex()}")
+        cipher = DES.new(key, DES.MODE_CBC, iv)
+        decrypted_message = unpad(cipher.decrypt(ciphertext), DES.block_size).decode()
+        logging.info("DES decryption successful.")
+        return decrypted_message
+    
+    elif algorithm == 'Blowfish':
+        iv = encrypted_message[:8]
+        ciphertext = encrypted_message[8:]
+        cipher = Blowfish.new(key, Blowfish.MODE_CBC, iv)
+        decrypted_message = unpad(cipher.decrypt(ciphertext), Blowfish.block_size).decode()
+        logging.info("Blowfish decryption successful.")
+        return decrypted_message
+    
+    elif algorithm == 'RC4':
+        cipher = ARC4.new(key)
+        decrypted_message = cipher.decrypt(encrypted_message).decode()
+        logging.info("RC4 decryption successful.")
+        return decrypted_message
+    
+    else:
+        logging.error("Unsupported algorithm.")
+        raise ValueError("Unsupported decryption algorithm")
+
+# Define server configuration
+def main():
+    host = 'localhost'
+    port = 12345
+    
+    # Load RSA private key
+    private_key = load_private_key()
+    
+    # Wait for incoming connections
+    logging.info("Starting server...")
+    
+    with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
+        try:
+            s.bind((host, port))
+            s.listen()
+            logging.info(f"Listening on {host}:{port}...")
+        except Exception as e:
+            logging.error(f"Server error: {e}")
+            return
+        
+        # Accept and close connection to client
+        while True:
+            try:
+                conn, addr = s.accept()
+                logging.info(f"Connection from {addr}")
+                handle_client(conn, addr, private_key)
+                conn.close()
+            except Exception as e:
+                logging.error(f"Error handling connection: {e}")
+                continue
+
+if __name__ == '__main__':
+    main()
diff --git a/certificates/ca-cert.pem b/old/certificates/ca-cert.pem
similarity index 100%
rename from certificates/ca-cert.pem
rename to old/certificates/ca-cert.pem
diff --git a/certificates/ca-cert.srl b/old/certificates/ca-cert.srl
similarity index 100%
rename from certificates/ca-cert.srl
rename to old/certificates/ca-cert.srl
diff --git a/certificates/ca-key.pem b/old/certificates/ca-key.pem
similarity index 100%
rename from certificates/ca-key.pem
rename to old/certificates/ca-key.pem
diff --git a/certificates/server-cert.pem b/old/certificates/server-cert.pem
similarity index 100%
rename from certificates/server-cert.pem
rename to old/certificates/server-cert.pem
diff --git a/certificates/server-key.pem b/old/certificates/server-key.pem
similarity index 100%
rename from certificates/server-key.pem
rename to old/certificates/server-key.pem
diff --git a/certificates/server.csr b/old/certificates/server.csr
similarity index 100%
rename from certificates/server.csr
rename to old/certificates/server.csr
diff --git a/communicationScripts/client.c b/old/communicationScripts/client.c
similarity index 100%
rename from communicationScripts/client.c
rename to old/communicationScripts/client.c
diff --git a/communicationScripts/client.py b/old/communicationScripts/client.py
similarity index 100%
rename from communicationScripts/client.py
rename to old/communicationScripts/client.py
diff --git a/communicationScripts/elias/client.c b/old/communicationScripts/elias/client.c
similarity index 100%
rename from communicationScripts/elias/client.c
rename to old/communicationScripts/elias/client.c
diff --git a/communicationScripts/elias/client.py b/old/communicationScripts/elias/client.py
similarity index 100%
rename from communicationScripts/elias/client.py
rename to old/communicationScripts/elias/client.py
diff --git a/communicationScripts/elias/server.c b/old/communicationScripts/elias/server.c
similarity index 100%
rename from communicationScripts/elias/server.c
rename to old/communicationScripts/elias/server.c
diff --git a/communicationScripts/elias/server.py b/old/communicationScripts/elias/server.py
similarity index 100%
rename from communicationScripts/elias/server.py
rename to old/communicationScripts/elias/server.py
diff --git a/communicationScripts/server.c b/old/communicationScripts/server.c
similarity index 100%
rename from communicationScripts/server.c
rename to old/communicationScripts/server.c
diff --git a/communicationScripts/server.py b/old/communicationScripts/server.py
similarity index 100%
rename from communicationScripts/server.py
rename to old/communicationScripts/server.py
diff --git a/decryptionScripts/aes-128bit.py b/old/decryptionScripts/aes-128bit.py
similarity index 100%
rename from decryptionScripts/aes-128bit.py
rename to old/decryptionScripts/aes-128bit.py
diff --git a/decryptionScripts/aes-256bit.py b/old/decryptionScripts/aes-256bit.py
similarity index 100%
rename from decryptionScripts/aes-256bit.py
rename to old/decryptionScripts/aes-256bit.py
diff --git a/decryptionScripts/blowfish-128bit.py b/old/decryptionScripts/blowfish-128bit.py
similarity index 100%
rename from decryptionScripts/blowfish-128bit.py
rename to old/decryptionScripts/blowfish-128bit.py
diff --git a/decryptionScripts/blowfish-64bit.py b/old/decryptionScripts/blowfish-64bit.py
similarity index 100%
rename from decryptionScripts/blowfish-64bit.py
rename to old/decryptionScripts/blowfish-64bit.py
diff --git a/decryptionScripts/rc4-64bit.py b/old/decryptionScripts/rc4-64bit.py
similarity index 100%
rename from decryptionScripts/rc4-64bit.py
rename to old/decryptionScripts/rc4-64bit.py
diff --git a/decryptionScripts/rc4-8bit.py b/old/decryptionScripts/rc4-8bit.py
similarity index 100%
rename from decryptionScripts/rc4-8bit.py
rename to old/decryptionScripts/rc4-8bit.py
diff --git a/decryptionScripts/twofish-128bit.py b/old/decryptionScripts/twofish-128bit.py
similarity index 100%
rename from decryptionScripts/twofish-128bit.py
rename to old/decryptionScripts/twofish-128bit.py
diff --git a/decryptionScripts/twofish-256bit.py b/old/decryptionScripts/twofish-256bit.py
similarity index 100%
rename from decryptionScripts/twofish-256bit.py
rename to old/decryptionScripts/twofish-256bit.py
diff --git a/readme.md b/old/readme.md
similarity index 100%
rename from readme.md
rename to old/readme.md
diff --git a/setup/certificateCreation.sh b/old/setup/certificateCreation.sh
old mode 100755
new mode 100644
similarity index 100%
rename from setup/certificateCreation.sh
rename to old/setup/certificateCreation.sh
diff --git a/old/setup/certificates/ca-cert.pem b/old/setup/certificates/ca-cert.pem
new file mode 100644
index 0000000..6bab08e
--- /dev/null
+++ b/old/setup/certificates/ca-cert.pem
@@ -0,0 +1,24 @@
+-----BEGIN CERTIFICATE-----
+MIID/DCCAuSgAwIBAgITbaiIqr2BTff+SOVRX7/mVBcunTANBgkqhkiG9w0BAQsF
+ADCBjTELMAkGA1UEBhMCREUxCzAJBgNVBAgMAkJXMRMwEQYDVQQHDApSZXV0bGlu
+Z2VuMRYwFAYDVQQKDA1GSCBSZXV0bGluZ2VuMQ0wCwYDVQQLDARTU0UxMRgwFgYD
+VQQDDA8xOTIuMTY4LjIwMS4xMzIxGzAZBgkqhkiG9w0BCQEWDHRlc3RAdGVzdC5k
+ZTAeFw0yNDEyMTkxNTA4MDZaFw0yNTEyMTkxNTA4MDZaMIGNMQswCQYDVQQGEwJE
+RTELMAkGA1UECAwCQlcxEzARBgNVBAcMClJldXRsaW5nZW4xFjAUBgNVBAoMDUZI
+IFJldXRsaW5nZW4xDTALBgNVBAsMBFNTRTExGDAWBgNVBAMMDzE5Mi4xNjguMjAx
+LjEzMjEbMBkGCSqGSIb3DQEJARYMdGVzdEB0ZXN0LmRlMIIBIjANBgkqhkiG9w0B
+AQEFAAOCAQ8AMIIBCgKCAQEArYqK7wO79gBqKpxaT4LHWpmjpB+/xV1Q48K0VvFi
+HwkmSeqr6un80LkW4kbHEjt0a3QxaacTRmLPtjzINQdm4q9PqCUsrMk2xoukRgAP
+kKU4NedKa35sfuwgPwsdZbp7ECR6Z0UZeYA2rqYHekxmK51GwJ20oq3dl8r7cEUC
+Ix1XqEE5MyOZxoW2HQ4+MCOj8u0VIPYr9lddAB7pZynMeS3H7LCgAfHwMFDYwqY0
+L0Z/uU72eU09YA7YnbqMcptWn+df23ka+YInXVVUgKcTMY9w8bYaqJbka4OmR4wh
+wcQJ+oB5l1So6V/SUnB0onzGDCNFLLei/y7zu1YdwPdlZwIDAQABo1MwUTAdBgNV
+HQ4EFgQUl8AKT23DOTEgYXr+8nmX2vhrcSUwHwYDVR0jBBgwFoAUl8AKT23DOTEg
+YXr+8nmX2vhrcSUwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEA
+HG52FvPi6RPYTkYT82l+tdeAKTwsEPBSmDjEj/aBEHTJ+SRkvH36ux7UFK15tsDz
+4LTVy19OFXWFNoa5VZvVdi8JLeXUQc8RZx1umsgDofd4QuTlgiKYvT0B1P2uC2mD
+/HQ5O98WV+6w5gEz0WlHS4MnKXxYpFQV8KvZ4HraKgdiBUj9mIVlTny+OIOmUoC6
+vfQmEHQwVptR8fUx12TZ2/koVoX2eog0VBKZJgFRQwDMXfY/lh9dW2vnbLDRO9S0
+qQjoErj+tqL6q3C8CVyJVPWD6dzm4UneewX2NmxrmvdfaBI1j1ZewjxU4y+/DkTO
+FXsauZ7Y+utbadX9Wpwwxw==
+-----END CERTIFICATE-----
diff --git a/old/setup/certificates/ca-cert.srl b/old/setup/certificates/ca-cert.srl
new file mode 100644
index 0000000..bbb2a42
--- /dev/null
+++ b/old/setup/certificates/ca-cert.srl
@@ -0,0 +1 @@
+6925992E72329C6DC807A96F7622EF0FD92AA4FB
diff --git a/old/setup/certificates/ca-key.pem b/old/setup/certificates/ca-key.pem
new file mode 100644
index 0000000..10b76c3
--- /dev/null
+++ b/old/setup/certificates/ca-key.pem
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCtiorvA7v2AGoq
+nFpPgsdamaOkH7/FXVDjwrRW8WIfCSZJ6qvq6fzQuRbiRscSO3RrdDFppxNGYs+2
+PMg1B2bir0+oJSysyTbGi6RGAA+QpTg150prfmx+7CA/Cx1lunsQJHpnRRl5gDau
+pgd6TGYrnUbAnbSird2XyvtwRQIjHVeoQTkzI5nGhbYdDj4wI6Py7RUg9iv2V10A
+HulnKcx5LcfssKAB8fAwUNjCpjQvRn+5TvZ5TT1gDtiduoxym1af51/beRr5gidd
+VVSApxMxj3DxthqoluRrg6ZHjCHBxAn6gHmXVKjpX9JScHSifMYMI0Ust6L/LvO7
+Vh3A92VnAgMBAAECggEAAayzWMlgB3QuNP8ltCIUWE2a92r6Grf0ZTBvNSh7DTsp
+sI9dYz2dEBCOQu4VdfbOdJBEEIcpV659ari6P9qRkV33zaz7nOE6jWd4Mh2jZedV
+4e7qBrOcp5edcsWQRtS1tHsJRPqpT8UQpO2d26yUa/+X8CTj/TScwe+KumrAyO99
+bS8vf051TNeNqDqSS2WLonRjcBmBrlF8eq8jDaY8xDAO8LZ5NwQYBgoV914v35sg
+fS5fF3jYJSPDISfA5yG0zZosZ4UWGUo/NyYX35uMdRIf/npLKzFdR3iLzSUU9vc5
+CdUWmA2RtR/5zLmwdJOZ6ldMY/xOP9lxRs0OUzJVtQKBgQDij2TKkOVAmCtELJLo
+nFDOVAlVTiJdKrHZJxq1mRuww2rsdRBIpxtherytBb7eYBKO9uYq2QemMY1DORnD
+QWq+vEbC9XBvgv2zbNRA2qjenPg6AbECe166b/tB5jwhAonxIkeQtarfAvDJCoSr
+wMgqeAvd95QnzBmKu2micwoKfQKBgQDEF3RASYlXM32zLqL6GvHc2hLEpjFjJwbz
+ofi8KYht3BqvJGamRuVyCxONWb0oE7l8h8UI7L/+2qOy3db8wj+dokelW6Hk69Mz
+8xDPGblc5txfYEp+0VDsZAFkHmudJYdplIOWqwXLPQYYLVsWSyIgzMTgjSicm0K7
+1IfWaUdQswKBgHPTfWL2Os4QPaZn519WcxVY70CWZokdB7mN/WCz+u0equ5iVsXd
+8OigGA+Y7WDA2xwN69QiCoATuzWP3rTtH8aNeNu5IRdRb6SoUccqQsU0mM8HCFjN
+e7ty/pBNRZZWtvD5Zn778XR8C1+sqfEo6OyVXPPI3AyQkspTUAkGKS79AoGAWTb2
+jB0o4ESsBu7L9ZB2w+1vpoqaY6so7YWevjUDPkBq345nKXWOBJHnhmLyvZ4jwPWg
+fowAWjotSj7GBl92RAjGIgSLprRodfU7i43/mLXsQ3Ry0Dn5YGOrglqYyXl+n1mT
+eOQ8kZglArD4BS+Pym5/kE6I0J+PABgU6UcizCMCgYEArACpV0kR17Yw4pm5CjOr
+Np7HkR7MhVJNHpG6+c0BBRs2xazUAYYW/WIjPYBdn3ykVr/soRgWwov1DvkuxHIW
+Wznc3KNGkqHDEDFrk2i0wfeK+KB4/vpE+VY6FQnOGlLQRU42Sv8NLyrlVJe1X+V0
+D7We/TGIW+tm6ZU7iVbfJ6k=
+-----END PRIVATE KEY-----
diff --git a/old/setup/certificates/server-cert.pem b/old/setup/certificates/server-cert.pem
new file mode 100644
index 0000000..1ed47d2
--- /dev/null
+++ b/old/setup/certificates/server-cert.pem
@@ -0,0 +1,22 @@
+-----BEGIN CERTIFICATE-----
+MIIDozCCAosCFGklmS5yMpxtyAepb3Yi7w/ZKqT7MA0GCSqGSIb3DQEBCwUAMIGN
+MQswCQYDVQQGEwJERTELMAkGA1UECAwCQlcxEzARBgNVBAcMClJldXRsaW5nZW4x
+FjAUBgNVBAoMDUZIIFJldXRsaW5nZW4xDTALBgNVBAsMBFNTRTExGDAWBgNVBAMM
+DzE5Mi4xNjguMjAxLjEzMj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ATE-----
diff --git a/old/setup/certificates/server-key.pem b/old/setup/certificates/server-key.pem
new file mode 100644
index 0000000..6baec07
--- /dev/null
+++ b/old/setup/certificates/server-key.pem
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCbcpgbZzsEFwoz
+Yd5hROtSUjHv1uzvLaX+12FEIkkmEd9MXGL8uJu7KZYfr1z+KL8YujwS6AQewb2Y
+CqenRBWEvgKYkqcnFUAqTYCjqUsdHyxTdKo3jO44xD3i7JLONWWuMvvBWEIohdgf
+sgisSF6T9Byes2qjYpxGN9onqCNPjuKnIYm55NpPh3du1vLCCsxuu3Y6HcfZoqlh
+bVeYAeYEMFA/t66rpgRZEt6/OAMJU6pXZdad7BhiOpH4baugAVhETcW3r+DMnB14
+tq3qgROmXCfPrJBJoP5UnTzql8MNGq7FbCIufxqD3sHaNNFBkhmwClMxwEjL6AzI
+2gsz9tBRAgMBAAECggEAAQcoP8sIBif0oF54l9W+OqOF9K7MAN7oWmNaH3qckHIp
+swf2e9ZasNepSFIGR1mMoYS7GKLpJkldJXAVC2i8PbGl+qKmFOI/7OCUN7KgZ0H0
+BCSZ+R5nMDjNVYXGpTMBiBNuH8XOJGsD8rMLFmrL4G2ZAGjHN+tE9y4hfAXDO8sq
+Ell9/2rhLGlLQsLb8oozru8KMKLbYOMuicWWHPrM/O9JKIkoGxVpvjcbAm9gcD/c
+Y2kg/qpcXgxUyVpSh5fW4zaUkkWy40jtcpy3VNrWp9/S0HzmO54cG4C9lyTAXuXD
+ahWLVteZXs20vGyLGT/hHCiFj5a4th4wG3vMn64buQKBgQDOuzMyqLy0fgUwCy29
+w+UX89egH7Ms1c7lspj9g1ISnPFST1iaEkvkYOKGlyTg1rTB1mWN7wjFi/po9RT7
++eVBDc+2wD7tt9RcrU6P7Z8+iFae6g0Bb8tBFLYYgPjao3polkK42f2qo8O9JE2k
+K8Pd94MZYJ8ZKA9kR32kVGRDvQKBgQDAfoyjQRNSPnIIFj34q5/hKU7gLBwI3vBb
+x/V3P5AciwSnvMuFNsK/SFE5jDtPT67oJYgqnRag/lVTby6ekZQUGNhuOI2ihtxB
+1m9Fhbllg7tKjxd4Ov+cdxdcIzEg/5VCsoRbnUNSTL+Az4gYCn86nZtPrEYwjiYJ
+ik8t2cp+JQKBgCj2mwx8tvekyO5eKLAjcu+uF5nY7i4CJ78IBpylOswJYSAILOxK
+l9MnB3vX0yziHmsSSok3Riuusu29Mm1DdRPQ4sm5ij6cYG4EwT5vvVAsv805X15b
+gpDgw7xTQfxAzG6Q56OtPkBjttNxsBjJu0PuWYHbzWq0r2gVamX3eu6ZAoGAOHDi
+q7uY/rRwmw5qfU9VQZ/rEK/eSHuV3lNzFdP9XWElrEkfI6A62ftKVaVYfpjOoCLh
+Gh2VVP895YjkEnp9AKeITkkmvlDspCFL3wampa1KbUInj4k9CZOhtdJbxWErUrMl
+O/eQlcELJam0LdhmFbnAoEvTCMmlPYbgUIFbbkECgYAYPdpg9PIxxM24kE4C0NhR
+k5kLEyrCamou4Yren90urg2Mf5A1+RLHVVeNZfkpCNW6QEHxCZQYdkTiZUFa6nSP
+AmQlmdUsZMv9cExKaOTtvlqJD1QUmyP+eUw0XbZtlTmCATIgs5xVtzYO/jsJ4emY
+PKcnaLLyMBRw1O/olfj54w==
+-----END PRIVATE KEY-----
diff --git a/old/setup/certificates/server.csr b/old/setup/certificates/server.csr
new file mode 100644
index 0000000..37268f3
--- /dev/null
+++ b/old/setup/certificates/server.csr
@@ -0,0 +1,18 @@
+-----BEGIN CERTIFICATE REQUEST-----
+MIIC0zCCAbsCAQAwgY0xCzAJBgNVBAYTAkRFMQswCQYDVQQIDAJCVzETMBEGA1UE
+BwwKUmV1dGxpbmdlbjEWMBQGA1UECgwNRkggUmV1dGxpbmdlbjENMAsGA1UECwwE
+U1NFMjEYMBYGA1UEAwwPMTkyLjE2OC4yMDEuMTMyMRswGQYJKoZIhvcNAQkBFgx0
+ZXN0QHRlc3QuZGUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCbcpgb
+ZzsEFwozYd5hROtSUjHv1uzvLaX+12FEIkkmEd9MXGL8uJu7KZYfr1z+KL8YujwS
+6AQewb2YCqenRBWEvgKYkqcnFUAqTYCjqUsdHyxTdKo3jO44xD3i7JLONWWuMvvB
+WEIohdgfsgisSF6T9Byes2qjYpxGN9onqCNPjuKnIYm55NpPh3du1vLCCsxuu3Y6
+HcfZoqlhbVeYAeYEMFA/t66rpgRZEt6/OAMJU6pXZdad7BhiOpH4baugAVhETcW3
+r+DMnB14tq3qgROmXCfPrJBJoP5UnTzql8MNGq7FbCIufxqD3sHaNNFBkhmwClMx
+wEjL6AzI2gsz9tBRAgMBAAGgADANBgkqhkiG9w0BAQsFAAOCAQEAgYU9+tSGmNkX
+V3quCoROUYsHESbadF5OBhC5hwm2fxWbWTVPHs3O/iyciwjdHCX2CVmquFp48iP/
+Tt1JYODpHLK5S33+fsHMcXK2bE8mDyjXqix3lUgGxj2fD3Wm8p2v7Us10z+V6/fg
+KthDz+wrT7lKMSl7Jxh5zBmWZ+yVN4ocFm/mvfIqVqMUiy4f/zpbFDhcR0TS8SL9
+MA3A9suD2Xn74OhuSO5RKe27FeG4x9XkK6gDr6GP2DM1ghnhlxeGURfl+/2zd7j3
+secKmRjyrlM5KJvV0kEOpStdCK+5SGv79MwhpMUfPMtdsao62V/HR+IsFfanrzDj
+irXNagAkTw==
+-----END CERTIFICATE REQUEST-----
diff --git a/setup/decryption.sh b/old/setup/decryption.sh
similarity index 100%
rename from setup/decryption.sh
rename to old/setup/decryption.sh
diff --git a/setup/pythonInstallation.sh b/old/setup/pythonInstallation.sh
similarity index 100%
rename from setup/pythonInstallation.sh
rename to old/setup/pythonInstallation.sh
diff --git a/setup/wolfsslInstallation.sh b/old/setup/wolfsslInstallation.sh
similarity index 100%
rename from setup/wolfsslInstallation.sh
rename to old/setup/wolfsslInstallation.sh
diff --git a/testData/test.txt b/old/testData/test.txt
similarity index 100%
rename from testData/test.txt
rename to old/testData/test.txt
-- 
GitLab