/* ** File: ENCRYPT$1_MBYTE_RANDOM-KEY.C ** ** Encrypt 1 MB (of zeros), using a random key and AES, then Decrypt ** and compare data. Cycle through all the AES block and stream modes ** using the various key sizes. */ /* ** Change History ** Paul Mosteika 21-Jun-2006 ** Create example for ENCRYPT$EXAMPLES ** Paul Mosteika 26-May-2006 ** Make separate random key (keygen) 1MB test. ** Paul Mosteika 25-Jan-2006 ** Created. */ /* ** Build and usage notes: ** ** Compile as normal, but for extra trace output define ** DEBUG_TRACE, for example: ** ** $ cc /define=DEBUG_TRACE ENCRYPT$1_MBYTE_RANDOM-KEY ** $ link ENCRYPT$1_MBYTE_RANDOM-KEY ** $ r ENCRYPT$1_MBYTE_RANDOM-KEY ** ** Also look at the encrypted data in ECB mode and compare with ** enciphered data in CBC mode. Then try changing the IV between ** blocks, or in this case, 64K bytes of data. ** */ #include #include #include #include #include #include