Display actual data, do not suggest that the nonce is part of the ciphertext

This commit is contained in:
Frank Denis 2015-05-27 16:57:51 +02:00
parent 57fb685157
commit a549360201
2 changed files with 5 additions and 7 deletions

View File

@ -57,10 +57,8 @@ auth(void)
printf("Generating %s authentication...\n", crypto_auth_primitive());
crypto_auth(mac, message, message_len, key);
puts("Format: authentication tag::message");
fputs("Authentication tag: ", stdout);
print_hex(mac, sizeof mac);
fputs("::", stdout);
puts((const char*)message);
putchar('\n');
puts("Verifying authentication tag...");

View File

@ -112,11 +112,11 @@ box(void)
puts("Bob sends the ciphertext...\n");
printf("Ciphertext len: %zu bytes - Original message length: %zu bytes\n",
ciphertext_len, message_len);
puts("Notice the prepended 16 byte authentication token");
puts("Format: nonce::encrypted_message");
puts("Notice the prepended 16 byte authentication token\n");
fputs("Nonce: ", stdout);
print_hex(ciphertext, ciphertext_len);
putchar('\n');
fputs("Ciphertext: ", stdout);
print_hex(nonce, sizeof nonce);
fputs("::", stdout);
print_hex(ciphertext, ciphertext_len);
putchar('\n');
putchar('\n');