ICipher

Namespace: ORA.API.Encryption

An object capable of Encrypting data or Decrypting data that has been previously encrypted with the same algorithm.

Examples

The following code will print the value true.

ICipher cipher = ...;
byte[] data = ...;
byte[] encrypted = cipher.Encrypt(data);
            
Console.WriteLine(cipher.Decrypt(encrypted).Equals(data));

Methods

Encrypt(System.Byte[] data)

Encrypts the given data following a specific algorithm.

Parameters

data System.Byte[]

The data to encrypt

Returns

The encrypted data

Decrypt(System.Byte[] data)

Decrypts the given data if it has previously been encrypted using the same algorithm.

Parameters

data System.Byte[]

The data to decrypt

Returns

The Decrypted data