Untitled

 avatar
unknown
python
20 days ago
813 B
4
Indexable
# client.py
import bluetooth
from crypto_utils import *

target_name = "YOUR_PC_BLUETOOTH_NAME"
target_addr = None

for device in bluetooth.discover_devices():
    if target_name in bluetooth.lookup_name(device):
        target_addr = device
        break

if target_addr is None:
    print("Could not find target device.")
    exit()

sock = bluetooth.BluetoothSocket(bluetooth.RFCOMM)
sock.connect((target_addr, 1))
print("🔗 Connected!")

# ECC Key Exchange
priv_key, pub_key = generate_key_pair()
sock.send(pub_key.public_bytes())
server_pub_bytes = sock.recv(1024)

aes_key = get_shared_key(priv_key, server_pub_bytes)

# Encrypt and send message
message = "STRIKE ALERT: EMP SPIKE DETECTED"
encrypted = encrypt_message(aes_key, message)
sock.send(encrypted)

sock.close()
Editor is loading...
Leave a Comment