Class CryptoHelper
- Namespace
- Shift.Common
- Assembly
- Shift.Common.dll
public static class CryptoHelper
- Inheritance
-
CryptoHelper
- Inherited Members
-
Methods
DecryptBase64String(string, AutoSaltSizes, string, SymmetricEncryptionAlgorithm)
public static string DecryptBase64String(string password, AutoSaltSizes saltSize, string b64StrData, SymmetricEncryptionAlgorithm algorithm = SymmetricEncryptionAlgorithm.AES_256_CBC)
Parameters
password string
saltSize AutoSaltSizes
b64StrData string
algorithm SymmetricEncryptionAlgorithm
Returns
- string
DecryptBase64String(string, string, string, SymmetricEncryptionAlgorithm)
public static string DecryptBase64String(string password, string salt, string b64StrData, SymmetricEncryptionAlgorithm algorithm = SymmetricEncryptionAlgorithm.AES_256_CBC)
Parameters
password string
salt string
b64StrData string
algorithm SymmetricEncryptionAlgorithm
Returns
- string
DecryptData(string, AutoSaltSizes, byte[], SymmetricEncryptionAlgorithm)
public static byte[] DecryptData(string password, AutoSaltSizes saltSize, byte[] data, SymmetricEncryptionAlgorithm algorithm = SymmetricEncryptionAlgorithm.AES_256_CBC)
Parameters
password string
saltSize AutoSaltSizes
data byte[]
algorithm SymmetricEncryptionAlgorithm
Returns
- byte[]
DecryptData(string, string, byte[], SymmetricEncryptionAlgorithm)
public static byte[] DecryptData(string password, string salt, byte[] data, SymmetricEncryptionAlgorithm algorithm = SymmetricEncryptionAlgorithm.AES_256_CBC)
Parameters
password string
salt string
data byte[]
algorithm SymmetricEncryptionAlgorithm
Returns
- byte[]
DecryptFile(string, AutoSaltSizes, string, string, SymmetricEncryptionAlgorithm)
public static void DecryptFile(string password, AutoSaltSizes saltSize, string inputFileName, string outputFileName, SymmetricEncryptionAlgorithm algorithm = SymmetricEncryptionAlgorithm.AES_256_CBC)
Parameters
password string
saltSize AutoSaltSizes
inputFileName string
outputFileName string
algorithm SymmetricEncryptionAlgorithm
DecryptFile(string, string, string, string, SymmetricEncryptionAlgorithm)
public static void DecryptFile(string password, string salt, string inputFileName, string outputFileName, SymmetricEncryptionAlgorithm algorithm = SymmetricEncryptionAlgorithm.AES_256_CBC)
Parameters
password string
salt string
inputFileName string
outputFileName string
algorithm SymmetricEncryptionAlgorithm
DecryptPassword(string, string)
public static string DecryptPassword(string cipher, string secretKeyPath)
Parameters
cipher string
secretKeyPath string
Returns
- string
DecryptStream(string, AutoSaltSizes, Stream, Stream, SymmetricEncryptionAlgorithm)
public static void DecryptStream(string password, AutoSaltSizes saltSize, Stream inputStream, Stream outputStream, SymmetricEncryptionAlgorithm algorithm = SymmetricEncryptionAlgorithm.AES_256_CBC)
Parameters
password string
saltSize AutoSaltSizes
inputStream Stream
outputStream Stream
algorithm SymmetricEncryptionAlgorithm
DecryptStream(string, string, Stream, Stream, SymmetricEncryptionAlgorithm)
public static void DecryptStream(string password, string salt, Stream inputStream, Stream outputStream, SymmetricEncryptionAlgorithm algorithm = SymmetricEncryptionAlgorithm.AES_256_CBC)
Parameters
password string
salt string
inputStream Stream
outputStream Stream
algorithm SymmetricEncryptionAlgorithm
DecryptStreamWithoutSalt(byte[], byte[], Stream, Stream, SymmetricEncryptionAlgorithm)
public static void DecryptStreamWithoutSalt(byte[] ivBytes, byte[] keyBytes, Stream inputStream, Stream outputStream, SymmetricEncryptionAlgorithm algorithm = SymmetricEncryptionAlgorithm.AES_256_CBC)
Parameters
ivBytes byte[]
keyBytes byte[]
inputStream Stream
outputStream Stream
algorithm SymmetricEncryptionAlgorithm
DecryptString(string, AutoSaltSizes, string, SymmetricEncryptionAlgorithm)
public static string DecryptString(string password, AutoSaltSizes saltSize, string strData, SymmetricEncryptionAlgorithm algorithm = SymmetricEncryptionAlgorithm.AES_256_CBC)
Parameters
password string
saltSize AutoSaltSizes
strData string
algorithm SymmetricEncryptionAlgorithm
Returns
- string
DecryptString(string, string, string, SymmetricEncryptionAlgorithm)
public static string DecryptString(string password, string salt, string strData, SymmetricEncryptionAlgorithm algorithm = SymmetricEncryptionAlgorithm.AES_256_CBC)
Parameters
password string
salt string
strData string
algorithm SymmetricEncryptionAlgorithm
Returns
- string
EncryptBase64String(string, AutoSaltSizes, string, SymmetricEncryptionAlgorithm)
public static string EncryptBase64String(string password, AutoSaltSizes saltSize, string strData, SymmetricEncryptionAlgorithm algorithm = SymmetricEncryptionAlgorithm.AES_256_CBC)
Parameters
password string
saltSize AutoSaltSizes
strData string
algorithm SymmetricEncryptionAlgorithm
Returns
- string
EncryptBase64String(string, string, string, SymmetricEncryptionAlgorithm)
public static string EncryptBase64String(string password, string salt, string strData, SymmetricEncryptionAlgorithm algorithm = SymmetricEncryptionAlgorithm.AES_256_CBC)
Parameters
password string
salt string
strData string
algorithm SymmetricEncryptionAlgorithm
Returns
- string
EncryptData(string, AutoSaltSizes, byte[], SymmetricEncryptionAlgorithm)
public static byte[] EncryptData(string password, AutoSaltSizes saltSize, byte[] data, SymmetricEncryptionAlgorithm algorithm = SymmetricEncryptionAlgorithm.AES_256_CBC)
Parameters
password string
saltSize AutoSaltSizes
data byte[]
algorithm SymmetricEncryptionAlgorithm
Returns
- byte[]
EncryptData(string, string, byte[], SymmetricEncryptionAlgorithm)
public static byte[] EncryptData(string password, string salt, byte[] data, SymmetricEncryptionAlgorithm algorithm = SymmetricEncryptionAlgorithm.AES_256_CBC)
Parameters
password string
salt string
data byte[]
algorithm SymmetricEncryptionAlgorithm
Returns
- byte[]
EncryptFile(string, AutoSaltSizes, string, string, SymmetricEncryptionAlgorithm)
public static void EncryptFile(string password, AutoSaltSizes saltSize, string inputFileName, string outputFileName, SymmetricEncryptionAlgorithm algorithm = SymmetricEncryptionAlgorithm.AES_256_CBC)
Parameters
password string
saltSize AutoSaltSizes
inputFileName string
outputFileName string
algorithm SymmetricEncryptionAlgorithm
EncryptFile(string, string, string, string, SymmetricEncryptionAlgorithm)
public static void EncryptFile(string password, string salt, string inputFileName, string outputFileName, SymmetricEncryptionAlgorithm algorithm = SymmetricEncryptionAlgorithm.AES_256_CBC)
Parameters
password string
salt string
inputFileName string
outputFileName string
algorithm SymmetricEncryptionAlgorithm
EncryptPassword(string, string)
public static string EncryptPassword(string password, string secretKeyPath)
Parameters
password string
secretKeyPath string
Returns
- string
EncryptStream(string, AutoSaltSizes, Stream, Stream, SymmetricEncryptionAlgorithm)
public static void EncryptStream(string password, AutoSaltSizes saltSize, Stream inputStream, Stream outputStream, SymmetricEncryptionAlgorithm algorithm = SymmetricEncryptionAlgorithm.AES_256_CBC)
Parameters
password string
saltSize AutoSaltSizes
inputStream Stream
outputStream Stream
algorithm SymmetricEncryptionAlgorithm
EncryptStream(string, string, Stream, Stream, SymmetricEncryptionAlgorithm)
public static void EncryptStream(string password, string salt, Stream inputStream, Stream outputStream, SymmetricEncryptionAlgorithm algorithm = SymmetricEncryptionAlgorithm.AES_256_CBC)
Parameters
password string
salt string
inputStream Stream
outputStream Stream
algorithm SymmetricEncryptionAlgorithm
EncryptString(string, AutoSaltSizes, string, SymmetricEncryptionAlgorithm)
public static string EncryptString(string password, AutoSaltSizes saltSize, string strData, SymmetricEncryptionAlgorithm algorithm = SymmetricEncryptionAlgorithm.AES_256_CBC)
Parameters
password string
saltSize AutoSaltSizes
strData string
algorithm SymmetricEncryptionAlgorithm
Returns
- string
EncryptString(string, string, string, SymmetricEncryptionAlgorithm)
public static string EncryptString(string password, string salt, string strData, SymmetricEncryptionAlgorithm algorithm = SymmetricEncryptionAlgorithm.AES_256_CBC)
Parameters
password string
salt string
strData string
algorithm SymmetricEncryptionAlgorithm
Returns
- string