Class Sec
- Namespace
- Tripous
- Assembly
- Tripous.dll
Provides security helper functions for password hashing, key derivation and encryption.
public static class Sec
- Inheritance
-
Sec
- Inherited Members
Methods
CreateSalt()
Creates a cryptographically secure random salt value.
public static string CreateSalt()
Returns
Decrypt(string, string, string, int)
Decrypts a Base64 encoded encrypted string and returns the original plain text.
public static string Decrypt(string CipherTextBase64, string PasswordPlainText, string SaltBase64, int Iterations)
Parameters
Returns
DeriveKey(string, string, int)
Derives an encryption key from a password.
public static byte[] DeriveKey(string PasswordPlainText, string SaltBase64, int Iterations)
Parameters
Returns
- byte[]
Encrypt(string, string, string, int)
Encrypts a plain text string and returns a Base64 encoded result.
public static string Encrypt(string PlainText, string PasswordPlainText, string SaltBase64, int Iterations)
Parameters
Returns
HashPassword(string, string, int)
Creates a password hash using PBKDF2.
public static string HashPassword(string PasswordPlainText, string SaltBase64, int Iterations)
Parameters
Returns
VerifyPassword(string, string, string, int)
Verifies that a password matches a stored hash.
public static bool VerifyPassword(string PasswordPlainText, string PasswordHashBase64, string SaltBase64, int Iterations)