From 20400fe4f3ca50303d3a61d1fdf40003203e9e9b Mon Sep 17 00:00:00 2001 From: Joren Schipman Date: Wed, 1 May 2024 22:30:04 +0200 Subject: [PATCH] Make server get filetype and identify file --- connectrsa.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/connectrsa.kt b/connectrsa.kt index 0985456..34126bc 100644 --- a/connectrsa.kt +++ b/connectrsa.kt @@ -94,13 +94,18 @@ class Connect { val encodedKey = encodeBase64(keyBytes) println(encryptText(encodedKey, pKey)) writer.println(encryptText(encodedKey, pKey)) - reader.readLine() + val encodedIV = encodeBase64(ivBytes) println(encryptText(encodedIV,pKey)) writer.println(encryptText(encodedIV, pKey)) reader.readLine() + + val encodedUid = encodeBase64(android.os.Process.myUid().toString().toByteArray()) + writer.println(encryptText(encodedUid, pKey)) + reader.readLine() + for (chunk in chunks) { val cipherText = encrypt(algorithm, chunk, key, iv).lines().joinToString("") writer.println(cipherText)