Skip to content

Encryption

Greg Finzer edited this page Sep 26, 2018 · 3 revisions

C# Example

Encryption encryption = new Encryption();
             
string creditCardNumber = "4444333322221111";
byte[] inputBytes = Encoding.UTF8.GetBytes(creditCardNumber);
string password = "&%)(&JUI";
 
byte[] encrypted = encryption.EncryptBytes(inputBytes, password);
byte[] decrypted = encryption.DecryptBytes(encrypted, password);
string decryptedCreditCardNumber = System.Text.Encoding.UTF8.GetString(decrypted);

VB.NET Example

Dim encryption As New Encryption()
             
Dim creditCardNumber As String = "4444333322221111"
Dim inputBytes() As Byte = Encoding.UTF8.GetBytes(creditCardNumber)
Dim password As String = "&%)(&JUI"
 
Dim encrypted() As Byte = encryption.EncryptBytes(inputBytes, password)
Dim decrypted() As Byte = encryption.DecryptBytes(encrypted, password)

Dim outputString As String = System.Text.Encoding.UTF8.GetString(decrypted)

Clone this wiki locally