blueferret 4 Posted May 11 (edited) basically i'm trying to make a mock baseapp for an offline server and for some unknown reason, i'm getting a decrypting error after the client logs in and is communicating with said BaseApp. File "C:\Python39\lib\site-packages\Crypto\Cipher\PKCS1_OAEP.py", line 167, in decrypt raise ValueError("Ciphertext with incorrect length.") client is sending this: b'\x01\x00\x00\x08\x00BW\x01\x00\x00\x00\xbe\xbe\xbe\xbe\x00\x00\x00\x00\x02\x00' keys match; not the problem. while True: readable, writeable, exceptional = select.select(sockets, empty, empty) for sock in readable: data, addr = sock.recvfrom(5000) if sock.getsockname()[1] == 20015: data_cut = data[15:-2] packet_decoded = decrypt_priv(privkey, data_cut) Edited May 11 by blueferret Share this post Link to post Short link Share on other sites
DrWeb7_1 141 #517465 Posted May 11 You don't have to use RSA as the client gets to baseApp. You should use the Blowfish key sent to the server by the client. Share this post Link to post Short link Share on other sites
blueferret 4 #517466 Posted May 11 i also should add that when logging in, it works fine. same methods are used. Just now, DrWeb7_1 said: You don't have to use RSA as the client gets to baseApp. You should use the Blowfish key sent to the server by the client. so forget about the RSA encryption Share this post Link to post Short link Share on other sites
DrWeb7_1 141 #517467 Posted May 11 1 минуту назад, blueferret сказал: so forget about the RSA encryption Exactly. When loginApp 'handshake' is complete, forget about RSA existence unless another client decides to connect. Share this post Link to post Short link Share on other sites
blueferret 4 #517468 Posted May 11 Just now, DrWeb7_1 said: Exactly. When loginApp 'handshake' is complete, forget about RSA existence unless another client decides to connect. def blowfish_decrypt(INPUT, BLOWFISH_KEY): blowfish_ecb = Blowfish.new(BLOWFISH_KEY, Blowfish.MODE_ECB) decrypted_data = blowfish_ecb.decrypt(INPUT) print(f'[BASEAPP_DECRYPTED] Got {decrypted_data.hex()}') return decrypted_data this? Share this post Link to post Short link Share on other sites
DrWeb7_1 141 #517469 Posted May 11 1 минуту назад, blueferret сказал: this? Yes, this one is to decrypt all packets sent by client *after* the loginApp stage. Share this post Link to post Short link Share on other sites
blueferret 4 #517470 Posted May 11 Just now, DrWeb7_1 said: Yes, this one is to decrypt all packets sent by client *after* the loginApp stage. yeah i think im just over complicating it Share this post Link to post Short link Share on other sites