144 |
145 |
146 |
147 |
160 |
161 | );
162 | }
163 | const top1000 = ['puzzle', 'game', 'password hell', 'impossible puzzle', 'password requirements', 'password','123456','12345678','1234','qwerty','12345','dragon','baseball','football','letmein','monkey','696969','abc123','mustang','michael','shadow','master','jennifer','111111','2000','jordan','superman','harley','1234567','hunter','fuckyou','trustno1','ranger','buster','thomas','tigger','robert','soccer','fuck','batman','test','pass','hockey','george','charlie','andrew','michelle','love','sunshine','jessica','6969','pepper','daniel','access','123456789','654321','joshua','maggie','starwars','silver','william','dallas','yankees','123123','ashley','666666','hello','amanda','orange','biteme','freedom','computer','thunder','nicole','ginger','heather','hammer','summer','corvette','taylor','fucker','austin','1111','merlin','matthew','121212','golfer','cheese','princess','martin','chelsea','patrick','richard','diamond','yellow','bigdog','secret','asdfgh','sparky','cowboy','camaro','anthony','matrix','falcon','iloveyou','bailey','guitar','jackson','purple','scooter','phoenix','aaaaaa','morgan','tigers','porsche','mickey','maverick','cookie','nascar','peanut','justin','131313','money','samantha','panties','steelers','joseph','snoopy','boomer','whatever','iceman','smokey','gateway','dakota','cowboys','eagles','chicken','black','zxcvbn','please','andrea','ferrari','knight','melissa','compaq','coffee','booboo','johnny','bulldog','xxxxxx','welcome','james','player','ncc1701','wizard','scooby','charles','junior','internet','mike','brandy','tennis','banana','monster','spider','lakers','miller','rabbit','enter','mercedes','brandon','steven','fender','john','yamaha','diablo','chris','boston','tiger','marine','chicago','rangers','gandalf','winter','barney','edward','raiders','johnson','chester','london','midnight','blue','fishing','000000','hannah','slayer','11111111','rachel','redsox','thx1138','asdf','marlboro','panther','zxcvbnm','arsenal','oliver','qazwsx','mother','victoria','7777777','jasper','angel','david','winner','crystal','golden','butthead','viking','jack','iwantu','shannon','murphy','angels','prince','cameron','girls','madison','wilson','carlos','willie','startrek','captain','maddog','jasmine','butter','booger','angela','golf','lauren','rocket','tiffany','theman','dennis','liverpoo','flower','forever','green','jackie','muffin','turtle','sophie','danielle','redskins','toyota','jason','sierra','winston','debbie','giants','packers','newyork','jeremy','casper','bubba','112233','sandra','lovers','mountain','united','cooper','driver','tucker','helpme','pookie','lucky','maxwell','bear','gators','5150','222222','jaguar','monica','fred','happy','hotdog','gemini','lover','777777','canada','nathan','victor','florida','88888888','nicholas','rosebud','metallic','doctor','trouble','success','stupid','tomcat','warrior','peaches','apples','fish','qwertyui','magic','buddy','dolphins','rainbow','gunner','987654','freddy','alexis','braves','2112','1212','cocacola','xavier','dolphin','testing','bond007','member','calvin','voodoo','7777','samson','alex','apollo','fire','tester','walter','beavis','voyager','peter','bonnie','rush2112','beer','apple','scorpio','jonathan','skippy','sydney','scott','red123','power','gordon','travis','beaver','star','jackass','flyers','232323','zzzzzz','steve','rebecca','scorpion','doggie','legend','ou812','yankee','blazer','bill','runner','birdie','bitches','555555','parker','topgun','asdfasdf','heaven','viper','animal','2222','bigboy','4444','arthur','baby','private','godzilla','donald','williams','lifehack','phantom','dave','rock','august','sammy','cool','brian','platinum','jake','bronco','paul','mark','frank','heka6w2','copper','billy','garfield','willow','little','carter','albert','69696969','kitten','super','jordan23','eagle1','shelby','america','11111','jessie','house','free','123321','chevy','bullshit','white','broncos','surfer','nissan','999999','saturn','airborne','elephant','marvin','shit','action','adidas','qwert','kevin','1313','explorer','walker','police','christin','december','benjamin','wolf','sweet','therock','king','online','brooklyn','teresa','cricket','sharon','dexter','racing','gregory','0000','teens','redwings','dreams','michigan','magnum','87654321','nothing','donkey','trinity','digital','333333','stella','cartman','guinness','123abc','speedy','buffalo','kitty','pimpin','eagle','einstein','kelly','nelson','nirvana','vampire','xxxx','playboy','louise','pumpkin','snowball','test123','girl','sucker','mexico','beatles','fantasy','ford','gibson','celtic','marcus','cherry','cassie','888888','natasha','sniper','chance','genesis','hotrod','reddog','alexande','college','jester','passw0rd','smith','lasvegas','carmen','slipknot','3333','death','kimberly','1q2w3e','eclipse','1q2w3e4r','stanley','samuel','drummer','homer','montana','music','aaaa','spencer','jimmy','carolina','colorado','creative','hello1','rocky','goober','friday','scotty','abcdef','bubbles','hawaii','fluffy','mine','stephen','horses','thumper','5555','pussies','darkness','asdfghjk','pamela','boobies','buddha','vanessa','sandman','naughty','douglas','honda','matt','azerty','6666','shorty','money1','beach','loveme','4321','simple','poohbear','444444','badass','destiny','sarah','denise','vikings','lizard','melanie','assman','sabrina','nintendo','water','good','howard','time','123qwe','november','xxxxx','october','leather','young','101010','extreme','hard','password1','vincent','lacrosse','hotmail','spooky','amateur','alaska','badger','paradise','maryjane','crazy','mozart','video','russell','spitfire','anderson','norman','eric','cherokee','cougar','barbara','long','420420','family','horse','enigma','allison','raider','brazil','blonde','jones','55555','dude','drowssap','jeff','school','marshall','lovely','1qaz2wsx','jeffrey','caroline','franklin','molly','snickers','leslie','nipples','courtney','diesel','rocks','eminem','westside','suzuki','daddy','passion','hummer','ladies','zachary','frankie','elvis','reggie','alpha','suckme','simpson','patricia','147147','pirate','tommy','semperfi','jupiter','redrum','freeuser','wanker','stinky','ducati','paris','natalie','babygirl','bishop','windows','spirit','pantera','monday','patches','brutus','houston','smooth','penguin','marley','forest','cream','212121','flash','maximus','bobby','bradley','vision','pokemon','champion','fireman','indian','softball','picard','system','clinton','cobra','enjoy','lucky1','claire','claudia','boogie','timothy','marines','security','dirty','admin','wildcats','dancer','hardon','veronica','abcd1234','abcdefg','ironman','wolverin','remember','great','freepass','bigred','justice','francis','hobbes','kermit','pearljam','mercury','domino','9999','denver','brooke','rascal','hitman','mistress','simon','tony','bbbbbb','friend','peekaboo','budlight','electric','sluts','stargate','saints','brittany','bigman','zombie','swimming','duke','qwerty1','babes','scotland','disney','rooster','brenda','mookie','swordfis','candy','duncan','olivia','hunting','blink182','alicia','8888','samsung','bubba1','whore','virginia','general','passport','aaaaaaaa','liberty','arizona','jesus','abcd','newport','skipper','rolltide','balls','happy1','galore','christ','weasel','242424','wombat','digger','classic','bulldogs','poopoo','accord','popcorn','turkey','jenny','amber','bunny','mouse','007007','titanic','liverpool','dreamer','everton','friends','chevelle','carrie','gabriel','psycho','nemesis','burton','pontiac','connor','eatme','lickme','roland','mitchell','ireland','lincoln','arnold','spiderma','patriots','goblue','devils','eugene','empire','asdfg','cardinal','brown','shaggy','froggy','qwer','kawasaki','kodiak','people','phpbb','light','54321','kramer','chopper','honey','whynot','lesbian','lisa','baxter','adam','snake','teen','ncc1701d','qqqqqq','airplane','britney','avalon','sandy','sugar','sublime','stewart','wildcat','raven','scarface','elizabet','123654','trucks','wolfpack','pervert','lawrence','raymond','redhead','american','alyssa','bambam','movie','woody','shaved','snowman','tiger1','chicks','raptor','1969','stingray','shooter','france','stars','madmax','kristen','sports','jerry','789456','garcia','simpsons','lights','ryan','looking','chronic','alison','hahaha','packard','hendrix','perfect','service','spring','srinivas','spike','katie','252525','oscar','brother','bigmac','suck','single','cannon','georgia','popeye','tattoo','texas','party','bullet','taurus','sailor','wolves','panthers','japan','strike','flowers','pussycat','chris1','loverboy','berlin','sticky','marina','tarheels','fisher','russia','connie','wolfgang','testtest','mature','bass','catch22','juice','michael1','nigger','159753','women','alpha1','trooper','hawkeye','head','freaky','dodgers','pakistan','machine','pyramid','vegeta','katana','moose','tinker','coyote','infinity','inside','pepsi','letmein1','bang','control'];
164 |
165 |
166 | function checkpass(t){ //t password input as a string
167 |
168 | // we'll use t = '👨🏾🍳pÂs👩🏿🦳' as our example string
169 |
170 | //complex unicode characters are made up of the basic elements and modifiers
171 | //for example: Â has the base A and the ◌̂ that modifies it.
172 |
173 | const au =t.split('');
174 | //this basic split function. splits the string into an array of unicode characters and modifiers
175 | //example output: ["\ud83d","\udc68","\ud83c","\udffe","","\ud83c","\udf73","p","A","̂","s","\ud83d","\udc69","\ud83c","\udfff","","\ud83e","\uddb3"]
176 | //5 characters turn into 18
177 |
178 | const a = [...t];
179 | //this es6 version does slightly better but still can't manage complex emojis
180 | //["👨","🏾","","🍳","p","A","̂","s","👩","🏿","","🦳" ] length 12
181 | // black chef becomes: man, black skin, frying pan
182 |
183 | const abest= Lsplit(t, '');
184 | //this 3rd party library is the best I could find but still struggles to split some emojis
185 | //[ "👨🏾🍳", "p", "Â", "s", "👩🏿", "🦳" ] length 6
186 |
187 | console.log(t,a,au,abest);
188 |
189 | const ar = abest.reverse();
190 | let lowcount=0; //lower case
191 | let letcount=0; //all letters
192 |
193 | //regular expressions or regex are a way to search through text
194 | // /A/ matches a capital A. [a-z] matches all lower case letters
195 |
196 | a.forEach(e=>{ if(e.match(/[a-z]/)){ lowcount++;}});
197 | a.forEach(e=>{ if(e.match(/[a-zA-Z]/)){ letcount++;}});
198 |
199 |
200 | ana.logEvent('sign in clicked'); //google analytics
201 | if(a.length<6){return 'Your password must be at least 6 characters long'}
202 | if(a.length>255){return 'Your password cannot be longer than 255 characters'}
203 | if(t.match(/\s/u)){return 'Your password cannot contain spaces'}
204 | // in reg ex some letters have special functions when escaped with a backslash. \s means white space
205 | if(lowcount <1){return 'Your password must contain a lower case letter'}
206 | if(!t.match(/\d/u)){return 'Your password must contain a number'} //notice ! for if no number matches
207 | if(!t.match(/[A-Z]/u)){return 'Your password must contain a capital letter'}
208 | ana.logEvent('symbol reached'); //google analytics
209 | if(!t.match(/[^a-zA-Z0-9]/u)){return 'Your password must contain a symbol'}
210 | // here ^ acts like the regex not ! symbol
211 | if(t.match(/I/u)){return 'Your password cannot contain a capital I'}
212 | if(t.match(/A/u)){return 'Your password cannot contain a capital A'}
213 | if(a.length<10){return 'Your password must be at least 10 characters long'}
214 | if(t.match(/(.)\1/u)){return 'Your password cannot contain two identical characters in a row'}
215 | //the dot . means a match for any character
216 | //brackets () means a group
217 | // an escaped number \1 refers to that group.
218 | //so this expression says any letter can be the first character and then if the following character is the same match it
219 | if(ar.length>43){return 'Your password cannot be longer than 43 characters'}
220 | if(top1000.find(e=>t.includes(e)) !==undefined){return 'Your password cannot contain a common password'}
221 | if(letcount <8 ){return 'Your password must contain at least 8 letters'}
222 | if(!t.match(/[\u0370-\u03FF]/u)){return 'Your password must contain a greek letter'}
223 | //unicode has a series of character blocks. The range here is all the greek letters
224 | //notice the /u, this means match unicode characters
225 | ana.logEvent('greek letter completed'); //google analytics
226 | if(!t.match(/[🌍-🛌🏿]/u)){return 'Your password must contain an emoji'}
227 | //this doesn't actually include all emojis because they are spaced out throughout unicode
228 | ana.logEvent('emoji completed');
229 | if(!t.match(/8675309/u)){return 'Your password needs Jenny\'s number'}
230 | ana.logEvent('jenny completed');
231 | if(au.includes('\uddb1')){return 'Your emojis cannot have curly hair'}
232 | if(au.includes('\uddb0')){return 'Your emojis cannot have ginger hair'}
233 | if(au.includes('\uddb3')){return 'Your emojis cannot have white hair'}
234 | //The au variable is the array of word split completely into unicode characters and modifiers
235 | //this means the hair colour modifier is split from the single emoji character and can be checked
236 |
237 |
238 | if(au.join('') !== ar.join('') ){return 'Your password must be a palindrome'}
239 | //because this relies on exact splitting our example won't actually work
240 | //[ "👨🏾🍳", "p", "Â", "s", "👩🏿", "🦳" ]
241 | // reversed: ["👩🏿", "🦳", "s", "Â", "p", "👨🏾🍳"]
242 | ana.logEvent('palindrome completed');
243 |
244 | let numOr0 = n => isNaN(n) ? 0 : parseInt(n);
245 | if(t.match(/[A-Z](?=(.{0,2}[A-Z]))/u)){return 'Capital letters cannot be anywhere near eachother'}
246 | // ?= means after the matched letter
247 | // {0,2} means you can have between 0 and 2 of the letter before. Here it's a dot, so it could be any letter.
248 | //followed by [A-Z] any capital letter. So it matches any capital letters with 2 or less of characters between them.
249 | //there is also a match before regex you shouldn't use because it breaks your code on iphones
250 | //a simpler way of doing this might be /[A-Z].{0,2}[A-Z]/
251 | ana.logEvent('capital space completed');
252 | if(a.reduce((d, b) => numOr0(d) + numOr0(b),0) !==100){return 'All the digits in your password must add to 100'}
253 | ana.logEvent('sum100 complete');
254 | if(!t.match(/42/u)){return 'Your password must contain the meaning of life'}
255 | if(lowcount !==1 ){return 'Your password cannot contain more than one lower case letter'}
256 | if(!au.includes('\udfff')|| !au.includes('\udffe')||!au.includes('\udffd')||!au.includes('\udffc')||!au.includes('\udffb'))
257 | {return 'Your emojis aren\'t diverse enough'}
258 | //this works the same way as hair colour but checks for one of each skin colour.
259 |
260 |
261 | ana.logEvent('diverse complete');
262 | if(!t.match(/𰻝/u)){return 'Your password must contain shaanxi noodles'}
263 | //some unicode characters are so rare they don't seem to render anytngi other than a blank box
264 | //on any devices, but that sqaure still holds the correct unicode.
265 |
266 | ana.logEvent('WIN');
267 | return 'checking password'
268 |
269 | }
--------------------------------------------------------------------------------
/src/config.js:
--------------------------------------------------------------------------------
1 | import firebase from 'firebase/app';
2 | import 'firebase/analytics';
3 |
4 | // Your web app's Firebase configuration
5 | // For Firebase JS SDK v7.20.0 and later, measurementId is optional
6 | var firebaseConfig = {
7 | apiKey: "AIzaSyD5QzSzMvRymXW5PYD2nlwiwc85NPdUKRw",
8 | authDomain: "passwordhell.firebaseapp.com",
9 | projectId: "passwordhell",
10 | storageBucket: "passwordhell.appspot.com",
11 | messagingSenderId: "632242473335",
12 | appId: "1:632242473335:web:a776207254bcc3a1747972",
13 | measurementId: "G-2NT09L3QJY"
14 | };
15 |
16 | // Initialize Firebase
17 | firebase.initializeApp(firebaseConfig);
18 | const ana = firebase.analytics();
19 |
20 | export { ana };
--------------------------------------------------------------------------------
/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import './index.css';
4 | import App from './App';
5 | import reportWebVitals from './reportWebVitals';
6 | import 'fontsource-roboto';
7 |
8 |
9 | ReactDOM.render(
10 |
11 |
12 | ,
13 | document.getElementById('root')
14 | );
15 |
16 | // If you want to start measuring performance in your app, pass a function
17 | // to log results (for example: reportWebVitals(console.log))
18 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
19 | reportWebVitals();
20 |
--------------------------------------------------------------------------------
/src/logo.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/wina:
--------------------------------------------------------------------------------
1 | S👨🏿👨🏽🍳👨🏼🍳DϿ👨🏾🍳👨🏻🍳6S42𰻝D8675309a9035768D𰻝24S6👨🏻🍳👨🏾🍳ϿD👨🏼🍳👨🏽🍳👨🏿S
2 | if(t.match(/(?<=([A-Z].{0,2}))[A-Z]/u)){return 'Capital letters cannot be anwhere near eachother'}
--------------------------------------------------------------------------------