Class SymmetricCipher
Defines a class that simplifies the use of symmetric cryptographic service providers.
Inheritance
System.Object
SymmetricCipher
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Juhta.Net.Common
Assembly: Juhta.Net.dll
Syntax
public class SymmetricCipher
Constructors
| Improve this Doc View SourceSymmetricCipher()
Initializes a new instance.
Declaration
public SymmetricCipher()
Remarks
Instances created with this constructor use the System.Security.Cryptography.TripleDES algorithm.
SymmetricCipher(SymmetricAlgorithm)
Initializes a new instance.
Declaration
public SymmetricCipher(SymmetricAlgorithm symmetricAlgorithm)
Parameters
Type | Name | Description |
---|---|---|
System.Security.Cryptography.SymmetricAlgorithm | symmetricAlgorithm | Specifies a System.Security.Cryptography.SymmetricAlgorithm object. |
Methods
| Improve this Doc View SourceDecryptData(String, Byte[])
Decrypts a specified array of bytes containing encrypted data.
Declaration
public byte[] DecryptData(string cipherKey, byte[] encryptedData)
Parameters
Type | Name | Description |
---|---|---|
System.String | cipherKey | Specifies a cipher key. |
System.Byte[] | encryptedData | Specifies an array of bytes containing encrypted data. |
Returns
Type | Description |
---|---|
System.Byte[] | Returns an array of bytes containing the plain data. |
EncryptData(String, Byte[])
Encrypts a specified array of bytes containing plain data.
Declaration
public byte[] EncryptData(string cipherKey, byte[] plainData)
Parameters
Type | Name | Description |
---|---|---|
System.String | cipherKey | Specifies a cipher key. |
System.Byte[] | plainData | Specifies an array of bytes containing plain data. |
Returns
Type | Description |
---|---|
System.Byte[] | Returns an array of bytes containing the encrypted data. |