C# Class MobileKidsIdApp.DataAccess.Encryption

Mostrar archivo Open project: HTBox/MobileKidsIdApp

Public Methods

Method Description
CreateDerivedKey ( string password, byte salt, int keyLengthInBytes = 32, int iterations = 1000 ) : byte[]
Decrypt ( byte keyMaterial, byte cipherText ) : byte[]
Decrypt ( string key, string data ) : string

Accepts a plaintext key and Base64 encoded data blob and returns decrypted plaintext.

Encrypt ( byte keyMaterial, byte data ) : byte[]
Encrypt ( string key, string data ) : string

Accepts plaintext key and plaintext data and returns a Base64 encoded encrpyted blob.

Method Details

CreateDerivedKey() public static method

public static CreateDerivedKey ( string password, byte salt, int keyLengthInBytes = 32, int iterations = 1000 ) : byte[]
password string
salt byte
keyLengthInBytes int
iterations int
return byte[]

Decrypt() public static method

public static Decrypt ( byte keyMaterial, byte cipherText ) : byte[]
keyMaterial byte
cipherText byte
return byte[]

Decrypt() public static method

Accepts a plaintext key and Base64 encoded data blob and returns decrypted plaintext.
public static Decrypt ( string key, string data ) : string
key string
data string
return string

Encrypt() public static method

public static Encrypt ( byte keyMaterial, byte data ) : byte[]
keyMaterial byte
data byte
return byte[]

Encrypt() public static method

Accepts plaintext key and plaintext data and returns a Base64 encoded encrpyted blob.
public static Encrypt ( string key, string data ) : string
key string
data string
return string