Class EncryptionPasswordRule
- Namespace
- Archiver.Core.Services
- Assembly
- Archiver.Core.dll
T-F193: which passwords Pakko accepts when creating an AES-256 ZIP. Public so every frontend can refuse bad input inside its own prompt with localized text, while ArchiveAsync(ArchiveOptions, IProgress<ProgressReport>?, CancellationToken) enforces the same rule as the last line of defence. Reading (T-F189) accepts any password.
public static class EncryptionPasswordRule
- Inheritance
-
EncryptionPasswordRule
- Inherited Members
Fields
MaxLength
7-Zip's own AES limit (WzAes.cpp, kPasswordSizeMax) — it refuses a longer password even when reading, so an archive protected by one could never be opened there.
public const int MaxLength = 99
Field Value
Methods
Check(string)
Mirrors 7-Zip's creation rule (ZipHandlerOut.cpp, IsSimpleAsciiString): 7-Zip decodes a ZIP password through the ANSI code page, not UTF-8, so any other character produces an archive 7-Zip/NanaZip cannot open. Characters are checked before length.
public static EncryptionPasswordProblem Check(string password)
Parameters
passwordstring
Returns
IsAllowed(char)
True for a character a new password may hold: printable ASCII, 0x20-0x7F.
public static bool IsAllowed(char c)
Parameters
cchar