Net Encryption Library
InitializationVector Property
Example 






KellermanSoftware.NetEncryptionLibrary Namespace > Encryption Class : InitializationVector Property
Initialization Vector for Encryption
Syntax
'Declaration
 
Public Property InitializationVector As System.String
'Usage
 
Dim instance As Encryption
Dim value As System.String
 
instance.InitializationVector = value
 
value = instance.InitializationVector
public System.string InitializationVector {get; set;}
public read-write property InitializationVector: System.String; 
public function get,set InitializationVector : System.String
public: __property System.string* get_InitializationVector();
public: __property void set_InitializationVector( 
   System.string* value
);
public:
property System.String^ InitializationVector {
   System.String^ get();
   void set (    System.String^ value);
}
Example
Encryption encryption = new Encryption(); //Trial Mode
//Encryption encryption = new Encryption("place user name here", "place license key here"); //License Mode
 
//Change the initialization vector
encryption.InitializationVector = "This is an initialization vector";
 
const string password = "MyPassword";
const string unencryptedString = "This is the input";
Console.WriteLine("The unencrypted string: {0}", unencryptedString);
 
string encryptedString = encryption.EncryptString(EncryptionProvider.Rijndael, password, unencryptedString);
Console.WriteLine("The encrypted string: {0}", encryptedString);
 
string decryptedString = encryption.DecryptString(EncryptionProvider.Rijndael, password, encryptedString);
Console.WriteLine("The deencrypted string: {0}", decryptedString);
Dim encryption As New Encryption() 'Trial Mode
'Dim encryption As New Encryption("place user name here", "place license key here") 'License Mode
 
'Change the initialization vector
encryption.InitializationVector = "This is an initialization vector"
 
Const password As String = "MyPassword"
Const unencryptedString As String = "This is the input"
Console.WriteLine("The unencrypted string: {0}", unencryptedString)
 
Dim encryptedString As String = encryption.EncryptString(EncryptionProvider.Rijndael, password, unencryptedString)
Console.WriteLine("The encrypted string: {0}", encryptedString)
 
Dim decryptedString As String = encryption.DecryptString(EncryptionProvider.Rijndael, password, encryptedString)
Console.WriteLine("The deencrypted string: {0}", decryptedString)
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

Encryption Class
Encryption Members