Menu

Home

John Henry Carandang

Crypton: a Hybrid Cryptosystem with Steganography DLL


A library written in C# to encrypt a text message and embed it in an image, or decrypt an image to get the text message.

Project Members:



Algorithms


The library uses 3 algorithms:
* Rijndael Algorithm to encrypt or decrypt the text message.
* RSA Algorithm to encrypt or decrypt the symmetric key.
* LSB Substitution to embed or extract the text message in the image.


Initialize the library


To Initialize the library

  1. Add a reference of the library in the current project.
  2. Initialize an instance of the "Crypton" Class.
  3. Call the "GenerateKeyPair" function, supply it with 2 distinct prime numbers to generate the public and private keys.
  4. To get the generated Public Key call the "GetPublicKey" function.
  5. To get the generated Private Key call the "GetPrivateKey" function.
  6. The library is now ready to encrypt the text message into an image, or decrypt the image to get the text message.
Crypton classVar = new Crypton();
classVar.GenerateKeyPair(int param1, int param2);
int[] var = classVar.GetPublicKey();
int[] var = classVar.GetPublicKey();

Encrypt Function


To use the "Encrypt" function

Call the "Encrypt" function and supply it with 5 values, a String value for the text message, a String value for the symmetric key, a Bitmap value for the image that will contain the text message, an Int[] Array for the public key, and a String value for the output parameter encrypted key respectively.

Crypton classVar = new Crypton();
classVar.GenerateKeyPair(61, 53);

string message = "Sample Text";
string key = "Sample Key";
Bitmap img = new Bitmap("myImage.jpg");
int[] publicKey = classVar.GetPublicKey();
string encryptedKey;

Bitmap stegoImage = classVar.Encrypt(message, key, img, publicKey, encryptedKey);

Decrypt Function


To use the "Decrypt" function

Call the "Decrypt" function and supply it with 3 values, a Bitmap value for the image that contains the text message, a String value for the encrypted key, and an Int[] Array for the Private key respectively.

Crypton classVar = new Crypton();
classVar.GenerateKeyPair(61, 53);
int[] privateKey = classVar.GetPrivateKey();
Bitmap img = new Bitmap("stegoImage.jpg");
string encryptedKey = "*&&(*^(@^$&@*#";

string decryptedMessage = classVar.Decrypt(img, encryptedKey, privateKey);