The FPEKELL1 Format Preserving Encryption Cipher has the following features:
How the encryption is performed
Encryption encryption = new Encryption(); //Trial Mode
//Encryption encryption = new Encryption("place user name here", "place license key here"); //License Mode
//Create a key. Save the key somewhere
string key = encryption.GenerateKey(EncryptionProvider.FPEKELL1);
Console.WriteLine("key:");
Console.WriteLine(key);
Console.WriteLine();
const string plain = "The quick brown fox jumps over the lazy dog.";
Console.WriteLine("plain: " + plain);
Console.WriteLine("plain.Length: " + plain.Length);
Console.WriteLine();
//Encrypt. The encrypted string will have the same length and it will always be in the printable character range
string encrypted = encryption.EncryptString(EncryptionProvider.FPEKELL1, key, plain);
Console.WriteLine("encrypted: " + encrypted);
Console.WriteLine("encrypted.Length: " + encrypted.Length);
Console.WriteLine();
string decrypted = encryption.DecryptString(EncryptionProvider.FPEKELL1, key, encrypted);
Console.WriteLine("decrypted: " + decrypted);
Console.WriteLine("decrypted.Length: " + decrypted.Length);
Dim encryption As New Encryption() 'Trial Mode
'Encryption encryption = new Encryption("place user name here", "place license key here"); //License Mode
'Create a key. Save the key somewhere
Dim key As String = encryption.GenerateKey(EncryptionProvider.FPEKELL1)
Console.WriteLine("key:")
Console.WriteLine(key)
Console.WriteLine()
Const plain As String = "The quick brown fox jumps over the lazy dog."
Console.WriteLine("plain: " & plain)
Console.WriteLine("plain.Length: " & plain.Length)
Console.WriteLine()
'Encrypt. The encrypted string will have the same length and it will always be in the printable character range
Dim encrypted As String = encryption.EncryptString(EncryptionProvider.FPEKELL1, key, plain)
Console.WriteLine("encrypted: " & encrypted)
Console.WriteLine("encrypted.Length: " & encrypted.Length)
Console.WriteLine()
Dim decrypted As String = encryption.DecryptString(EncryptionProvider.FPEKELL1, key, encrypted)
Console.WriteLine("decrypted: " & decrypted)
Console.WriteLine("decrypted.Length: " & decrypted.Length)