Table of Contents

Class EncryptionHelper

Namespace
Shift.Common
Assembly
Shift.Common.dll
public static class EncryptionHelper
Inheritance
EncryptionHelper
Inherited Members

Methods

ComputeHashMd5(byte[], byte[])

public static byte[] ComputeHashMd5(byte[] value, byte[] salt = null)

Parameters

value byte[]
salt byte[]

Returns

byte[]

ComputeHashMd5(string, byte[])

public static byte[] ComputeHashMd5(string value, byte[] salt = null)

Parameters

value string
salt byte[]

Returns

byte[]

ComputeHashSha256(byte[], byte[])

public static byte[] ComputeHashSha256(byte[] value, byte[] salt = null)

Parameters

value byte[]
salt byte[]

Returns

byte[]

ComputeHashSha256(string, byte[])

public static byte[] ComputeHashSha256(string value, byte[] salt = null)

Parameters

value string
salt byte[]

Returns

byte[]

Decode(byte[], int, int, byte[], Func<Stream, object>)

public static object Decode(byte[] data, int dataOffset, int dataLength, byte[] keyHash, Func<Stream, object> read)

Parameters

data byte[]
dataOffset int
dataLength int
keyHash byte[]
read Func<Stream, object>

Returns

object

Decode(byte[], int, int, string, byte[], Func<Stream, object>)

public static object Decode(byte[] data, int dataOffset, int dataLength, string key, byte[] salt, Func<Stream, object> read)

Parameters

data byte[]
dataOffset int
dataLength int
key string
salt byte[]
read Func<Stream, object>

Returns

object

Encode(byte[], Action<Stream>)

public static byte[] Encode(byte[] keyHash, Action<Stream> write)

Parameters

keyHash byte[]
write Action<Stream>

Returns

byte[]

Encode(string, byte[], Action<Stream>)

public static byte[] Encode(string key, byte[] salt, Action<Stream> write)

Parameters

key string
salt byte[]
write Action<Stream>

Returns

byte[]

EncodeXor(byte[], byte[])

public static byte[] EncodeXor(byte[] data, byte[] key)

Parameters

data byte[]
key byte[]

Returns

byte[]

GenerateSalt(int)

public static byte[] GenerateSalt(int size)

Parameters

size int

Returns

byte[]

GetBytes(string)

public static byte[] GetBytes(string str)

Parameters

str string

Returns

byte[]

GetPaddingMode(PaddingMode)

public static PaddingMode GetPaddingMode(PaddingMode paddingModes)

Parameters

paddingModes PaddingMode

Returns

PaddingMode

GetString(byte[])

public static string GetString(byte[] bytes)

Parameters

bytes byte[]

Returns

string

GetSymmetricAlgorithm(SymmetricEncryptionAlgorithm)

public static SymmetricAlgorithm GetSymmetricAlgorithm(SymmetricEncryptionAlgorithm cryptoAlg)

Parameters

cryptoAlg SymmetricEncryptionAlgorithm

Returns

SymmetricAlgorithm