Uploaded October 2019 | Updated November 2026, 2 days ago
#cryptology, #cryptography, #cryptanalysis
In this video, we show how to develop a new CrypTool 2 component from the scratch. You need: Visual Studio 2019 Community Edition, the CrypTool 2 component template for Visual Studio, and the CrypTool 2 source code. How to get all of these, please have a look at video 1 of this series (youtube.com/watch?v=YaSd_4t19nk&list=PLMuvAbyIl0PTTfPE2VhJ9PZ6qlOG0MMaX) if not already done.
-------------------------
Hint: (update 01 oct 2020):
There is a problem when using the standard modulo operator of .net/C#. It may return negative numbers, which the math. operator does not. Therefore, we have to "fix" it using a method implementing the math. operator. So replace % in your code by the following method call:
private int Mod(int a, int b)
{
if(a GREATER_OR_EQUAL 0) // youtube does not allow the greater parenthesis symbol here;
{ return a % b; }
else
{ return ((a % b) + b) % b; }
}
-------------------------
Check list:
-------------------------
Step 1: Create new plugin project (using the plugin template in Visual Studio 2019)
Step 2: Rename plugin class file and rename settings class file
Step 3: Adapt plugin class attributes
Step 4: Create input properties (A, B, Input) and an output property (Output)
Step 5: Adapt and rename settings class : We need a way to switch between encryption and decryption action
Step 6: Implement Execution() method in plugin class (and needed helper methods)
Step 7: Compile and then test everything in CrypTool 2
Affine cipher definitions:
-------------------------
Encryption: C = (A * P + B) mod M
Decryption: P = (A^-1 * (C - B)) mod M
where
C is a ciphertext symbol as integer,
P is a plaintext symbol as integer,
M is the modulus,
A and B are integers (keys of the cipher),
A^-1 is the modular multiplicative inverse of A modulo M
In our case M = 26 since our alphabet is the Latin alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ" which has length 26
Like what I do ๐? Help fuel my crypto obsession ๐ โ buy me a coffee hereโโ thx: buymeacoffee.com/cryptographyforeverybody
#cryptology, #cryptography, #cryptanalysis
In this video, we show how to develop a new CrypTool 2 component from the scratch. You need: Visual Studio 2019 Community Edition, the CrypTool 2 component template for Visual Studio, and the CrypTool 2 source code. How to get all of these, please have a look at video 1 of this series (youtube.com/watch?v=YaSd_4t19nk&list=PLMuvAbyIl0PTTfPE2VhJ9PZ6qlOG0MMaX) if not already done.
-------------------------
Hint: (update 01 oct 2020):
There is a problem when using the standard modulo operator of .net/C#. It may return negative numbers, which the math. operator does not. Therefore, we have to "fix" it using a method implementing the math. operator. So replace % in your code by the following method call:
private int Mod(int a, int b)
{
if(a GREATER_OR_EQUAL 0) // youtube does not allow the greater parenthesis symbol here;
{ return a % b; }
else
{ return ((a % b) + b) % b; }
}
-------------------------
Check list:
-------------------------
Step 1: Create new plugin project (using the plugin template in Visual Studio 2019)
Step 2: Rename plugin class file and rename settings class file
Step 3: Adapt plugin class attributes
Step 4: Create input properties (A, B, Input) and an output property (Output)
Step 5: Adapt and rename settings class : We need a way to switch between encryption and decryption action
Step 6: Implement Execution() method in plugin class (and needed helper methods)
Step 7: Compile and then test everything in CrypTool 2
Affine cipher definitions:
-------------------------
Encryption: C = (A * P + B) mod M
Decryption: P = (A^-1 * (C - B)) mod M
where
C is a ciphertext symbol as integer,
P is a plaintext symbol as integer,
M is the modulus,
A and B are integers (keys of the cipher),
A^-1 is the modular multiplicative inverse of A modulo M
In our case M = 26 since our alphabet is the Latin alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ" which has length 26
Like what I do ๐? Help fuel my crypto obsession ๐ โ buy me a coffee hereโโ thx: buymeacoffee.com/cryptographyforeverybody










