메소드 | 설명 | |
---|---|---|
DecryptAesCbc ( byte ciphertext, byte key, byte iv = null, bool checkAndRemoveHmac = false ) : byte[] |
Decrypt a message using AES in CBC (cipher-block chaining) mode.
|
|
DecryptAesCbcEncryptedEcPrivateKey ( byte ecPrivateKeyEncryptedWithAesCbc, byte symmetricKey ) : System.Security.Cryptography.ECDiffieHellmanCng |
Decrypt an EC private key that has been stored encrypted with AES CBC using a private key
|
|
DecryptAesCbcEncryptedPrivateKey ( byte privateKeyEncryptedWithAesCbc, byte symmetricKey ) : IPrivateKey |
Decrypt an EC private key that has been stored encrypted with AES CBC using a private key
|
|
DecryptAescbcutf8 ( byte ciphertext, byte key, byte iv = null, bool checkAndRemoveHmac = false ) : string | ||
EncryptAesCbc ( byte plaintext, byte key, byte iv = null, bool addHmac = false ) : byte[] |
Encrypt a message using AES in CBC (cipher-block chaining) mode.
|
|
EncryptAesCbc ( string plainText, byte key, byte iv = null, bool addHmac = false ) : byte[] | ||
EncryptEcPrivateKeyWithAesCbc ( System.Security.Cryptography.ECDiffieHellmanCng ecPrivateKey, byte symmetricKey ) : byte[] |
Encrypt an EC private key with a symmetric key.
|
|
EncryptPrivateKeyWithAesCbc ( IPrivateKey privateKey, byte symmetricKey ) : byte[] |
Encrypt an EC private key with a symmetric key.
|
|
GenerateNewPrivateKey ( ) : IPrivateKey | ||
GetPublicKeyFromByteArray ( byte publicKeyAsByteArray ) : IPublicKey | ||
KeyGenFromPwd ( string password, byte salt ) : byte[] |
Generate key from hashed password. We will need to use stronger hash later.
|
public static DecryptAesCbc ( byte ciphertext, byte key, byte iv = null, bool checkAndRemoveHmac = false ) : byte[] | ||
ciphertext | byte | The message encrypted with AES in CBC mode |
key | byte | The key used to encrypt the message |
iv | byte | The initialization vector provided, if one was provided. If you are absolutely certain /// the key will only be used once, an IV is not necessary and zero will be used. |
checkAndRemoveHmac | bool | Set if an HMACHSA256 was placed at the end of the plaintext before encrypting. /// The HMAC will be removed before the plaintext is returned. If the HMAC does not match, the method will throw a /// System.Security.Cryptography.CryptographicException. |
리턴 | byte[] |
public static DecryptAesCbcEncryptedEcPrivateKey ( byte ecPrivateKeyEncryptedWithAesCbc, byte symmetricKey ) : System.Security.Cryptography.ECDiffieHellmanCng | ||
ecPrivateKeyEncryptedWithAesCbc | byte | The EC private key encrypted with AES CBC. |
symmetricKey | byte | The symmetric key with which to encrypt the EC key. Must be at least /// 16 bytes. Any additional bytes will be ignored. |
리턴 | System.Security.Cryptography.ECDiffieHellmanCng |
public static DecryptAesCbcEncryptedPrivateKey ( byte privateKeyEncryptedWithAesCbc, byte symmetricKey ) : IPrivateKey | ||
privateKeyEncryptedWithAesCbc | byte | The assymetric private key encrypted with AES CBC. |
symmetricKey | byte | The symmetric key with which to encrypt the EC key. Must be at least /// 16 bytes. Any additional bytes will be ignored. |
리턴 | IPrivateKey |
public static DecryptAescbcutf8 ( byte ciphertext, byte key, byte iv = null, bool checkAndRemoveHmac = false ) : string | ||
ciphertext | byte | |
key | byte | |
iv | byte | |
checkAndRemoveHmac | bool | |
리턴 | string |
public static EncryptAesCbc ( byte plaintext, byte key, byte iv = null, bool addHmac = false ) : byte[] | ||
plaintext | byte | The message (plaintext) to encrypt |
key | byte | An AES key |
iv | byte | The IV to use or null to use a 0 IV |
addHmac | bool | When set, a SHA256-based HMAC (HMAC256) of 32 bytes using the same key is added to the plaintext /// before it is encrypted. |
리턴 | byte[] |
public static EncryptAesCbc ( string plainText, byte key, byte iv = null, bool addHmac = false ) : byte[] | ||
plainText | string | |
key | byte | |
iv | byte | |
addHmac | bool | |
리턴 | byte[] |
public static EncryptEcPrivateKeyWithAesCbc ( System.Security.Cryptography.ECDiffieHellmanCng ecPrivateKey, byte symmetricKey ) : byte[] | ||
ecPrivateKey | System.Security.Cryptography.ECDiffieHellmanCng | The EC private key to encrypt |
symmetricKey | byte | The symmetric key with which to encrypt the EC key. Must be at least /// 16 bytes. Any additional bytes will be ignored. |
리턴 | byte[] |
public static EncryptPrivateKeyWithAesCbc ( IPrivateKey privateKey, byte symmetricKey ) : byte[] | ||
privateKey | IPrivateKey | The EC private key to encrypt |
symmetricKey | byte | The symmetric key with which to encrypt the EC key. Must be at least /// 16 bytes. Any additional bytes will be ignored. |
리턴 | byte[] |
public static GenerateNewPrivateKey ( ) : IPrivateKey | ||
리턴 | IPrivateKey |
public static GetPublicKeyFromByteArray ( byte publicKeyAsByteArray ) : IPublicKey | ||
publicKeyAsByteArray | byte | |
리턴 | IPublicKey |
public static KeyGenFromPwd ( string password, byte salt ) : byte[] | ||
password | string | The password to hash. |
salt | byte | The random salt given to a password to prevent cross-account cracking. |
리턴 | byte[] |