C# Класс Cryptid.Crypto

This class contains all the general cryptographic functions for Cryptid
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
CryptidSalt byte[]
CryptidSaltHash byte[]

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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.

Описание методов

AES_Decrypt() публичный статический Метод

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
Результат byte[]

AES_Encrypt() публичный статический Метод

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
Результат byte[]

RSA_Sign() публичный статический Метод

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
Результат byte[]

RSA_Verify() публичный статический Метод

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
Результат bool

Sha256D() публичный статический Метод

Double hash a set of data with SHA256
public static Sha256D ( byte toHash ) : byte[]
toHash byte The data to hash
Результат byte[]

Описание свойств

CryptidSalt публичное статическое свойство

The Cryptid salt
public static byte[] CryptidSalt
Результат byte[]

CryptidSaltHash публичное статическое свойство

A SHA256 hash of the Cryptid salt
public static byte[] CryptidSaltHash
Результат byte[]