Compare commits
2 Commits
c4bceba2d3
...
0c29ec99fd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c29ec99fd | ||
|
|
5a4327bcd4 |
BIN
bin/client
Executable file
BIN
bin/client
Executable file
Binary file not shown.
BIN
bin/server
Executable file
BIN
bin/server
Executable file
Binary file not shown.
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user