|
|
|
|
Crypt Package Documentation
To make it easiest for use, both components has the same methods names. Crypt package contains .NET components that can be used for encryption and decryption of strings or files. Components contains these methods:
-
EncryptString(OriginalString As String, Password As String) - this method can be used to encrypt string. There are two method parameters: original is string that need to be encrypt, and password.
-
DecryptString(EncryptedString As String, Password As String) - this method can be used to decrypt a string. There are two method parameters: encryptedString and password. You must provide the same password for encription and decription if you want to get original string.
-
EncryptFile(String OriginalFile, String EncryptedFile, String Password)
this method can be used to encrypt a file. We need to specify path to original file, file path where to place encrypted file and password
-
DecryptFile(String EncryptedFile, String OriginalFile, String Password)
this method can be used to get back a encrypted file. Of course, you must use the same password like when file was encrypted.
Code sample:
This sample show how to use Crypt Component to protect sensitive string data.
// C# code sample
BeanSoftware.Components.CommonCrypt MyCript = new BeanSoftware.Components.CommonCrypt();
String SecretText = "This is very confidental string";
String Password = "Tfedoll3455SQLdd";
String EncodedText;
String DecodedText;
// To encrypt the SecretText we use Encrypt method
EncodedText = MyCrypt.Encrypt(SecretText, Password);
// To get original string back, use Decrypt method
DecodedText = MyCrypt.Decrypt(EncodedText, Password);
'VB.NET code sample
Dim MyCript As BeanSoftware.Components.CommonCrypt = New _ BeanSoftware.Components.CommonCrypt()
Dim SecretText As String = "This is very confidental string"
Dim Password As String = "Tfedoll3455SQLdd"
Dim EncodedText As String
Dim DecodedText As String
' To encrypt the SecretText we use Encrypt method
EncodedText = MyCrypt.Encrypt(SecretText, Password)
' To get original string back, use Decrypt method
DecodedText = MyCrypt.Decrypt(EncodedText, Password)
If you have ANY question about Crypt package please feel free to send us e-mail to info@beansoftware.com
|
|