updates>
This commit is contained in:
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];
|
unsigned char ciphertext[2048];
|
||||||
|
|
||||||
int plaintext_len = (int)strlen(buffer);
|
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) {
|
if (ciphertext_len <= 0) {
|
||||||
printf("encrypt failed or produced empty ciphertext_len=%d\n", ciphertext_len);
|
printf("encrypt failed or produced empty ciphertext_len=%d\n", ciphertext_len);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ int main(void){
|
|||||||
|
|
||||||
// decrypt client message
|
// decrypt client message
|
||||||
unsigned char plaintext[2048];
|
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) {
|
if (plaintext_len < 0) {
|
||||||
fprintf(stderr, "decrypt failed\n");
|
fprintf(stderr, "decrypt failed\n");
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user