Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
1315 lines (1216 loc) · 57 KB
/
Copy pathindex.html
File metadata and controls
1315 lines (1216 loc) · 57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Vault — Generate strong passwords in your browser</title>
<meta name="description" content="Generate strong passwords and passphrases in your browser. Real entropy math, honest crack-time estimates, zero tracking. Your passwords never leave your device.">
<style>
:root{
--bg:#141419; --bg-alt:#1a1a22; --title:#20202b;
--side:#1a1a22; --side-hover:#23232e; --border:#26262f;
--text:#c9c9d1; --text-dim:#7d7d8a; --text-bright:#f0f0f5;
--accent:#8b5cf6; --accent-hover:#a78bfa; --accent-soft:#8b5cf633;
--green:#4ade80; --red:#f87171; --orange:#fbbf24;
--shadow:0 8px 32px #00000099;
}
*{box-sizing:border-box}
html,body{height:100%;margin:0}
body{
background:var(--bg);color:var(--text);
font:14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,Roboto,sans-serif;
-webkit-font-smoothing:antialiased;
display:flex;flex-direction:column;height:100vh;overflow:hidden;
}
::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:#333340;border:2px solid var(--bg);border-radius:5px}
::-webkit-scrollbar-thumb:hover{background:#45455a}
button{font-family:inherit;cursor:pointer}
input{font-family:inherit}
/* Title bar */
.titlebar{
flex:none;display:flex;align-items:center;height:44px;
background:var(--title);border-bottom:1px solid #0a0a0d;
padding:0 16px;user-select:none;
}
.dots{display:flex;gap:8px;margin-right:20px}
.dot{width:12px;height:12px;border-radius:50%}
.dot.r{background:#ff5f57}.dot.y{background:#febc2e}.dot.g{background:#28c840}
.brand{display:flex;align-items:center;gap:10px;font-size:14px;color:var(--text-bright)}
.brand .logo{
font-weight:700;letter-spacing:-.01em;
background:linear-gradient(135deg,#8b5cf6,#ec4899);
-webkit-background-clip:text;background-clip:text;
-webkit-text-fill-color:transparent;
}
.brand .sub{color:var(--text-dim);font-size:12.5px}
.spacer{flex:1}
.privacy{
display:flex;align-items:center;gap:6px;font-size:12px;color:var(--green);
padding:5px 10px;border-radius:6px;background:#4ade8010;border:1px solid #4ade8022;
}
.privacy svg{width:12px;height:12px;fill:currentColor}
/* Mode tabs */
.modebar{
flex:none;display:flex;align-items:center;height:48px;
background:var(--bg-alt);border-bottom:1px solid var(--border);
padding:0 20px;gap:4px;
}
.mode-tab{
background:transparent;border:0;color:var(--text-dim);
padding:8px 16px;border-radius:8px;font-size:13px;font-weight:500;
display:flex;align-items:center;gap:8px;transition:all .12s;
}
.mode-tab:hover{background:#ffffff0a;color:var(--text)}
.mode-tab.active{background:var(--accent);color:#fff;font-weight:600}
.mode-tab svg{width:14px;height:14px;fill:currentColor}
.modebar .spacer{flex:1}
.modebar .note{font-size:12px;color:var(--text-dim)}
/* Layout */
.layout{flex:1;display:flex;min-height:0;overflow:hidden}
/* Sidebar */
.sidebar{
flex:none;width:300px;background:var(--side);
border-right:1px solid var(--border);
display:flex;flex-direction:column;overflow:hidden;
}
.side-head{
flex:none;height:40px;padding:0 20px;display:flex;align-items:center;
font-size:11px;letter-spacing:.13em;text-transform:uppercase;
color:var(--text-dim);border-bottom:1px solid var(--border);
}
.side-body{flex:1;overflow-y:auto;padding:20px}
.field{margin-bottom:24px}
.field:last-child{margin-bottom:0}
.field label{
display:block;font-size:12px;color:var(--text-dim);
letter-spacing:.03em;margin-bottom:10px;font-weight:500;
display:flex;justify-content:space-between;align-items:center;
}
.field label .val{
font:13px ui-monospace,Menlo,monospace;
color:var(--text-bright);font-weight:600;
}
.field input[type="range"]{
width:100%;-webkit-appearance:none;appearance:none;
height:4px;background:#2b2b38;border-radius:2px;outline:none;
}
.field input[type="range"]::-webkit-slider-thumb{
-webkit-appearance:none;width:16px;height:16px;border-radius:50%;
background:var(--accent);cursor:pointer;box-shadow:0 0 0 3px #8b5cf633;
transition:transform .12s;
}
.field input[type="range"]::-webkit-slider-thumb:hover{transform:scale(1.15)}
.field input[type="range"]::-moz-range-thumb{
width:16px;height:16px;border-radius:50%;border:0;
background:var(--accent);cursor:pointer;box-shadow:0 0 0 3px #8b5cf633;
}
.field input[type="range"]::-moz-range-track{height:4px;background:#2b2b38;border-radius:2px}
.hint{font-size:11.5px;color:var(--text-dim);margin-top:8px;line-height:1.5}
/* Toggles */
.toggle{
display:flex;align-items:center;gap:12px;padding:10px 12px;
background:#20202b;border-radius:8px;margin-bottom:6px;
cursor:pointer;user-select:none;transition:background .12s;
border:1px solid transparent;
}
.toggle:hover{background:#262633}
.toggle.on{border-color:#3a3a4a}
.toggle .check{
flex:none;width:18px;height:18px;border-radius:5px;
border:1.5px solid #3a3a4a;background:transparent;
display:flex;align-items:center;justify-content:center;
transition:all .12s;
}
.toggle.on .check{background:var(--accent);border-color:var(--accent)}
.toggle .check svg{width:11px;height:11px;fill:#fff;opacity:0;transition:opacity .12s}
.toggle.on .check svg{opacity:1}
.toggle .txt{flex:1;font-size:13px;color:var(--text)}
.toggle.on .txt{color:var(--text-bright)}
.toggle .count{font-size:11.5px;color:var(--text-dim);font-family:ui-monospace,Menlo,monospace}
/* Presets */
.presets{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.preset{
background:#20202b;border:1px solid #2e2e3a;color:var(--text);
padding:9px 12px;border-radius:8px;font-size:12.5px;
text-align:left;transition:all .12s;
}
.preset:hover{background:#262633;border-color:#3a3a4a}
.preset .t{display:block;font-weight:600;color:var(--text-bright);font-size:13px;margin-bottom:2px}
.preset .d{display:block;font-size:11px;color:var(--text-dim)}
/* Main */
.main{flex:1;display:flex;flex-direction:column;min-width:0;overflow:hidden;background:var(--bg)}
.pane{flex:1;display:none;flex-direction:column;min-height:0;overflow:hidden}
.pane.active{display:flex}
/* Single mode: display */
.display-wrap{padding:28px 32px 20px;flex:none}
.display{
position:relative;background:var(--bg-alt);
border:1px solid var(--border);border-radius:14px;
padding:32px 88px 32px 32px;min-height:110px;
display:flex;align-items:center;
box-shadow:inset 0 1px 0 #ffffff08;
}
.display .pw{
font:32px/1.25 ui-monospace,"SF Mono",Menlo,Consolas,monospace;
color:var(--text-bright);word-break:break-all;letter-spacing:.02em;
cursor:text;user-select:all;
}
.display .pw.passphrase{
font-size:26px;letter-spacing:.03em;color:var(--text-bright);
font-family:ui-monospace,Menlo,monospace;
}
.display .pw .word{color:var(--accent-hover)}
.display .pw .sep{color:var(--text-dim);margin:0 2px}
.display .actions{
position:absolute;top:50%;right:20px;transform:translateY(-50%);
display:flex;flex-direction:column;gap:6px;
}
.d-btn{
width:44px;height:44px;border-radius:10px;border:0;
background:#2a2a38;color:var(--text);display:flex;
align-items:center;justify-content:center;transition:all .12s;
}
.d-btn:hover{background:var(--accent);color:#fff}
.d-btn svg{width:18px;height:18px;fill:currentColor}
.d-btn.copied{background:var(--green);color:#000}
/* Strength meter */
.meter-wrap{padding:0 32px 8px;flex:none}
.meter{height:8px;background:#20202b;border-radius:4px;overflow:hidden;position:relative}
.meter .fill{
height:100%;width:0;border-radius:4px;
transition:width .4s ease,background .3s ease;
}
.meter-labels{
display:flex;justify-content:space-between;
margin-top:10px;font-size:11.5px;color:var(--text-dim);
letter-spacing:.06em;text-transform:uppercase;
}
.meter-labels b{
color:var(--text-bright);letter-spacing:0;text-transform:none;
font-weight:600;font-size:13px;
}
/* Stats grid */
.stats{
flex:none;padding:16px 32px 20px;
display:grid;grid-template-columns:repeat(3,1fr);gap:14px;
}
.stat{
background:var(--bg-alt);border:1px solid var(--border);
border-radius:10px;padding:14px 16px;
}
.stat .lbl{
font-size:11px;color:var(--text-dim);letter-spacing:.09em;
text-transform:uppercase;margin-bottom:6px;
}
.stat .val{
font:16px ui-monospace,Menlo,monospace;color:var(--text-bright);
font-weight:600;
}
.stat .val small{font-size:12px;color:var(--text-dim);font-weight:400;margin-left:3px}
.stat .sub{font-size:11.5px;color:var(--text-dim);margin-top:4px}
/* Regenerate */
.regen-wrap{
flex:none;padding:0 32px 24px;
display:flex;gap:10px;
}
.btn{
background:#2a2a38;border:1px solid #35354a;color:var(--text);
padding:10px 18px;border-radius:9px;font-size:13.5px;font-weight:500;
display:flex;align-items:center;gap:8px;transition:all .12s;
}
.btn:hover{background:#35354a;border-color:#45455a}
.btn.primary{
background:linear-gradient(135deg,#8b5cf6,#ec4899);
border-color:transparent;color:#fff;font-weight:600;
box-shadow:0 4px 14px #8b5cf64d;flex:1;justify-content:center;
font-size:14.5px;padding:12px 18px;
}
.btn.primary:hover{filter:brightness(1.1);box-shadow:0 6px 20px #8b5cf666}
.btn svg{width:14px;height:14px;fill:currentColor}
.btn:disabled{opacity:.4;cursor:not-allowed}
/* Bulk mode */
.bulk-wrap{flex:1;display:flex;flex-direction:column;min-height:0;padding:20px 32px 24px}
.bulk-head{
flex:none;display:flex;align-items:center;gap:14px;margin-bottom:14px;
}
.bulk-head .info{font-size:12.5px;color:var(--text-dim)}
.bulk-head .info b{color:var(--text-bright)}
.bulk-head .spacer{flex:1}
.bulk-list{
flex:1;overflow-y:auto;background:var(--bg-alt);
border:1px solid var(--border);border-radius:10px;
padding:8px;min-height:0;
font:14px/1.7 ui-monospace,Menlo,monospace;
}
.bulk-row{
display:flex;align-items:center;gap:12px;padding:7px 12px;
border-radius:6px;transition:background .1s;
}
.bulk-row:hover{background:#ffffff0a}
.bulk-row .num{
flex:none;width:30px;color:var(--text-dim);font-size:12px;
text-align:right;
}
.bulk-row .pw{
flex:1;color:var(--text-bright);word-break:break-all;
cursor:pointer;user-select:all;
}
.bulk-row .pw:hover{color:var(--accent-hover)}
.bulk-row .row-copy{
flex:none;background:transparent;border:0;color:var(--text-dim);
padding:4px;border-radius:4px;
}
.bulk-row .row-copy:hover{background:#ffffff14;color:var(--text-bright)}
.bulk-row .row-copy svg{width:13px;height:13px;fill:currentColor}
/* Check mode */
.check-wrap{flex:1;overflow-y:auto;padding:32px}
.check-field{
position:relative;margin-bottom:24px;
}
.check-field input{
width:100%;background:var(--bg-alt);border:1px solid var(--border);
color:var(--text-bright);padding:16px 120px 16px 20px;
border-radius:12px;font:18px ui-monospace,Menlo,monospace;
outline:none;transition:border-color .15s;
}
.check-field input:focus{border-color:var(--accent)}
.check-field .toggle-vis{
position:absolute;top:50%;right:14px;transform:translateY(-50%);
background:#2a2a38;border:0;color:var(--text-dim);
padding:8px 12px;border-radius:8px;font-size:12px;
display:flex;align-items:center;gap:6px;
}
.check-field .toggle-vis:hover{background:#35354a;color:var(--text-bright)}
.check-field .toggle-vis svg{width:14px;height:14px;fill:currentColor}
.check-result{
background:var(--bg-alt);border:1px solid var(--border);
border-radius:12px;padding:20px;margin-bottom:16px;
}
.check-result .score-row{
display:flex;align-items:center;gap:16px;margin-bottom:14px;
}
.check-result .score-num{
font-size:44px;font-weight:700;line-height:1;
font-family:ui-monospace,Menlo,monospace;
}
.check-result .score-info{flex:1}
.check-result .score-label{
font-size:15px;font-weight:600;color:var(--text-bright);
margin-bottom:2px;
}
.check-result .score-sub{font-size:12.5px;color:var(--text-dim)}
.check-list{list-style:none;padding:0;margin:0}
.check-list li{
padding:8px 0;display:flex;align-items:flex-start;gap:10px;
font-size:13px;line-height:1.5;
border-top:1px solid #ffffff0a;
}
.check-list li:first-child{border-top:0}
.check-list .mark{
flex:none;width:18px;height:18px;border-radius:50%;
display:flex;align-items:center;justify-content:center;
margin-top:1px;font-size:11px;font-weight:700;
}
.check-list .mark.good{background:#4ade8022;color:var(--green)}
.check-list .mark.bad{background:#f8717122;color:var(--red)}
.check-list .mark.warn{background:#fbbf2422;color:var(--orange)}
.check-list .txt{flex:1;color:var(--text)}
.check-list .txt b{color:var(--text-bright)}
/* Toast */
.toast{
position:fixed;bottom:56px;left:50%;
transform:translateX(-50%) translateY(80px);
background:#2a2a38;color:#fff;padding:10px 20px;border-radius:8px;
font-size:13px;font-weight:500;box-shadow:var(--shadow);z-index:200;
opacity:0;transition:all .25s ease;pointer-events:none;
border:1px solid #35354a;
}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
.toast.success{background:#166534;border-color:#22c55e}
.toast.error{background:#7f1d1d;border-color:#ef4444}
/* Status bar */
.statusbar{
flex:none;height:26px;
background:linear-gradient(90deg,#8b5cf6,#ec4899);
color:#fff;display:flex;align-items:center;
font-size:11.5px;padding:0 12px;gap:16px;user-select:none;
}
.statusbar .st{display:flex;align-items:center;gap:6px}
.statusbar .st .dotstatus{width:6px;height:6px;border-radius:50%;background:#f0abfc}
.statusbar .spacer{flex:1}
/* Bulk count input */
.bulk-count{
background:#2a2a38;border:1px solid #35354a;color:var(--text-bright);
padding:6px 10px;border-radius:6px;width:70px;
font:13px ui-monospace,Menlo,monospace;outline:none;
}
</style>
</head>
<body>
<header class="titlebar">
<div class="dots"><span class="dot r"></span><span class="dot y"></span><span class="dot g"></span></div>
<div class="brand">
<span class="logo">Vault</span>
<span class="sub">Strong passwords, generated locally</span>
</div>
<div class="spacer"></div>
<div class="privacy">
<svg viewBox="0 0 16 16"><path d="M8 1a3 3 0 0 0-3 3v2H4v9h8V6h-1V4a3 3 0 0 0-3-3zm0 1.5A1.5 1.5 0 0 1 9.5 4v2h-3V4A1.5 1.5 0 0 1 8 2.5zM5 7.5h6v7H5z"/></svg>
Nothing is ever sent to a server
</div>
</header>
<div class="modebar">
<button class="mode-tab active" data-pane="single">
<svg viewBox="0 0 16 16"><path d="M8 1l2 4.5 5 .5-3.8 3.4 1.2 4.9L8 11.7 3.6 14.3 4.8 9.4 1 6l5-.5z"/></svg>
Single
</button>
<button class="mode-tab" data-pane="bulk">
<svg viewBox="0 0 16 16"><path d="M2 3h12v2H2zm0 4h12v2H2zm0 4h12v2H2z"/></svg>
Bulk
</button>
<button class="mode-tab" data-pane="check">
<svg viewBox="0 0 16 16"><path d="M8 1l6 3v4c0 3.5-2.5 6.5-6 7-3.5-.5-6-3.5-6-7V4z"/></svg>
Check
</button>
<div class="spacer"></div>
<span class="note">Press <b style="color:var(--text-bright)">R</b> to regenerate · <b style="color:var(--text-bright)">C</b> to copy</span>
</div>
<div class="layout">
<aside class="sidebar">
<div class="side-head">Options</div>
<div class="side-body">
<div class="field" id="lengthField">
<label>Length <span class="val" id="lengthVal">20</span></label>
<input type="range" id="length" min="4" max="64" value="20">
<div class="hint" id="lengthHint">20 characters, all character sets on.</div>
</div>
<div class="field" id="wordsField" style="display:none">
<label>Words <span class="val" id="wordsVal">5</span></label>
<input type="range" id="words" min="3" max="10" value="5">
<div class="hint">5 words from a 400-word list — about 43 bits of entropy.</div>
</div>
<div class="field" id="charsetsField">
<label>Character sets</label>
<div class="toggle on" data-set="lowercase">
<div class="check"><svg viewBox="0 0 16 16"><path d="M6.5 11.5L2 7l1.5-1.5L6.5 8.5 12.5 2.5 14 4z"/></svg></div>
<span class="txt">Lowercase</span>
<span class="count">a–z</span>
</div>
<div class="toggle on" data-set="uppercase">
<div class="check"><svg viewBox="0 0 16 16"><path d="M6.5 11.5L2 7l1.5-1.5L6.5 8.5 12.5 2.5 14 4z"/></svg></div>
<span class="txt">Uppercase</span>
<span class="count">A–Z</span>
</div>
<div class="toggle on" data-set="digits">
<div class="check"><svg viewBox="0 0 16 16"><path d="M6.5 11.5L2 7l1.5-1.5L6.5 8.5 12.5 2.5 14 4z"/></svg></div>
<span class="txt">Digits</span>
<span class="count">0–9</span>
</div>
<div class="toggle on" data-set="symbols">
<div class="check"><svg viewBox="0 0 16 16"><path d="M6.5 11.5L2 7l1.5-1.5L6.5 8.5 12.5 2.5 14 4z"/></svg></div>
<span class="txt">Symbols</span>
<span class="count">!@#$</span>
</div>
<div class="toggle" data-set="excludeAmbiguous">
<div class="check"><svg viewBox="0 0 16 16"><path d="M6.5 11.5L2 7l1.5-1.5L6.5 8.5 12.5 2.5 14 4z"/></svg></div>
<span class="txt">Exclude look-alikes</span>
<span class="count">0O o l 1 I</span>
</div>
</div>
<div class="field">
<label>Presets</label>
<div class="presets">
<button class="preset" data-preset="basic">
<span class="t">Basic</span>
<span class="d">16 chars, no symbols</span>
</button>
<button class="preset" data-preset="strong">
<span class="t">Strong</span>
<span class="d">20 chars, all on</span>
</button>
<button class="preset" data-preset="maximum">
<span class="t">Maximum</span>
<span class="d">32 chars, all on</span>
</button>
<button class="preset" data-preset="passphrase">
<span class="t">Passphrase</span>
<span class="d">6 memorable words</span>
</button>
</div>
</div>
</div>
</aside>
<section class="main">
<!-- Single -->
<div class="pane active" id="pane-single">
<div class="display-wrap">
<div class="display">
<div class="pw" id="pwDisplay">—</div>
<div class="actions">
<button class="d-btn" id="copyBtn" title="Copy">
<svg viewBox="0 0 16 16"><path d="M4 2h7l3 3v9H4zM5 3v10h8V6h-3V3z"/></svg>
</button>
<button class="d-btn" id="regenBtn" title="Regenerate">
<svg viewBox="0 0 16 16"><path d="M8 3V1L3 4l5 3V5a3 3 0 1 1-3 3H3a5 5 0 1 0 5-5z"/></svg>
</button>
</div>
</div>
</div>
<div class="meter-wrap">
<div class="meter"><div class="fill" id="meterFill"></div></div>
<div class="meter-labels">
<span>Strength: <b id="strengthLabel">—</b></span>
<span id="meterHint"></span>
</div>
</div>
<div class="stats">
<div class="stat">
<div class="lbl">Entropy</div>
<div class="val" id="entropyVal">—<small>bits</small></div>
<div class="sub" id="entropySub">Randomness</div>
</div>
<div class="stat">
<div class="lbl">Search space</div>
<div class="val" id="searchVal">—</div>
<div class="sub" id="searchSub">Possible combinations</div>
</div>
<div class="stat">
<div class="lbl">Crack time</div>
<div class="val" id="crackVal">—</div>
<div class="sub">At 10¹² guesses/sec</div>
</div>
</div>
<div class="regen-wrap">
<button class="btn primary" id="regenBtn2">
<svg viewBox="0 0 16 16"><path d="M8 3V1L3 4l5 3V5a3 3 0 1 1-3 3H3a5 5 0 1 0 5-5z"/></svg>
Generate new password
</button>
</div>
</div>
<!-- Bulk -->
<div class="pane" id="pane-bulk">
<div class="bulk-wrap">
<div class="bulk-head">
<span class="info">
Generating
<input type="number" class="bulk-count" id="bulkCount" value="20" min="1" max="500">
passwords
</span>
<div class="spacer"></div>
<button class="btn" id="bulkDownload">
<svg viewBox="0 0 16 16"><path d="M8 1v8l3-3 1 1-4 4-4-4 1-1 3 3V1zM2 13h12v2H2z"/></svg>
Download .txt
</button>
<button class="btn primary" id="bulkGen" style="flex:none">Generate</button>
</div>
<div class="bulk-list" id="bulkList">
<div style="padding:40px;text-align:center;color:var(--text-dim);font-size:13px">
Click <b style="color:var(--text-bright)">Generate</b> to create a list of passwords using the settings on the left.
</div>
</div>
</div>
</div>
<!-- Check -->
<div class="pane" id="pane-check">
<div class="check-wrap">
<div class="check-field">
<input type="password" id="checkInput" placeholder="Type or paste a password to analyze…" spellcheck="false" autocomplete="off">
<button class="toggle-vis" id="toggleVis">
<svg viewBox="0 0 16 16"><path d="M8 3C4.5 3 1.7 5.4 1 8c.7 2.6 3.5 5 7 5s6.3-2.4 7-5c-.7-2.6-3.5-5-7-5zm0 8a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0-1.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z"/></svg>
Show
</button>
</div>
<div id="checkResults">
<div style="text-align:center;color:var(--text-dim);padding:40px;font-size:13px">
Type something to see how strong it is.<br>
<span style="font-size:12px">Analysis runs entirely on your device — nothing is sent anywhere.</span>
</div>
</div>
</div>
</div>
</section>
</div>
<footer class="statusbar">
<div class="st"><span class="dotstatus"></span><span id="status">Ready</span></div>
<div class="spacer"></div>
<div class="st">Runs offline</div>
<div class="st">Vault v1.0</div>
</footer>
<div class="toast" id="toast"></div>
<script>
/* ════════════════════════════════════════════════════════════════
1. STATE
════════════════════════════════════════════════════════════════ */
const state = {
mode: 'random', // 'random' | 'passphrase' | 'pin'
length: 20,
words: 5,
sets: {
lowercase: true,
uppercase: true,
digits: true,
symbols: true,
excludeAmbiguous: false,
},
bulk: [],
};
const $ = id => document.getElementById(id);
/* ════════════════════════════════════════════════════════════════
2. SECURE RANDOM (no modulo bias)
════════════════════════════════════════════════════════════════ */
function secureRandomInt(max){
if (max <= 0) throw new Error('max must be > 0');
const limit = Math.floor(0x100000000 / max) * max;
const arr = new Uint32Array(1);
let x;
do { crypto.getRandomValues(arr); x = arr[0]; } while (x >= limit);
return x % max;
}
/* ════════════════════════════════════════════════════════════════
3. CHARACTER SETS
════════════════════════════════════════════════════════════════ */
const CHARSETS = {
lowercase: 'abcdefghijklmnopqrstuvwxyz',
uppercase: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
digits: '0123456789',
symbols: '!@#$%^&*()-_=+[]{};:,.<>?/~',
};
const AMBIGUOUS = new Set('0OoIl1|`\'"{}[]()/\\');
/* ════════════════════════════════════════════════════════════════
4. WORDLIST FOR PASSPHRASE MODE
~400 common, memorable, 3–8 letter words
════════════════════════════════════════════════════════════════ */
const WORDLIST = `able acid acorn actor adapt adore agent agile album alert alien alive alley
alter amber angel anger angle ankle apart apple apron arbor arena argue arise armor
aroma arrow asset atlas audio audit avoid awake aware badge baker balance bamboo banana
banjo baron basic basin batch beach beacon beam beard beast began begin being belly
below bench berry birch birth bison black blade blame blank blast blaze bleak blend
bless blind blink bliss block bloom blown blues blunt blush board boast bonus boost
booth bound brace braid brain brake brand brass brave bread break breed brick bride
brief bring brisk broad broke bronze brook broom brown brush buddy budge bugle build
built bunch bunny burst cabin cable cache cadet camel candy canal canoe cargo carry
carve catch cause cease cedar chain chair chalk champ chant chaos charm chart chase
cheap cheat check cheek cheer chess chest chief child chill chime china chip choir
chord chose chunk cider cigar cinch civic civil claim clamp clash clasp class clean
clear clerk click cliff climb cling cloak clock close cloth cloud clown clump coach
coast cobra cocoa colon color comet comic coral corny couch cough could count court
cover crack craft crane crank crash crate crave crawl crazy cream creek creep crept
crest crew crime crisp crook cross crowd crown crude cruel crumb crush crust cubic
curio curly curry curve cycle daily dairy daisy dance dandy dared darts dated dealt
death debit debut decal decay decor decoy delay delta dense depth derby desks devil
diary dice digit dimly diner dingo dirty ditch diver dizzy dodge doing dolly donor
donut doubt dough dozen draft drain drama drank drape drawn dread dream dress dried
drift drill drink drive droid drone drove drown drums dryer ducks dunes dusty dwarf
dwell eagle early earth easel eaten ebony edged eight elbow elder elect elite ember
empty enact ended enemy enjoy enter entry equal equip erase error essay ether evade
event every exact exile exist extra fable faced facet faint fairy faith false fancy
farce fatal fault favor feast fella fence ferry fetch fever fiber field fiery fifth
fifty fight filet final finch fires first fishy fixed fizzy flags flake flame flank
flash flask fleet flesh flick fling flint float flock flood floor flora flour flown
fluid flush flute foamy focus foggy folly foods force forge forth forty forum found
frame frank fraud fresh fried frill frisk frost froth frown froze fruit fudge fully
funky funny fuzzy gauge gavel gecko geese genre ghost giant giddy gifted girly given
giver glade gland glare glass gleam glide glint gloat globe gloom glory gloss glove
gnome going goose gorge grace grade graft grain grand grant grape graph grasp grass
grave gravy graze great greed green greet grief grill grime grind gripe groan groom
gross group grove growl grown gruff guard guess guest guide guild guilty gully gusto
habit hairy handy happy hardy harsh haste hatch haunt haven havoc hazel heart heavy
hedge hefty hello hence herbs hero heron hilly hinge hippo hitch hobby hoist holly
honey honor horde horse hotel hound house hover human humid humor hunch hurry husky
hyena ideal idiom idler igloo image imply inbox incur index inept infer ingot inlet
inner input intro irate irony issue ivory ivy jelly jewel jiffy joint joker jolly
joust judge juice juicy jumbo jumpy juror kayak kebab kebab khaki kinda kiosk kitty
knack kneel knife knock knoll known koala kudos label labor lance lapse large larva
laser latch later lathe latte laugh layer leaky learn lease leash least leave ledge
legal lemon lemur level lever light lilac limbo limit linen liner lingo lithe liver
llama lobby local lodge lofty logic loose lorry loser lotus lounge lousy lover lower
loyal lucid lucky lumen lunar lunch lunge lupus lurch lyric macaw macho madam magic
magma maize major maker mango manic manor maple march marsh mason match mates maybe
mayor meant medal media melon mercy merge merit merry messy metal meter metro micro
midst might mimic mince miner minor minus mirth miser mixed model modem moist molar
money month moody moose moral morph mossy motel motor motto mound mount mourn mouse
mouth mover movie mower mucus muddy muffin muggy mully mummy mural mushy music musky
musty muted myrrh nacho nadir naive naked named nanny nasal nasty naval navel needy
nerdy nerve never newer newly newts niche niece night ninja ninth noble nobly noise
noisy nomad nosed noted novel nudge nurse nutty nylon oasis obese occur ocean offer
often oiled olden olive omega onion onset opera opine optic orbit order organ other
otter ought ounce outer owner oxide ozone paced paddy pagan paint pale palm panda
panel panic paper parka parry party pasta paste patch patio pause paved peace peach
pearl pedal peers penny perch peril perky pesky petal petty phase phone photo piano
picky piece piety piggy pilot pinch pines pinky piper pique pitch pitty pivot pixel
pizza place plaid plain plane plank plant plaza plead pleat plied plier pluck plumb
plume plump plush poach point poise poker polar polio polka pooch poppy porch pored
poser posse pouch pound power prank prawn preen press price pride pried prime primo
print prior prism privy prize probe prone prong proof props proud prove prowl proxy
prude prune psalm pulse punch pupil puppy puree purse pushy putty pygmy quack quail
quake qualm quark quart queen query quest queue quick quiet quill quilt quirk quite
quota quote rabbi radar radio rafts rainy raise rally ramen ranch range rapid ratio
ratty raven razor reach ready realm rebel rebus recap recur redid reedy refer regal
reign relax relay relic remit renal renew repay reply rerun reset resin retro retro
rheum rhino rhyme rider ridge rifle right rigid rinse riper risen risky rival river
rivet roast robin robot rocky rodeo rogue roman rotor rouge rough round route rover
royal ruddy ruler rumor rural rusty saber sadly safer saint salad salon salsa salty
salvo sandy saner sappy sassy satin satyr sauce saucy sauna saved savor savvy scald
scale scalp scant scare scarf scary scene scent scion scoff scold scone scoop scoot
scope score scorn scout scowl scrap scrub scuba sedan seedy seize sense sepia serif
serum serve setup seven sever sewer shack shade shady shaft shake shaky shale shall
shame shape share shark sharp shave shawl sheaf shear sheen sheep sheer sheet shelf
shell shift shine shiny shire shirk shirt shoal shock shone shook shoot shore shorn
short shout shove shown shrub shrug shuck shunt shush shyly sider sierra sieve sight
sigma silky silly since sinew singe siren sixth sixty sized skate skier skiff skill
skimp skirt skulk skull slack slain slang slant slash slate slave sleek sleep sleet
slept slice slick slide slime slimy sling slink slope slosh sloth slump slurp slush
small smart smash smear smell smelt smile smirk smite smith smock smoke smoky snack
snafu snail snake snaky snare snarl sneak sneer snide sniff snipe snoop snore snort
snout snowy snuck snuff soapy sober soggy solar solid solve sonar sonic sooth sooty
sorry sound south space spade spank spare spark spasm spawn speak spear speck speed
spell spend spent sperm spice spicy spied spike spiky spill spilt spine spiny spire
spite splat split spoil spoke spoof spook spool spoon spore sport spout spray spree
sprig spuds spunk spurn spurt squad squat squid stack staff stage staid stain stair
stake stale stalk stall stamp stand stank stare stark stars start state stave stay
steak steal steam steed steel steep steer stein stern stick stiff still stilt sting
stink stint stock stoic stoke stole stomp stone stony stood stool stoop store stork
storm story stout stove strap straw stray strip strut stuck study stuff stump stung
stunk stunt style suave sugar suite sulky sunny super surge surly sushi swamp swarm
swath swear sweat sweep sweet swell swept swift swing swirl swish swoon swoop sword
swore sworn swung synod syrup tabby table taboo tacit tacky taffy taint taken taker
tally talon tamer tango tangy taper tapir tardy tarot taste tasty tatty taunt tawny
teach tease teddy teeth tempo tempt tenor tense tenth tepee tepid terse testy thank
theft their theme there these thick thief thigh thing think third thong thorn those
three threw throb throw thumb thump tibia tidal tiger tight tilde timer timid tipsy
titan tithe title toads toast today toddy token tonal tonic tooth topaz topic torch
total totem touch tough towel tower toxic toxic trace track tract trade trail train
trait tramp trash tread treat trend triad trial tribe trick tried tries trike trill
trims trite troll troop trope trout truce truck truly trump trunk truss trust truth
tryst tubby tulip tumor tunic turbo tutor twang tweak tweed tweet twice twine twirl
twist typal udder ulcer ultra umbra uncle uncut under undid undue unfit unify union
unite unity unlit unmet until unwed unzip upper upset urban urged usage usher using
usual utter vague valet valid valor value valve vapor vault vaunt vegan venom venue
verge verse verso vetch vicar video vigil vigor villa vinyl viola viper viral virus
visit visor vital vivid vixen vocal vodka vogue voice voila voter vouch vowel vroom
vying wacky wafer wager wagon waist waltz wander waned wares warty washed washy
waste watch water waver waxen weedy weigh weird welch welsh whack whale wharf wheat
wheel where which whiff while whine whirl whisk white whole whoop whose widen wider
widow width wield wimpy wince windy wined wiper wired wiser wispy witch witty woken
woman women woody wooed woozy words wordy world worry worse worst worth would wound
woven wrack wrath wreak wreck wrest wring wrist write wrong wrote wrung yacht yeast
yield yodel yogic yokel young yours youth yummy zebra zesty zippy zonal zoned zooms`;
const WORDS = WORDLIST.trim().split(/\s+/).filter(w => w.length >= 3);
const WORDS_COUNT = WORDS.length;
/* ════════════════════════════════════════════════════════════════
5. GENERATORS
════════════════════════════════════════════════════════════════ */
function buildPool(){
let pool = '';
const required = [];
for (const name of ['lowercase','uppercase','digits','symbols']){
if (!state.sets[name]) continue;
let set = CHARSETS[name];
if (state.sets.excludeAmbiguous){
set = [...set].filter(c => !AMBIGUOUS.has(c)).join('');
}
if (set.length){
pool += set;
required.push(set);
}
}
return { pool, required };
}
function generateRandom(){
const { pool, required } = buildPool();
if (!pool) return '';
const chars = [];
// guarantee one from each required set
for (const s of required){
chars.push(s[secureRandomInt(s.length)]);
}
// fill the rest
while (chars.length < state.length){
chars.push(pool[secureRandomInt(pool.length)]);
}
// trim if we overshot (length smaller than required sets)
chars.length = state.length;
// Fisher-Yates with secure random
for (let i = chars.length - 1; i > 0; i--){
const j = secureRandomInt(i + 1);
[chars[i], chars[j]] = [chars[j], chars[i]];
}
return chars.join('');
}
function generatePassphrase(){
const n = state.words;
const words = [];
for (let i = 0; i < n; i++){
words.push(WORDS[secureRandomInt(WORDS.length)]);
}
return words;
}
function generatePassword(){
if (state.mode === 'passphrase') return generatePassphrase();
if (state.mode === 'pin'){
const len = state.length;
let out = '';
for (let i = 0; i < len; i++) out += secureRandomInt(10);
return out;
}
return generateRandom();
}
/* ════════════════════════════════════════════════════════════════
6. ENTROPY + CRACK TIME
════════════════════════════════════════════════════════════════ */
function getEntropy(){
if (state.mode === 'passphrase'){
return state.words * Math.log2(WORDS_COUNT);
}
if (state.mode === 'pin'){
return state.length * Math.log2(10);
}
const { pool } = buildPool();
if (!pool) return 0;
return state.length * Math.log2(pool.length);
}
function getSearchSpace(){
const bits = getEntropy();
return Math.pow(2, bits);
}
// Assume a modern attacker with a GPU rig doing 10^12 guesses/sec.
// Average time to crack = searchSpace / 2 / rate.
function formatCrackTime(bits){
if (bits <= 0) return 'instant';
const rate = 1e12;
const avg = Math.pow(2, bits) / 2 / rate; // seconds
if (avg < 1) return 'instant';
if (avg < 60) return Math.round(avg) + ' sec';
if (avg < 3600) return Math.round(avg / 60) + ' min';
if (avg < 86400) return Math.round(avg / 3600) + ' hours';
if (avg < 86400 * 30) return Math.round(avg / 86400) + ' days';
if (avg < 86400 * 365) return Math.round(avg / 86400 / 30) + ' months';
const years = avg / 86400 / 365;
if (years < 1000) return Math.round(years) + ' years';
if (years < 1e6) return (years / 1000).toFixed(1) + 'k years';
if (years < 1e9) return (years / 1e6).toFixed(1) + 'M years';
if (years < 1e12) return (years / 1e9).toFixed(1) + 'B years';
if (years < 1e15) return (years / 1e12).toFixed(1) + 'T years';
return 'longer than the universe';
}
function getStrength(bits){
if (bits < 28) return { label: 'Very weak', color: '#ef4444', pct: 8 };
if (bits < 40) return { label: 'Weak', color: '#f97316', pct: 25 };
if (bits < 60) return { label: 'Fair', color: '#fbbf24', pct: 50 };
if (bits < 80) return { label: 'Strong', color: '#4ade80', pct: 75 };
if (bits < 120) return { label: 'Very strong', color: '#22c55e', pct: 92 };
return { label: 'Overkill', color: '#a78bfa', pct: 100 };
}
/* ════════════════════════════════════════════════════════════════
7. SINGLE MODE
════════════════════════════════════════════════════════════════ */
let currentPassword = '';
function renderSingle(){
const pw = generatePassword();
currentPassword = pw;
const pwEl = $('pwDisplay');
if (state.mode === 'passphrase'){
pwEl.classList.add('passphrase');
pwEl.innerHTML = pw.map(w => `<span class="word">${w}</span>`).join('<span class="sep">·</span>');
} else {
pwEl.classList.remove('passphrase');
pwEl.textContent = pw;
}
const bits = getEntropy();
const strength = getStrength(bits);
$('entropyVal').innerHTML = `${bits.toFixed(1)}<small>bits</small>`;
$('searchVal').textContent = formatBigNumber(getSearchSpace());
$('crackVal').textContent = formatCrackTime(bits);
$('strengthLabel').textContent = strength.label;
$('strengthLabel').style.color = strength.color;
$('meterFill').style.width = strength.pct + '%';
$('meterFill').style.background = strength.color;
$('meterHint').textContent = bits >= 80
? 'Way beyond any practical attack'
: bits >= 60
? 'Strong enough for anything personal'
: bits >= 40
? 'OK for low-value accounts'
: 'Too short or too simple';
}
function formatBigNumber(n){
if (n < 1e3) return Math.round(n).toLocaleString();
if (n < 1e6) return (n / 1e3).toFixed(1) + ' thousand';
if (n < 1e9) return (n / 1e6).toFixed(1) + ' million';
if (n < 1e12) return (n / 1e9).toFixed(1) + ' billion';
if (n < 1e15) return (n / 1e12).toFixed(1) + ' trillion';
if (n < 1e18) return (n / 1e15).toFixed(1) + ' quadrillion';
if (n < 1e21) return (n / 1e18).toFixed(1) + ' quintillion';
return n.toExponential(2);
}
/* ════════════════════════════════════════════════════════════════
8. BULK MODE
════════════════════════════════════════════════════════════════ */
function renderBulk(){
const list = $('bulkList');
if (state.bulk.length === 0){
list.innerHTML = `<div style="padding:40px;text-align:center;color:var(--text-dim);font-size:13px">
Click <b style="color:var(--text-bright)">Generate</b> to create a list of passwords using the settings on the left.
</div>`;
return;
}
list.innerHTML = state.bulk.map((pw, i) => `
<div class="bulk-row">
<span class="num">${i + 1}.</span>
<span class="pw" data-pw="${escapeHtml(pw)}">${escapeHtml(pw)}</span>
<button class="row-copy" data-copy="${escapeHtml(pw)}" title="Copy">
<svg viewBox="0 0 16 16"><path d="M4 2h7l3 3v9H4zM5 3v10h8V6h-3V3z"/></svg>
</button>
</div>
`).join('');
list.querySelectorAll('[data-copy]').forEach(btn => {
btn.addEventListener('click', () => {
copyText(btn.dataset.copy);
const svg = btn.innerHTML;
btn.innerHTML = '<svg viewBox="0 0 16 16"><path d="M6.5 11.5L2 7l1.5-1.5L6.5 8.5 12.5 2.5 14 4z"/></svg>';
setTimeout(() => btn.innerHTML = svg, 900);
});
});
list.querySelectorAll('.pw').forEach(el => {
el.addEventListener('click', () => copyText(el.dataset.pw));
});
}
function doBulkGenerate(){
const n = Math.min(500, Math.max(1, +$('bulkCount').value || 20));
$('bulkCount').value = n;
state.bulk = [];
for (let i = 0; i < n; i++){
const pw = generatePassword();
state.bulk.push(state.mode === 'passphrase' ? pw.join('-') : pw);
}
renderBulk();
toast(`Generated ${n} passwords`, 'success');
}
function downloadBulk(){
if (state.bulk.length === 0){ toast('Generate some first', 'error'); return; }
const text = state.bulk.join('\n');
const blob = new Blob([text], { type: 'text/plain' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = `vault-passwords-${new Date().toISOString().slice(0,10)}.txt`;
a.click();
setTimeout(() => URL.revokeObjectURL(url), 1000);
toast('Downloaded', 'success');
}
/* ════════════════════════════════════════════════════════════════
9. CHECK MODE
════════════════════════════════════════════════════════════════ */
const COMMON_PASSWORDS = new Set([
'password','123456','12345678','1234','qwerty','12345','dragon','pussy','baseball',
'football','letmein','monkey','696969','abc123','mustang','michael','shadow','master',
'jennifer','111111','2000','jordan','superman','harley','1234567','fuckme','hunter',
'fuckyou','trustno1','ranger','buster','thomas','tigger','robert','soccer','batman',
'test','pass','killer','hockey','george','charlie','andrew','michelle','love','sunshine',
'jessica','asshole','6969','pepper','daniel','access','123456789','654321','joshua',
'maggie','starwars','silver','william','dallas','yankees','123123','ashley','666666',
'hello','amanda','orange','biteme','freedom','computer','sexy','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','spider','rabbit','nascar',
'welcome','qwertyui','qwerty123','admin','root','toor','passw0rd','p@ssword','iloveyou'
]);
function analyzePassword(pw){
const issues = [];
const positives = [];
const len = pw.length;
// Basic stats
const hasLower = /[a-z]/.test(pw);
const hasUpper = /[A-Z]/.test(pw);
const hasDigit = /\d/.test(pw);
const hasSymbol = /[^a-zA-Z0-9]/.test(pw);
const variety = [hasLower, hasUpper, hasDigit, hasSymbol].filter(Boolean).length;
let poolSize = 0;
if (hasLower) poolSize += 26;
if (hasUpper) poolSize += 26;
if (hasDigit) poolSize += 10;
if (hasSymbol) poolSize += 33;