This commit is contained in:
Zheyuan Wu
2026-02-16 12:34:41 -06:00
parent 2845c03eb6
commit 5a4327bcd4
4 changed files with 2 additions and 2 deletions

BIN
bin/client Executable file

Binary file not shown.

BIN
bin/server Executable file

Binary file not shown.

View File

@@ -155,7 +155,7 @@ int main(void){
unsigned char ciphertext[2048];
int plaintext_len = (int)strlen(buffer);
int ciphertext_len = stream_encrypt((unsigned char*)buffer, plaintext_len, key_bytes, iv_bytes, ciphertext);
int ciphertext_len = block_encrypt((unsigned char*)buffer, plaintext_len, key_bytes, iv_bytes, ciphertext);
if (ciphertext_len <= 0) {
printf("encrypt failed or produced empty ciphertext_len=%d\n", ciphertext_len);
break;

View File

@@ -167,7 +167,7 @@ int main(void){
// decrypt client message
unsigned char plaintext[2048];
int plaintext_len = stream_decrypt((unsigned char*)client_message, (int)n, key_bytes, iv_bytes, plaintext);
int plaintext_len = block_decrypt((unsigned char*)client_message, (int)n, key_bytes, iv_bytes, plaintext);
if (plaintext_len < 0) {
fprintf(stderr, "decrypt failed\n");
break;