//Create private keys for each person
EcdhPrivateKey johnsSecretKey = new EcdhPrivateKey();
EcdhPrivateKey janesSecretKey = new EcdhPrivateKey();
//Get the public keys
string johnsPublicKey = johnsSecretKey.GetPublicKey().PublicKeyString;
string janesPublicKey = janesSecretKey.GetPublicKey().PublicKeyString;
Console.WriteLine("John's Public Key");
Console.WriteLine(johnsPublicKey);
Console.WriteLine("Janes's Public Key");
Console.WriteLine(janesPublicKey);
//Get the shared key (these will calculate the same)
string johnsSharedKey = johnsSecretKey.GetSharedSecretKey(new EcdhPublicKey(janesPublicKey)).SharedKeyString;
string janesSharedKey = janesSecretKey.GetSharedSecretKey(new EcdhPublicKey(johnsPublicKey)).SharedKeyString;
Console.WriteLine("John's Shared Key");
Console.WriteLine(johnsSharedKey);
Console.WriteLine("Janes's Shared Key");
Console.WriteLine(janesSharedKey);
Encryption encryption = new Encryption(); //Trial Mode
//Encryption encryption = new Encryption("place user name here", "place license key here"); //License Mode
const string unencryptedString = "This is the input";
Console.WriteLine("The unencrypted string: {0}", unencryptedString);
string encryptedString = encryption.EncryptString(EncryptionProvider.Rijndael, johnsSharedKey, unencryptedString);
Console.WriteLine("The encrypted string: {0}", encryptedString);
string decryptedString = encryption.DecryptString(EncryptionProvider.Rijndael, janesSharedKey, encryptedString);
Console.WriteLine("The decrypted string: {0}", decryptedString);