-
Notifications
You must be signed in to change notification settings - Fork 9
Block ciphers
Karel Kubicek edited this page Jun 25, 2018
·
6 revisions
Block ciphers like AES competition finalists, TLS suite ciphers and some older reference functions like DES.
The API is minimalist, so adding new block ciphers should be easy. We will appreciate your submissions (pull requests) for other functions.
Example of JSON subtree for AES reduced to 3 rounds in ECB that encrypts counter plaintexts.
"stream" : {
"type" : "block",
"init_frequency" : "only_once",
"algorithm" : "AES",
"round" : 3,
"block_size" : 16,
"plaintext" : {
"type" : "counter"
},
"key_size" : 16,
"key" : {
"type" : "pcg32_stream"
},
"encryption_mode" : true
}
-
type
has to beblock
to use block ciphers. -
init_frequency
can be eitheronly_once
or number as string. Number means after how many iterations, the algorithm is initialized with new key. The optiononly_once
means the whole stream will use only single key. -
algorithm
selects used block cipher. See the list of implemented functions for more information. -
round
limits thealgorithm
cipher for given amount of rounds. 0 rounds mean no repetition of the internal loop, but it can still produce randomly looking output because of pre- and post-processing of the data. -
block_size
specifies byte length of the input test vectors to the function. We require the output of this stream to be integer multiple ofblock_size
(ideally equal to it). -
plaintext
is JSON subtree with a stream of the plaintext input to the cipher. Plaintext size has to be multiple ofblock-size
. Allowed values are specified in stream documentation. -
key_size
specifies byte length of the key. -
key
is JSON subtree with a stream of the key used in the cipher. Its size is equal tokey_size
. Allowed values are specified in stream documentation. -
encryption_mode
specifies direction of the cipher - true = encryption, false = decryption.
Getting started
Building notes
Running notes
Recommended scenarios
Configuration file structure
Developer notes
Framework components
Submodules
Third party libraries
Coding guide
Testing
Known bugs
User notes
List of streams
Block ciphers
Stream ciphers
Hash functions
PRNGs
WIP CAESAR
Useful links