Net Encryption Library
CipherMethod Property
Example 






KellermanSoftware.NetEncryptionLibrary Namespace > Encryption Class : CipherMethod Property
Support CBC or ECB Cipher Modes for Rijandael or Twofish. The default is CBC (reccommended)
Syntax
'Declaration
 
Public Property CipherMethod As System.Security.Cryptography.CipherMode
'Usage
 
Dim instance As Encryption
Dim value As System.Security.Cryptography.CipherMode
 
instance.CipherMethod = value
 
value = instance.CipherMethod
public System.Security.Cryptography.CipherMode CipherMethod {get; set;}
public read-write property CipherMethod: System.Security.Cryptography.CipherMode; 
public function get,set CipherMethod : System.Security.Cryptography.CipherMode
public: __property System.Security.Cryptography.CipherMode get_CipherMethod();
public: __property void set_CipherMethod( 
   System.Security.Cryptography.CipherMode value
);
public:
property System.Security.Cryptography.CipherMode CipherMethod {
   System.Security.Cryptography.CipherMode get();
   void set (    System.Security.Cryptography.CipherMode value);
}
Example
Encryption encryption = new Encryption(); //Trial Mode
//Encryption encryption = new Encryption("place user name here", "place license key here"); //License Mode
 
//Change the Cipher mode to ECB
encryption.CipherMethod = System.Security.Cryptography.CipherMode.ECB;
 
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 Cipher mode to ECB
encryption.CipherMethod = System.Security.Cryptography.CipherMode.ECB
 
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