Remove zxcvbn dependency

Pushing external lib purely to save user's from eventual stupidity is just simply not worth the bytes in the final zip archive.
This commit is contained in:
Łukasz Domeradzki
2024-05-02 21:54:54 +02:00
parent c8c35b5bf7
commit ff02a4a8d4
9 changed files with 0 additions and 204 deletions

View File

@@ -22,7 +22,6 @@
// limitations under the License.
using System;
using System.Collections.Frozen;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
@@ -47,8 +46,6 @@ public static class ArchiCryptoHelper {
internal static bool HasDefaultCryptKey { get; private set; } = true;
private static readonly FrozenSet<string> ForbiddenCryptKeyPhrases = new HashSet<string>(3, StringComparer.OrdinalIgnoreCase) { "crypt", "key", "cryptkey" }.ToFrozenSet(StringComparer.OrdinalIgnoreCase);
private static IEnumerable<byte> SteamParentalCharacters => Enumerable.Range('0', 10).Select(static character => (byte) character);
private static IEnumerable<byte[]> SteamParentalCodes {
@@ -179,16 +176,6 @@ public static class ArchiCryptoHelper {
return;
}
Utilities.InBackground(
() => {
(bool isWeak, string? reason) = Utilities.TestPasswordStrength(key, ForbiddenCryptKeyPhrases);
if (isWeak) {
ASF.ArchiLogger.LogGenericWarning(string.Format(CultureInfo.CurrentCulture, Strings.WarningWeakCryptKey, reason));
}
}
);
byte[] encryptionKey = Encoding.UTF8.GetBytes(key);
if (encryptionKey.Length < MinimumRecommendedCryptKeyBytes) {