fugadalcontrollo/views/password.pug

63 lines
2.3 KiB
Plaintext
Raw Normal View History

2018-08-11 01:26:31 +02:00
extends layout
block content
p.
2018-08-11 01:41:17 +02:00
Bla bla bla qui devi scegliere una buona password
2018-08-12 00:01:09 +02:00
cosa puoi provare:
2018-08-11 01:26:31 +02:00
2018-08-12 00:01:09 +02:00
li cia0Antaniqwer10102018
li Tr0ub4dour&3
br
2018-08-12 00:05:52 +02:00
#app(v-cloak)
2018-08-12 00:01:09 +02:00
input(
type='password',
v-model='password',
@input='checkStrength'
:class="['score' + estimationScore]"
)
button(:disabled="estimationScore!==4") ➜
p(v-if='password.length>2').
Questa password è {{score[estimationScore]}}, dopo un sequestro uno bravo
ci mette più o meno <b>{{slowCrackTime}}</b> a scoprirla,
la CIA circa <b>{{fastCrackTime}}</b>:
li(v-for="s in sequence")
span(v-if="s.pattern=='bruteforce'") {{s.token}} forza bruta
span(v-else-if="s.pattern=='dictionary'").
{{s.token}} dizionario: {{s.dictionary_name}}
{{s.reversed?'(invertita ' + s.matched_word + ')':''}}
{{s.l33t?'(con sostituzione ' + s.sub_display +')':''}}
{{s.uppercase_variations>1?'(con maiuscola)':''}}
span(v-else-if="s.pattern=='sequence'") {{s.token}} sequenze: ({{s.sequence_name}})
span(v-else-if="s.pattern=='spatial'") {{s.token}} sequenze spaziali: ({{s.graph}})
span(v-else-if="s.pattern=='repeat'") {{s.token}} ripetizione: ({{s.base_token}})
span(v-else-if="s.pattern=='date'") {{s.token}} data {{s.day}}/{{s.month}}/{{s.year}}
span(v-else-if="s.pattern=='regex'") {{s.token}} pattern {{s.regex_name}}
span(v-else) {{s}}
2018-08-11 01:41:17 +02:00
2018-08-12 00:01:09 +02:00
script(src='/js/vue.min.js')
script(src='/js/zxcvbn.js')
script(src='/js/moment.js')
2018-08-11 01:26:31 +02:00
script.
2018-08-12 00:01:09 +02:00
moment.locale('it');
var app = new Vue({
el: '#app',
data: {
password: '',
estimationScore: 0,
score: ['inutile', 'pessima', 'brutta', 'così così', 'buona'],
scoreColor: 'red',
slowCrackTime: '',
fastCrackTime: '',
sequence: [],
},
methods: {
checkStrength (e) {
var estimation = zxcvbn(this.password)
this.estimationScore = estimation.score;
this.slowCrackTime = moment.duration(estimation.crack_times_seconds.offline_slow_hashing_1e4_per_second, 'seconds').humanize();
this.fastCrackTime = moment.duration(estimation.crack_times_seconds.offline_fast_hashing_1e10_per_second, 'seconds').humanize();
this.sequence = estimation.sequence;
}
2018-08-11 01:41:17 +02:00
}
2018-08-12 00:01:09 +02:00
})