SevenZipAESEncryptionSettings

SevenZipAESEncryptionSettings constructor (1 of 2)

Initializes a new instance of the SevenZipAESEncryptionSettings class.

public SevenZipAESEncryptionSettings(string password)
ParameterTypeDescription
passwordStringPassword for encryption or decryption.

Examples

using (var archive = new SevenZipArchive(new SevenZipEntrySettings(null, new SevenZipAESEncryptionSettings("p@s$"))))
{
   archive.CreateEntry("data.bin", "data.bin");
   archive.Save("archive.7z");
}

See Also


SevenZipAESEncryptionSettings constructor (2 of 2)

Initializes a new instance of the SevenZipAESEncryptionSettings class with external cipher.

public SevenZipAESEncryptionSettings(SevenZipCipher cipher)
ParameterTypeDescription
cipherSevenZipCipherCustom AES implementation.

Examples

SevenZipCipher cipher = ComposeMyCipher();
using (var archive = new SevenZipArchive(new SevenZipEntrySettings(null, new SevenZipAESEncryptionSettings(cipher))))
{
   archive.CreateEntry("data.bin", "data.bin");
   archive.Save("archive.7z");
}

See Also