Mask Attack — Comprehensive Operation
Project reference document Time2Crack
Recipients: developers, security researchers, advanced users
Contents
addMaskAttacks()1. Overview
Mask attack consists of testing passwords that follow a precise positional shape instead of all possible combinations.
Example: instead of testing all space 8 characters out of 95 symbols (95^8), the attacker targets a probable motive such as:
- 1 capital,
Either the Hashcat mask ?u?l?l?l?l?l?d?d.
The central idea: human passwords are not random. They are often structured (Thomas42, Marine2024, Bonjour!1The mask exploits precisely this regularity.
2. Historical and academic background
2.1 Origins
The logic of masks is old: from the first cracking tools, operators observed that password policies produce repetitive formats.
Industrialization comes with:
2.2 Empirical validation
The offensive/defensive literature converges: a very large fraction of real passwords follow simple patterns (word + digits, capital initial + word + year, etc.).
Wheeler (USENIX 2016), and the probabilistic works (Markov/PCFG/OMEN), show that the structure is as decisive as the gross length.
3. Conceptual Foundations: Why Masks Work
3.1 Humans generate structures, not by chance
Most users build memory secrets:
This strategy is predictable and highly compressible in masks.
3.2 Complexity policies enhance predictability
A rule of the type "1 capital, 1 digit, 1 symbol" does not impose randomity; it often pushes towards stable patterns:
Mot123!Prénom2024Ville75#The mask is the ideal tool to browse these diagrams at a very low cost.
3.3 Reduction of the effective keyspace
For a password of length 8 :
95^8) 6.63e15 candidates,?u?l?l?l?l?d?d = 26 26^4 10^2 = 1.19e9 candidates.The reduction is several million times, while covering a common human pattern.
4. Architecture of a Modern Mask Attack
Pipeline type:
1) Profilage de la cible / du corpus
-> structures fréquentes (L8D2, L6D4, U1L5D2, etc.)
2) Generation of candidate masks
-> ordered by probability
3) GPU execution (Hashcat -a 3)
-> high speed parallel tests
4) Adaptive adjustment
-> we keep the masks high, we spread the weak
Success depends less on the gross amount of masks than on their prioritization.
5. Mask Syntax (Hashcat/JtR)
5.1 Basic classes
?l : tiny (a-z)?u : capitals (A-Z)?d : number (0-9)?s : printable symbol?a : standard mixed alphabet (often ?l?u?d?s)5.2 Examples
?u?l?l?l?l?d?d -> Thomas42?l?l?l?l?l?l?d?d?d?d -> summer2024?u?l?l?l?l?l?l?s?d -> Marine!75.3. Custom masks
Hashcat allows custom character sets (-1, -2, etc.), for example:
-1 ?l?uéèàç for Latin languages,-2 0123456789!@# for probable suffixes,?1?1?1?1?2?2.6. Keyspace reduction: mathematical principle
Or a mask of length n with positional cardinalities c1, c2, ..., cn.
The masked keyspace is:
Kmask = Π(i)
Time (budget model):
T = Kmask / rate
In a naive, unmasked model:
Kfull = cs^n
The mask gain is:
Gain = Kfull / K_mask
The stronger the positional constraints (e.g., digits at the end, capital in the head), the greater the gain.
7. Implementation in Time2Crack: addMaskAttacks()
Time2Crack implements mask logic in app.js :
addMaskAttacks(rows, full, len, cs, kbPat, seq, weak, dt, pw)cat: "mask"aMask / note nMaskPositional, nKBDetected, nSeqDetected, nDateDetected7.1. Calculation of the masked keyspace
The code counts the actual occurrences of each character type in the password:
Then built:
maskKS = 26^U 26 10^D 33^S (approximation via internal constants)
This models an attacker knowing the structure by type, not just the total length.
7.2 Special cases
weak : estimate via weakGuessTime(a.rate) (minimum flow-dependent range),dt (date detected): reduction via detectDateAndReduce(),The time is then estimated by budgetTime(effectiveMaskGuesses, a.rate) (with mask rank factor and Unicode/date processing).
8. Date detection and structural reduction
Time2Crack includes a specific date processing (hasDate, detectDateAndReduce) :
1600-2099,DD/MM/YYYY, separator variants),10^dateChars) by a plausible set (~200 années or ~36500 dates).Consequence: a type password Mot2024! This is consistent with offensive practice.
9. High fidelity calibration
When the high fidelity mode is active, the mask category receives an additional multiplier in applyHighFidelityCalibration() :
Intuition: These signals increase the probability of an early ranking in the line of masks tested.
10. Benchmarks and orders of magnitude
Orders of magnitude (profile 12x RTX 4090):
AlgorithmApprox flow rateTime for 1st 9 candidates ------:---: MD5~2.03 TH/s~0.0005 s SHA-1~610 GH/s~0.0016 s SHA-256~272 GH/s~0.0037 s NTLM~3.46 TH/s~0.0003 s bcrypt (cost 10)~69 kH/s~4.0 h Argon2id~800 H/s~14.5 daysReading:
11. Concrete examples of mask cracking
11.1 Thomas42
?u?l?l?l?l?l?d?d26 26^4 10^2 (order of magnitude ~1e9)11.2 summer2024
?l?l?l?l?l?l?d?d?d?d10^4).11.3 Marine!7
?u?l?l?l?l?l?s?d12. Comparison with Crude Force, Hybrid and PCFG
AttackStrong pointLow point --------- Gross strengthComprehensive coverageexponential cost MaskExcellent efficiency on human structuresSensitive to bad mask choice Hybrid/rulesVery good on words + mutationsDepends on a basic word PCFGCapture global grammarMore costly to train/operateIn practice, operators often combine mask + rules + probabilistic.
13. Limitations of Mask Attack
?a Repeated on long length returns close to the brute force.14. Effective defences
14.1 User side
Mot+année, Prénom+chiffres, Majuscule+mot+symbole.14.2. System side
14.3 Policy
15. Bibliographic references
Academic sources
Wheeler, D.L. (2016). zxcvbn: Low-Budget Password Strength Estimate. 25th USENIX Security Symposium. Weir, M., Aggarwal, S., de Medeiros, B., & Glodek, B. (2009). Password Tracking Using Probabilistic Context-Free Grammars. IEEE Symposium on Security and Privacy. Dürmuth, M., Angelstorf, F., Horsch, J., et al. (2015). OMEN: Faster Password Guessing Using an Ordered Markov Enumerator. ESSoS. Ur, B., Kelley, P. G., Komanduri, S., et al. (2012). How Does Your Password Measure Up? USENIX Security.Industrial and technical sources
Hashcat Wiki. Mask attack (-a 3). https://hashcat.net/wiki/ Hashcat (benchmarks). https://hashcat.net/hashcat/ Hive Systems (Password Table). https://www.hivesystems.io/password-tableWeb sources cited in the Time2Crack application
USENIX Security 2016 (Wheeler). https://www.usenix.org/conference/usenixsecurity16/technical-sessions/presentation/wheelerDocument generated for Time2Crack Project — Version 1.0 — 2026-04-01 Source code:
app.js (functions addMaskAttacks, detectDateAndReduce, hasDate, budgetTime, applyHighFidelityCalibration)*