From 5a4e3302e25b9a1cf097f0d427725c3ec04b84d9 Mon Sep 17 00:00:00 2001 From: wangyu Date: Sun, 13 Aug 2017 21:27:53 +0800 Subject: [PATCH] added comment about security of zero iv + nonce first data block --- encrypt.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/encrypt.cpp b/encrypt.cpp index 57e2b5d..b2e0af7 100755 --- a/encrypt.cpp +++ b/encrypt.cpp @@ -11,8 +11,11 @@ //static uint64_t seq=1; static int8_t zero_iv[]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0};//this prog use zero iv,you should make sure first block of data contains a random/nonce data - - +/**** + * important! + * why zero iv + nonce first data block is secure? + * https://crypto.stackexchange.com/questions/5421/using-cbc-with-a-fixed-iv-and-a-random-first-plaintext-block +****/ unordered_map auth_mode_tostring = {{auth_none, "none"}, {auth_md5, "md5"}, {auth_crc32, "crc32"},{auth_simple,"simple"}}; unordered_map cipher_mode_tostring={{cipher_none,"none"},{cipher_aes128cbc,"aes128cbc"},{cipher_xor,"xor"}};