From a9869ea999a2cdb9b19437617a70278c13e4025b Mon Sep 17 00:00:00 2001 From: mskor Date: Mon, 9 Dec 2024 23:54:54 +0000 Subject: [PATCH] Added comment to explain that pre-processing is basically cheating and that trees are a good answer here, could have done some weird hashing thing since lookup is instant, but since some of the common passwords can be similar, its riskier and for password handling risk is a BAD BAD BAD idea --- Server/BackEnd/Services/PasswordService.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Server/BackEnd/Services/PasswordService.cs b/Server/BackEnd/Services/PasswordService.cs index 269bb73..d1eabaa 100644 --- a/Server/BackEnd/Services/PasswordService.cs +++ b/Server/BackEnd/Services/PasswordService.cs @@ -4,7 +4,9 @@ namespace back_end.Services; public class PasswordService : IPasswordService { - + // Since we can do pre-processing on startup, sticking the common passwords into a tree should cut the search time + // down by a lot, no more searching through 6456 common passwords before getting to 'password123!'! + // After the first step we go down to about 150 possible passwords which will more or less be instant after that! private class PasswordTreeNode {