diff --git a/communication/client.py b/communication/client.py index a5a778188f2b70eb7854198f4c2c7adedbe67906..d1e1af6eaa5e6e6770e161459e6e62a1167e5262 100644 --- a/communication/client.py +++ b/communication/client.py @@ -1,11 +1,9 @@ import socket import json import logging -from colorlog import ColoredFormatter from Crypto.Cipher import DES, Blowfish, ARC4 from Crypto.Random import get_random_bytes from Crypto.Util.Padding import pad -import base64 import sys import os sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'setup'))) @@ -88,16 +86,25 @@ def main(): elif encryption_choice == 2: algorithm = 'Blowfish' print("Choose key length:") - print("1. 40-bit") - print("2. 128-bit") + print("1. 32-bit") + print("2. 40-bit") + print("3. 64-bit") + print("4. 128-bit") + print("5. 448-bit (maximum)") key_length_choice = int(input("Select: ")) if key_length_choice == 1: key = get_random_bytes(5) # 40 bits = 5 bytes key_length = 40 elif key_length_choice == 2: + key = get_random_bytes(8) # 64 bits = 8 bytes + key_length = 64 + elif key_length_choice == 3: key = get_random_bytes(16) # 128 bits = 16 bytes key_length = 128 + elif key_length_choice == 4: + key = get_random_bytes(56) # 448 bits = 56 bytes + key_length = 448 else: logging.error("Invalid choice for key length.") print("Invalid choice!") @@ -107,15 +114,23 @@ def main(): algorithm = 'RC4' print("Choose key length:") print("1. 40-bit") - print("2. 128-bit") + print("2. 64-bit") + print("3. 128-bit") + print("4. 2048-bit (maximum)") key_length_choice = int(input("Select: ")) if key_length_choice == 1: key = get_random_bytes(5) # 40 bits = 5 bytes key_length = 40 elif key_length_choice == 2: + key = get_random_bytes(8) # 64 bits = 8 bytes + key_length = 64 + elif key_length_choice == 3: key = get_random_bytes(16) # 128 bits = 16 bytes key_length = 128 + elif key_length_choice == 4: + key = get_random_bytes(56) # 448 bits = 56 bytes + key_length = 448 else: logging.error("Invalid choice for key length.") print("Invalid choice!") @@ -143,4 +158,4 @@ def main(): break if __name__ == '__main__': - main() \ No newline at end of file + main() diff --git a/communication/server.py b/communication/server.py index 39c07a53e9af1f05d76dc4bc9b28634aed7b9317..3ad382c38b5e26537038c3f21387b8dac218d926 100644 --- a/communication/server.py +++ b/communication/server.py @@ -1,20 +1,18 @@ import socket import json import logging -from colorlog import ColoredFormatter from Crypto.Cipher import DES, Blowfish, ARC4 from Crypto.Util.Padding import unpad -import base64 import sys import os sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'setup'))) from custom_logging import configure_logging -# Entschlüsselung der empfangenen Nachricht mit dem symmetrischen Schlüssel +# Decrypt the received message with the symmetric key def decrypt_message(algorithm, key, encrypted_message): logging.info(f"Starting decryption with algorithm: {algorithm}") - # Umwandlung der empfangenen Nachricht von Hex zu Binär + # Convert the received message from Hex to Binary encrypted_message = bytes.fromhex(encrypted_message) logging.info(f"Encrypted message: {encrypted_message.hex()}") @@ -49,11 +47,11 @@ def decrypt_message(algorithm, key, encrypted_message): def handle_client(conn, addr): logging.info(f"Handling client {addr}") - # Receive up to 1024 Bytes data from client + # Receive up to 1024 Bytes of data from the client data = conn.recv(1024).decode() logging.info(f"Received data from client {addr}.") - # Manage received JSON data and extract information + # Process received JSON data and extract information try: data = json.loads(data) algorithm = data['algorithm'] @@ -61,7 +59,7 @@ def handle_client(conn, addr): hex_key = data['key'] key = bytes.fromhex(data['key']) encrypted_message = data['message'] - logging.info(f"Algorithm: {algorithm}, Key Length: {key_length}, key: {hex_key}") + logging.info(f"Algorithm: {algorithm}, Key Length: {key_length}, Key: {hex_key}") except json.JSONDecodeError as e: logging.error(f"Error decoding data: {e}") conn.close() @@ -73,10 +71,10 @@ def handle_client(conn, addr): # Define server configuration def main(): - # configure colored logging + # Configure colored logging configure_logging() - # server information + # Server information host = '192.168.178.63' port = 12345 diff --git a/decryption/blowfish.py b/decryption/blowfish.py new file mode 100644 index 0000000000000000000000000000000000000000..7583f6b4c3aecad32374e8852cda12ee8fa407a5 --- /dev/null +++ b/decryption/blowfish.py @@ -0,0 +1,89 @@ +import logging +from Crypto.Cipher import Blowfish +from Crypto.Util.Padding import unpad +import itertools +import sys +import os +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'setup'))) +from custom_logging import configure_logging + +# Decryption function +def decrypt(ciphertext, iv, key, expected_plaintext): + try: + cipher = Blowfish.new(key, Blowfish.MODE_CBC, iv) + plaintext = unpad(cipher.decrypt(ciphertext), Blowfish.block_size) + + # Check if the decrypted text matches the expected plaintext + if plaintext.decode() == expected_plaintext: + return plaintext.decode() + else: + return None + except Exception as e: + logging.error(f"Decryption failed: {e}") + return None + +# Brute-force attack on Blowfish encryption with variable key lengths +def brute_force_blowfish(ciphertext_hex, expected_plaintext, key_length_bits, debug_key=None): + # Convert the hex string to bytes + decoded_ciphertext = bytes.fromhex(ciphertext_hex) + + # Extract the IV (the first 8 bytes) + iv = decoded_ciphertext[:8] + ciphertext = decoded_ciphertext[8:] # The rest is the encrypted text + + logging.info(f"Extracted IV (Hex): {iv.hex()}") + logging.info(f"Starting brute-force for Blowfish with key length {key_length_bits} bits...") + + # Convert key length from bits to bytes + key_length = key_length_bits // 8 + + # If a debug key is provided, try decrypting with it first + if debug_key: + key = bytes.fromhex(debug_key) + plaintext = decrypt(ciphertext, iv, key, expected_plaintext) + if plaintext: + logging.info(f"Decrypted successfully using debug key: {plaintext} with key {key.hex()}") + return plaintext + else: + logging.error("Debug key provided but failed to match the expected plaintext.") + + # If no debug key is provided, or the debug key failed, start the brute-force attack + logging.info(f"Attempting all possible keys of length {key_length} bytes...") + for key in itertools.product(range(256), repeat=key_length): + key = bytes(key) + plaintext = decrypt(ciphertext, iv, key, expected_plaintext) + if plaintext: + logging.info(f"Decrypted successfully: {plaintext} with key {key.hex()}") + return plaintext + + logging.error("No matching key found.") + return None + +def main(): + # Configure colored logging + configure_logging() + + # Input the encrypted text as a hex string + ciphertext_hex = input("Enter the Blowfish-encrypted text (Hex, including IV): ").strip() + + # Input the key length in bits + key_length_bits = int(input("Enter the key length in bits: ").strip()) + + # Optionally provide a debug key + debug_key = input("Enter a debug key in hex (or press Enter to skip): ").strip() + if not debug_key: + debug_key = None + + # Define the expected plaintext + expected_plaintext = input("Enter the expected plaintext: ").strip() + + # Call brute-force decryption + result = brute_force_blowfish(ciphertext_hex, expected_plaintext, key_length_bits, debug_key) + + if result: + logging.info(f"Decrypted text: {result}") + else: + logging.error("Failed to decrypt the ciphertext.") + +if __name__ == "__main__": + main() diff --git a/decryption/blowfish_128.py b/decryption/blowfish_128.py deleted file mode 100644 index 7224a3a7f5506f0eadd8b696c111de532cca11d1..0000000000000000000000000000000000000000 --- a/decryption/blowfish_128.py +++ /dev/null @@ -1,78 +0,0 @@ -import logging -from Crypto.Cipher import Blowfish -from Crypto.Util.Padding import unpad -import itertools -import sys -import os -sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'setup'))) -from custom_logging import configure_logging - -# Brute-force attack on Blowfish encryption (128-bit block size) -def brute_force_blowfish(ciphertext_hex, expected_plaintext, debug_key=None): - # Convert the hex string to bytes - decoded_ciphertext = bytes.fromhex(ciphertext_hex) - - # Extract the IV (the first 8 bytes) - iv = decoded_ciphertext[:8] - ciphertext = decoded_ciphertext[8:] # The rest is the encrypted text - - logging.info(f"Extracted IV (Hex): {iv.hex()}") - logging.info("Starting brute-force for Blowfish with 128-bit keys...") - - # Optional debug key - if debug_key: - try: - key = bytes.fromhex(debug_key) - cipher = Blowfish.new(key, Blowfish.MODE_CBC, iv) - plaintext = unpad(cipher.decrypt(ciphertext), Blowfish.block_size) - if plaintext.decode() == expected_plaintext: - logging.info(f"Decrypted successfully: {plaintext.decode()} with debug key {key.hex()}") - return plaintext.decode() - else: - logging.warning("Debug key provided but failed to match the expected plaintext.") - except Exception as e: - logging.error(f"Error with debug key: {e}") - - # Brute-force key generation: all possible 8-byte keys (128 bits) - for key in itertools.product(range(256), repeat=16): - key = bytes(key) - try: - # Decrypt with the generated key - cipher = Blowfish.new(key, Blowfish.MODE_CBC, iv) - plaintext = unpad(cipher.decrypt(ciphertext), Blowfish.block_size) - - # Check if the decrypted text matches the expected plaintext - if plaintext.decode() == expected_plaintext: - logging.info(f"Decrypted successfully: {plaintext.decode()} with key {key.hex()}") - return plaintext.decode() - except Exception: - continue - - logging.error("No matching key found.") - return None - -def main(): - # Configure colored logging - configure_logging() - - # Input the encrypted text as a hex string - ciphertext_hex = input("Enter the Blowfish-encrypted text (Hex, including IV): ").strip() - - # Optionally provide a debug key - debug_key = input("Enter a debug key in hex (or press Enter to skip): ").strip() - if not debug_key: - debug_key = None - - # Define the expected plaintext - expected_plaintext = "Test" - - # Call brute-force decryption - result = brute_force_blowfish(ciphertext_hex, expected_plaintext, debug_key) - - if result: - logging.info(f"Decrypted text: {result}") - else: - logging.error("Failed to decrypt the ciphertext.") - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/decryption/blowfish_40.py b/decryption/blowfish_40.py deleted file mode 100644 index 185d5417e61841f7766929e288c25fc213c2370b..0000000000000000000000000000000000000000 --- a/decryption/blowfish_40.py +++ /dev/null @@ -1,78 +0,0 @@ -import logging -from Crypto.Cipher import Blowfish -from Crypto.Util.Padding import unpad -import itertools -import sys -import os -sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'setup'))) -from custom_logging import configure_logging - -# Brute-force attack on Blowfish encryption (40-bit block size) -def brute_force_blowfish(ciphertext_hex, expected_plaintext, debug_key=None): - # Convert the hex string to bytes - decoded_ciphertext = bytes.fromhex(ciphertext_hex) - - # Extract the IV (the first 8 bytes) - iv = decoded_ciphertext[:8] - ciphertext = decoded_ciphertext[8:] # The rest is the encrypted text - - logging.info(f"Extracted IV (Hex): {iv.hex()}") - logging.info("Starting brute-force for Blowfish with 40-bit keys...") - - # Optional debug key - if debug_key: - try: - key = bytes.fromhex(debug_key) - cipher = Blowfish.new(key, Blowfish.MODE_CBC, iv) - plaintext = unpad(cipher.decrypt(ciphertext), Blowfish.block_size) - if plaintext.decode() == expected_plaintext: - logging.info(f"Decrypted successfully: {plaintext.decode()} with debug key {key.hex()}") - return plaintext.decode() - else: - logging.warning("Debug key provided but failed to match the expected plaintext.") - except Exception as e: - logging.error(f"Error with debug key: {e}") - - # Brute-force key generation: all possible 5-byte keys (40 bits) - for key in itertools.product(range(256), repeat=5): - key = bytes(key) - try: - # Decrypt with the generated key - cipher = Blowfish.new(key, Blowfish.MODE_CBC, iv) - plaintext = unpad(cipher.decrypt(ciphertext), Blowfish.block_size) - - # Check if the decrypted text matches the expected plaintext - if plaintext.decode() == expected_plaintext: - logging.info(f"Decrypted successfully: {plaintext.decode()} with key {key.hex()}") - return plaintext.decode() - except Exception: - continue - - logging.error("No matching key found.") - return None - -def main(): - # Configure colored logging - configure_logging() - - # Input the encrypted text as a hex string - ciphertext_hex = input("Enter the Blowfish-encrypted text (Hex, including IV): ").strip() - - # Optionally provide a debug key - debug_key = input("Enter a debug key in hex (or press Enter to skip): ").strip() - if not debug_key: - debug_key = None - - # Define the expected plaintext - expected_plaintext = "Test" - - # Call brute-force decryption - result = brute_force_blowfish(ciphertext_hex, expected_plaintext, debug_key) - - if result: - logging.info(f"Decrypted text: {result}") - else: - logging.error("Failed to decrypt the ciphertext.") - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/decryption/des_64.py b/decryption/des.py similarity index 54% rename from decryption/des_64.py rename to decryption/des.py index 137c0c94706802825da11b6a4723c27d0794138d..cd4e1fad355b4d55ed34905c0c500d04e63171f8 100644 --- a/decryption/des_64.py +++ b/decryption/des.py @@ -7,6 +7,21 @@ import os sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'setup'))) from custom_logging import configure_logging +# Decryption function +def decrypt(ciphertext, iv, key, expected_plaintext): + try: + cipher = DES.new(key, DES.MODE_CBC, iv) + plaintext = unpad(cipher.decrypt(ciphertext), DES.block_size) + + # Check if the decrypted text matches the expected plaintext + if plaintext.decode() == expected_plaintext: + return plaintext.decode() + else: + return None + except Exception as e: + logging.error(f"Decryption failed: {e}") + return None + # Brute-force attack on DES encryption def brute_force_des(ciphertext_hex, expected_plaintext, debug_key=None): # Convert the hex string to bytes @@ -19,34 +34,24 @@ def brute_force_des(ciphertext_hex, expected_plaintext, debug_key=None): logging.info(f"Extracted IV (Hex): {iv.hex()}") logging.info("Starting brute-force for DES (64-bit key)...") - # Optional debug key + # If a debug key is provided, try decrypting with it first if debug_key: - try: - key = bytes.fromhex(debug_key) - cipher = DES.new(key, DES.MODE_CBC, iv) - plaintext = unpad(cipher.decrypt(ciphertext), DES.block_size) - if plaintext.decode() == expected_plaintext: - logging.info(f"Decrypted successfully: {plaintext.decode()} with debug key {key.hex()}") - return plaintext.decode() - else: - logging.warning("Debug key provided but failed to match the expected plaintext.") - except Exception as e: - logging.error(f"Error with debug key: {e}") + key = bytes.fromhex(debug_key) + plaintext = decrypt(ciphertext, iv, key, expected_plaintext) + if plaintext: + logging.info(f"Decrypted successfully using debug key: {plaintext} with key {key.hex()}") + return plaintext + else: + logging.error("Debug key provided but failed to match the expected plaintext.") - # Brute-force key generation: all possible 8-byte keys + # Brute-force key generation: all possible 8-byte keys (using itertools.product) + logging.info("Attempting all possible 8-byte keys...") for key in itertools.product(range(256), repeat=8): key = bytes(key) - try: - # Decrypt with the generated key - cipher = DES.new(key, DES.MODE_CBC, iv) - plaintext = unpad(cipher.decrypt(ciphertext), DES.block_size) - - # Check if the decrypted text matches the expected plaintext - if plaintext.decode() == expected_plaintext: - logging.info(f"Decrypted successfully: {plaintext.decode()} with key {key.hex()}") - return plaintext.decode() - except Exception: - continue + plaintext = decrypt(ciphertext, iv, key, expected_plaintext) + if plaintext: + logging.info(f"Decrypted successfully: {plaintext} with key {key.hex()}") + return plaintext logging.error("No matching key found.") return None @@ -64,7 +69,7 @@ def main(): debug_key = None # Define the expected plaintext - expected_plaintext = "Test" + expected_plaintext = input("Enter the expected plaintext: ").strip() # Call brute-force decryption result = brute_force_des(ciphertext_hex, expected_plaintext, debug_key) @@ -75,4 +80,4 @@ def main(): logging.error("Failed to decrypt the ciphertext.") if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/decryption/rc4.py b/decryption/rc4.py new file mode 100644 index 0000000000000000000000000000000000000000..308e25c9d6c68c1d7cd369a13d4eecff1812642b --- /dev/null +++ b/decryption/rc4.py @@ -0,0 +1,83 @@ +import logging +from Crypto.Cipher import ARC4 +import itertools +import sys +import os +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'setup'))) +from custom_logging import configure_logging + +# Decryption function +def decrypt(ciphertext, key, expected_plaintext): + try: + cipher = ARC4.new(key) + plaintext = cipher.decrypt(ciphertext) + + # Check if the decrypted text matches the expected plaintext + if plaintext.decode() == expected_plaintext: + return plaintext.decode() + else: + return None + except Exception as e: + logging.error(f"Decryption failed: {e}") + return None + +# Brute-force attack on RC4 encryption with variable key lengths +def brute_force_rc4(ciphertext_hex, expected_plaintext, key_length_bits, debug_key=None): + # Convert the hex string to bytes + ciphertext = bytes.fromhex(ciphertext_hex) + + logging.info(f"Starting brute-force for RC4 with key length {key_length_bits} bits...") + + # Convert key length from bits to bytes + key_length = key_length_bits // 8 + + # If a debug key is provided, try decrypting with it first + if debug_key: + key = bytes.fromhex(debug_key) + plaintext = decrypt(ciphertext, key, expected_plaintext) + if plaintext: + logging.info(f"Decrypted successfully using debug key: {plaintext} with key {key.hex()}") + return plaintext + else: + logging.error("Debug key provided but failed to match the expected plaintext.") + + # If no debug key is provided, or the debug key failed, start the brute-force attack + logging.info(f"Attempting all possible keys of length {key_length} bytes...") + for key in itertools.product(range(256), repeat=key_length): + key = bytes(key) + plaintext = decrypt(ciphertext, key, expected_plaintext) + if plaintext: + logging.info(f"Decrypted successfully: {plaintext} with key {key.hex()}") + return plaintext + + logging.error("No matching key found.") + return None + +def main(): + # Configure colored logging + configure_logging() + + # Input the encrypted text as a hex string + ciphertext_hex = input("Enter the RC4-encrypted text (Hex): ").strip() + + # Optionally provide a debug key + debug_key = input("Enter a debug key in hex (or press Enter to skip): ").strip() + if not debug_key: + debug_key = None + + # Define the expected plaintext + expected_plaintext = input("Enter the expected plaintext: ").strip() + + # Get the key length in bits from the user + key_length_bits = int(input("Enter the key length in bits: ").strip()) + + # Call brute-force decryption + result = brute_force_rc4(ciphertext_hex, expected_plaintext, key_length_bits, debug_key) + + if result: + logging.info(f"Decrypted text: {result}") + else: + logging.error("Failed to decrypt the ciphertext.") + +if __name__ == "__main__": + main() diff --git a/decryption/rc4_128.py b/decryption/rc4_128.py deleted file mode 100644 index 0d9a1abeef474299d377795bf4fca8d2fb1602f5..0000000000000000000000000000000000000000 --- a/decryption/rc4_128.py +++ /dev/null @@ -1,72 +0,0 @@ -import logging -from Crypto.Cipher import ARC4 -import itertools -import sys -import os -sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'setup'))) -from custom_logging import configure_logging - -# Brute-force attack on RC4 encryption (128-bit key) -def brute_force_rc4(ciphertext_hex, expected_plaintext, debug_key=None): - # Convert the hex string to bytes - ciphertext = bytes.fromhex(ciphertext_hex) - - logging.info("Starting brute-force for RC4 with 128-bit keys...") - - # Optional debug key - if debug_key: - try: - key = bytes.fromhex(debug_key) - cipher = ARC4.new(key) - plaintext = cipher.decrypt(ciphertext) - if plaintext.decode() == expected_plaintext: - logging.info(f"Decrypted successfully: {plaintext.decode()} with debug key {key.hex()}") - return plaintext.decode() - else: - logging.warning("Debug key provided but failed to match the expected plaintext.") - except Exception as e: - logging.error(f"Error with debug key: {e}") - - # Brute-force key generation: all possible 16-byte keys (128 bits) - for key in itertools.product(range(256), repeat=16): - key = bytes(key) - try: - # Decrypt with the generated key - cipher = ARC4.new(key) - plaintext = cipher.decrypt(ciphertext) - - # Check if the decrypted text matches the expected plaintext - if plaintext.decode() == expected_plaintext: - logging.info(f"Decrypted successfully: {plaintext.decode()} with key {key.hex()}") - return plaintext.decode() - except Exception: - continue - - logging.error("No matching key found.") - return None - -def main(): - # Configure colored logging - configure_logging() - - # Input the encrypted text as a hex string - ciphertext_hex = input("Enter the RC4-encrypted text (Hex): ").strip() - - # Optionally provide a debug key - debug_key = input("Enter a debug key in hex (or press Enter to skip): ").strip() - if not debug_key: - debug_key = None - - # Define the expected plaintext - expected_plaintext = "Test" - - # Call brute-force decryption - result = brute_force_rc4(ciphertext_hex, expected_plaintext, debug_key) - - if result: - logging.info(f"Decrypted text: {result}") - else: - logging.error("Failed to decrypt the ciphertext.") - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/decryption/rc4_40.py b/decryption/rc4_40.py deleted file mode 100644 index ca01135fb1d74f9af4a31be99345b2ddfa1abdbe..0000000000000000000000000000000000000000 --- a/decryption/rc4_40.py +++ /dev/null @@ -1,72 +0,0 @@ -import logging -from Crypto.Cipher import ARC4 -import itertools -import sys -import os -sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'setup'))) -from custom_logging import configure_logging - -# Brute-force attack on RC4 encryption (40-bit key) -def brute_force_rc4(ciphertext_hex, expected_plaintext, debug_key=None): - # Convert the hex string to bytes - ciphertext = bytes.fromhex(ciphertext_hex) - - logging.info("Starting brute-force for RC4 with 40-bit keys...") - - # Optional debug key - if debug_key: - try: - key = bytes.fromhex(debug_key) - cipher = ARC4.new(key) - plaintext = cipher.decrypt(ciphertext) - if plaintext.decode() == expected_plaintext: - logging.info(f"Decrypted successfully: {plaintext.decode()} with debug key {key.hex()}") - return plaintext.decode() - else: - logging.warning("Debug key provided but failed to match the expected plaintext.") - except Exception as e: - logging.error(f"Error with debug key: {e}") - - # Brute-force key generation: all possible 5-byte keys (40 bits) - for key in itertools.product(range(256), repeat=5): - key = bytes(key) - try: - # Decrypt with the generated key - cipher = ARC4.new(key) - plaintext = cipher.decrypt(ciphertext) - - # Check if the decrypted text matches the expected plaintext - if plaintext.decode() == expected_plaintext: - logging.info(f"Decrypted successfully: {plaintext.decode()} with key {key.hex()}") - return plaintext.decode() - except Exception: - continue - - logging.error("No matching key found.") - return None - -def main(): - # Configure colored logging - configure_logging() - - # Input the encrypted text as a hex string - ciphertext_hex = input("Enter the RC4-encrypted text (Hex): ").strip() - - # Optionally provide a debug key - debug_key = input("Enter a debug key in hex (or press Enter to skip): ").strip() - if not debug_key: - debug_key = None - - # Define the expected plaintext - expected_plaintext = "Test" - - # Call brute-force decryption - result = brute_force_rc4(ciphertext_hex, expected_plaintext, debug_key) - - if result: - logging.info(f"Decrypted text: {result}") - else: - logging.error("Failed to decrypt the ciphertext.") - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/readme.md b/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..7d7af7c1869d53a06622620f44c73d6f894c96b8 --- /dev/null +++ b/readme.md @@ -0,0 +1,4 @@ +This project implements the end to end communication with the following algorithms: +- DES (64 bit key) +- Blowfish (32, 64, 128 bit key) +- RC4 () \ No newline at end of file