C# Class Cryptid.Crypto

This class contains all the general cryptographic functions for Cryptid
Afficher le fichier Open project: CryptidID/Cryptid

Méthodes publiques

Свойство Type Description
CryptidSalt byte[]
CryptidSaltHash byte[]

Méthodes publiques

Méthode Description
AES_Decrypt ( byte data, string password ) : byte[]

Decrypts a set of data with AES256 CBC. Passwords are hashed with SHA256 and then derived with RFC2898 to get the final key.

AES_Encrypt ( byte data, string password ) : byte[]

Encrypts a set of data with AES256 CBC. Passwords are hashed with SHA256 and then derived with RFC2898 to get the final key.

RSA_Sign ( byte data, RSAParameters privKey ) : byte[]

Signs a set of data with a provided RSA private key

RSA_Verify ( byte data, byte sig, RSAParameters pubKey ) : bool

Verifies an RSA signature for a set of data

Sha256D ( byte toHash ) : byte[]

Double hash a set of data with SHA256

Private Methods

Méthode Description
AES_Decrypt ( byte bytesToBeDecrypted, byte passwordBytes ) : byte[]

Decrypts a set of data with AES256 CBC. Keys are derived with RFC2898.

AES_Encrypt ( byte bytesToBeEncrypted, byte passwordBytes ) : byte[]

Encrypts a set of data with AES256 CBC. Keys are derived with RFC2898.

Method Details

AES_Decrypt() public static méthode

Decrypts a set of data with AES256 CBC. Passwords are hashed with SHA256 and then derived with RFC2898 to get the final key.
public static AES_Decrypt ( byte data, string password ) : byte[]
data byte The data to decrypt
password string The password to decrypt the data
Résultat byte[]

AES_Encrypt() public static méthode

Encrypts a set of data with AES256 CBC. Passwords are hashed with SHA256 and then derived with RFC2898 to get the final key.
public static AES_Encrypt ( byte data, string password ) : byte[]
data byte The data to encrypt
password string The password to encrypt the data with
Résultat byte[]

RSA_Sign() public static méthode

Signs a set of data with a provided RSA private key
public static RSA_Sign ( byte data, RSAParameters privKey ) : byte[]
data byte The data to sign
privKey System.Security.Cryptography.RSAParameters The RSAParameters representing the private key
Résultat byte[]

RSA_Verify() public static méthode

Verifies an RSA signature for a set of data
public static RSA_Verify ( byte data, byte sig, RSAParameters pubKey ) : bool
data byte The data to verify
sig byte The signature to verify with
pubKey System.Security.Cryptography.RSAParameters The public key to use to verify
Résultat bool

Sha256D() public static méthode

Double hash a set of data with SHA256
public static Sha256D ( byte toHash ) : byte[]
toHash byte The data to hash
Résultat byte[]

Property Details

CryptidSalt public_oe static_oe property

The Cryptid salt
public static byte[] CryptidSalt
Résultat byte[]

CryptidSaltHash public_oe static_oe property

A SHA256 hash of the Cryptid salt
public static byte[] CryptidSaltHash
Résultat byte[]