C# Class Monobjc.Tools.Generators.FileEncrypter

Wrapper to handle file encryption.
Afficher le fichier Open project: Monobjc/monobjc-tools Class Usage Examples

Méthodes publiques

Méthode Description
Decrypt ( byte content, Aes aes ) : byte[]

Encrypt a byte array by using the AES algorightm.

The input is: [Magic Number (4 bytes)] [AES IV (16 bytes)] [AES(data) (xx bytes)] [HMAC(IV || AES(data)) (32 bytes)]

The output is: [data]

Decrypt ( String inputFile, String outputFile, Aes aes ) : void
DeriveKey ( String seed ) : byte[]

Derives a private key from the given seed.

DeriveKey ( byte content ) : byte[]

Derives a private key from the given content.

Encrypt ( IEnumerable files, String directory, Aes provider ) : bool

Encrypt the specified files into the directory with the given provider.

Encrypt ( IEnumerable files, String directory, String encryptionSeed ) : bool

Encrypt the specified files into the directory with the given encryptionSeed.

Encrypt ( byte content, Aes aes ) : byte[]

Encrypt a byte array by using the AES algorightm.

The input is: [data]

The output is: [Magic Number (4 bytes)] [AES IV (16 bytes)] [AES(data) (xx bytes)] [HMAC(IV || AES(data)) (32 bytes)]

Encrypt ( String inputFile, String outputFile, Aes aes ) : void
FileEncrypter ( ) : System

Initializes a new instance of the ArtworkEncrypter class.

GetProvider ( String encryptionSeed ) : Aes

Returns an AES provider, that use a derivative of the encryption seed as key.

IsEncrypted ( String file ) : bool

Determines if the given file contains an encrypted content.

IsEncrypted ( byte content ) : bool

Determines if the given content contains an encrypted content.

Method Details

Decrypt() public static méthode

Encrypt a byte array by using the AES algorightm.

The input is: [Magic Number (4 bytes)] [AES IV (16 bytes)] [AES(data) (xx bytes)] [HMAC(IV || AES(data)) (32 bytes)]

The output is: [data]

public static Decrypt ( byte content, Aes aes ) : byte[]
content byte
aes System.Security.Cryptography.Aes
Résultat byte[]

Decrypt() public méthode

public Decrypt ( String inputFile, String outputFile, Aes aes ) : void
inputFile String
outputFile String
aes System.Security.Cryptography.Aes
Résultat void

DeriveKey() public static méthode

Derives a private key from the given seed.
public static DeriveKey ( String seed ) : byte[]
seed String
Résultat byte[]

DeriveKey() public static méthode

Derives a private key from the given content.
public static DeriveKey ( byte content ) : byte[]
content byte
Résultat byte[]

Encrypt() public méthode

Encrypt the specified files into the directory with the given provider.
public Encrypt ( IEnumerable files, String directory, Aes provider ) : bool
files IEnumerable
directory String
provider System.Security.Cryptography.Aes
Résultat bool

Encrypt() public méthode

Encrypt the specified files into the directory with the given encryptionSeed.
public Encrypt ( IEnumerable files, String directory, String encryptionSeed ) : bool
files IEnumerable
directory String
encryptionSeed String
Résultat bool

Encrypt() public static méthode

Encrypt a byte array by using the AES algorightm.

The input is: [data]

The output is: [Magic Number (4 bytes)] [AES IV (16 bytes)] [AES(data) (xx bytes)] [HMAC(IV || AES(data)) (32 bytes)]

public static Encrypt ( byte content, Aes aes ) : byte[]
content byte
aes System.Security.Cryptography.Aes
Résultat byte[]

Encrypt() public méthode

public Encrypt ( String inputFile, String outputFile, Aes aes ) : void
inputFile String
outputFile String
aes System.Security.Cryptography.Aes
Résultat void

FileEncrypter() public méthode

Initializes a new instance of the ArtworkEncrypter class.
public FileEncrypter ( ) : System
Résultat System

GetProvider() public static méthode

Returns an AES provider, that use a derivative of the encryption seed as key.
public static GetProvider ( String encryptionSeed ) : Aes
encryptionSeed String
Résultat System.Security.Cryptography.Aes

IsEncrypted() public static méthode

Determines if the given file contains an encrypted content.
public static IsEncrypted ( String file ) : bool
file String
Résultat bool

IsEncrypted() public static méthode

Determines if the given content contains an encrypted content.
public static IsEncrypted ( byte content ) : bool
content byte
Résultat bool