C# Class StreamCryptor.Model.EncryptedFileHeader

Show file Open project: bitbeans/StreamCryptor Class Usage Examples

Private Properties

Property Type Description

Public Methods

Method Description
EncryptedFileHeader ( ) : System

Initialize the EncryptedFileHeader for decryption.

Used for decryption.

EncryptedFileHeader ( int currentVersion, int nonceLength, int chunkBaseNonceLength, long unencryptedFileLength, byte senderPrivateKey, byte senderPublicKey, byte recipientPublicKey ) : System

Initialize the EncryptedFileHeader for encryption.

ProtectFileName ( string fileName, int fileNameLength ) : void

Encrypts the file name.

SetHeaderChecksum ( int headerChecksumLength ) : void

Sets the header checksum.

ValidateHeaderChecksum ( byte ephemeralKey, int headerChecksumLength ) : void

Validates the header checksum.

Method Details

EncryptedFileHeader() public method

Initialize the EncryptedFileHeader for decryption.
Used for decryption.
public EncryptedFileHeader ( ) : System
return System

EncryptedFileHeader() public method

Initialize the EncryptedFileHeader for encryption.
public EncryptedFileHeader ( int currentVersion, int nonceLength, int chunkBaseNonceLength, long unencryptedFileLength, byte senderPrivateKey, byte senderPublicKey, byte recipientPublicKey ) : System
currentVersion int The StreamCryptor version.
nonceLength int The length which nonces will be generated.
chunkBaseNonceLength int The length of the base nonce.
unencryptedFileLength long The length of unencrypted file.
senderPrivateKey byte The senders private key.
senderPublicKey byte The senders public key.
recipientPublicKey byte The recipient public key.
return System

ProtectFileName() public method

Encrypts the file name.
public ProtectFileName ( string fileName, int fileNameLength ) : void
fileName string The file name.
fileNameLength int The length it will be filled up.
return void

SetHeaderChecksum() public method

Sets the header checksum.
public SetHeaderChecksum ( int headerChecksumLength ) : void
headerChecksumLength int The length of the checksum.
return void

ValidateHeaderChecksum() public method

Validates the header checksum.
public ValidateHeaderChecksum ( byte ephemeralKey, int headerChecksumLength ) : void
ephemeralKey byte A 64 byte key.
headerChecksumLength int The length of the checksum.
return void