Friday, December 30, 2016

Encrypting files with the Simon Cipher in CBC

Until last week, there was a single problem from the PWL generation side with simontool, and it is that it does not make assumptions of how the initial state of the keys is set. Well, now I can add how the XOR for CBC stream encryption is done.
If you want to use simontool to encrypt a file, you should first look at my post of encrypting files with the simon cipher because of the quirks with the keys. The default behavior is ECB, but the -m flag now allows CBC behavior. The CBC mode is included in the file header. An example of the encryption is:
Encrypt the file, testfile.txt:
simontool -e -m cbc -b 128 -k 128 -s 0f0e0d0c0b0a09080706050403020100 -i testfile.txt -o testfile.simon
Decrypt the file testfile.simon, use the expanded key:
simontool.elf -d -b 128 -k 128 -s 6413494fda72360d1cb8547cd58c4df9 -i testfile.simon -o testfile.txt

No comments:

Post a Comment