Block-ciphers
Block ciphers
In order to understand hex and type parameters read Hash
In order to understand encryption and decryption read Stream
AES
Description: Block cipher and AES winner.
Key:128, 192, 256 bits.
Iv: 128 bits.
Uses: General propuse, Performance is impportant, FIPS 197, NIST.
RC6
Description: Block cipher and AES finalist.
Key: 128, 192, 256 bits.
Iv: 128 bits.
Uses: General propuse, alternative to AES.
MARS
Description: Block cipher and AES finalist.
Key: 128, 192, 256 bits.
Iv: 128 bits.
Uses: General propuse, alternative to AES.
Twofish
Description: Block cipher and AES finalist.
Key: 128, 192, 256 bits.
Iv: 128 bits.
Uses: General propuse, alternative to AES.
Serpent
Description: Block cipher and AES finalist.
Key: 128, 192, 256 bits.
Iv: 128 bits.
Uses: General propuse, alternative to AES.
CAST-256
Description: Block cipher and AES finalist.
Key: 256 bits.
Iv: 128 bits.
Uses: General propuse, alternative to AES.
Camellia
Description: Block cipher, The cipher has been approved for use by the ISO/IEC, the European Union's NESSIE project, the Japanese CRYPTREC.
Key: 128, 192, 256 bits.
Iv: 128 bits.
Uses: General propuse, alternative to AES.
Speck128
Key: 128, 192, 256 bits.
Iv: 128 bits.
Uses: IoT
Simeck64
Key: 128 bits.
Iv: 64 bits.
Uses: IoT
Modes of Operation
CTR
Description: Block cipher mode
Uses: Performance is important.
GCM
Description: Block cipher mode
Uses: Authenticated encryption.
It only support "type":"string"
It doesn't support "algorithm":"SIMECK64"
How to ???
In this example we encrypt and decrypt Hello world! string using AES with the key and iv given in CTR mode.
On datajs["algorithm"] can be one of {AES, RC6, MARS, Twofish, SERPENT, CAST256, CAMELLIA, SPECK128, SIMECK64 }_
In this example we encrypt and decrypt Hello world! string using AES with the key,iv,adata given in GCM mode.
On datajs["algorithm"] can be one of {AES, RC6, MARS, Twofish, SERPENT, CAST256, CAMELLIA, SPECK128}_
Json to enc string (key and iv depends on algorithm you chose) in CTR mode
Json to dec string (key and iv depends on algorithm you chose) in CTR mode
To enc/dec a file you need to change "type":"string" -> "type":"file" , "plaintext": "your hex enc string " -> "file":"your file"
To use enc/dec GCM mode you need to change "mode":"ctr"->"mode":"gcm" , add "adata":"your string" and "hex" parameters
"hex" parameter apply for "string" and "adata" parameter
Last updated