C# Class CryptoN.CryptoMonkey

Afficher le fichier Open project: tamimsalem/CryptoN

Méthodes publiques

Méthode Description
CryptoMonkey ( Key key, IV iv, PaddingMode paddingMode = PaddingMode.PKCS7, CipherMode cipherMode = CipherMode.CBC ) : System
Decrypt ( byte data ) : byte[]
DecryptFile ( string encryptedFilePath, string plainOutputPath ) : void
DecryptStream ( Stream encrypted, Stream plain, bool disposeWhenDone ) : void
DecryptString ( string base64String ) : string
Encrypt ( byte data ) : byte[]
EncryptFile ( string plainFilePath, string encryptedOutputPath ) : void
EncryptStream ( Stream plain, Stream encrypted, bool disposeWhenDone ) : void
EncryptString ( string value ) : string
GenerateRandomIv ( AllowedBlockSizes blockSize ) : IV
GenerateRandomKey ( AllowedKeySizes keySize ) : Key

Private Methods

Méthode Description
DecryptFromBytes ( byte encryptedData ) : byte[]
EncryptToBytes ( byte data ) : byte[]
GetAlgorithmObject ( ) : RijndaelManaged
GetDecryptionStrean ( Stream data ) : CryptoStream
GetEncryptingStream ( Stream data ) : CryptoStream

Method Details

CryptoMonkey() public méthode

public CryptoMonkey ( Key key, IV iv, PaddingMode paddingMode = PaddingMode.PKCS7, CipherMode cipherMode = CipherMode.CBC ) : System
key Key
iv IV
paddingMode PaddingMode
cipherMode CipherMode
Résultat System

Decrypt() public méthode

public Decrypt ( byte data ) : byte[]
data byte
Résultat byte[]

DecryptFile() public méthode

public DecryptFile ( string encryptedFilePath, string plainOutputPath ) : void
encryptedFilePath string
plainOutputPath string
Résultat void

DecryptStream() public méthode

public DecryptStream ( Stream encrypted, Stream plain, bool disposeWhenDone ) : void
encrypted Stream
plain Stream
disposeWhenDone bool
Résultat void

DecryptString() public méthode

public DecryptString ( string base64String ) : string
base64String string
Résultat string

Encrypt() public méthode

public Encrypt ( byte data ) : byte[]
data byte
Résultat byte[]

EncryptFile() public méthode

public EncryptFile ( string plainFilePath, string encryptedOutputPath ) : void
plainFilePath string
encryptedOutputPath string
Résultat void

EncryptStream() public méthode

public EncryptStream ( Stream plain, Stream encrypted, bool disposeWhenDone ) : void
plain Stream
encrypted Stream
disposeWhenDone bool
Résultat void

EncryptString() public méthode

public EncryptString ( string value ) : string
value string
Résultat string

GenerateRandomIv() public static méthode

public static GenerateRandomIv ( AllowedBlockSizes blockSize ) : IV
blockSize AllowedBlockSizes
Résultat IV

GenerateRandomKey() public static méthode

public static GenerateRandomKey ( AllowedKeySizes keySize ) : Key
keySize AllowedKeySizes
Résultat Key