Add passwords separator

This commit is contained in:
Illya Marchenko 2024-03-28 13:28:15 +02:00
parent 8889eccef6
commit 7291c3a19f
Signed by: stuzer05
GPG Key ID: A6ABAAA9268F9F4F

12
main.go

@ -19,6 +19,7 @@ func main() {
flagSetNumbers := flag.Bool("n", false, "use numbers")
flagSetSpecialChars := flag.Bool("s", false, "use special characters")
flagSetSpaces := flag.Bool("S", false, "use spaces")
flagSetUnicodeCyrillic := flag.Bool("unicode-cyrillic", false, "use unicode cyrillic characters")
flagSetUnicodeJapanese := flag.Bool("unicode-japanese", false, "use unicode Japanese characters")
flagSetUnicodeChinese := flag.Bool("unicode-chinese", false, "use unicode Chinese characters")
@ -42,12 +43,13 @@ func main() {
*flagSetSpecialChars = true
*flagSetSpaces = true
*flagSetUnicodeCyrillic = true
*flagSetUnicodeJapanese = true
*flagSetUnicodeChinese = true
}
// use default password preset no sets were requested
if !*flagSetAll && !*flagSetAsciiLowercase && !*flagSetAsciiUppercase && !*flagSetNumbers && !*flagSetSpecialChars && !*flagSetSpaces && !*flagSetUnicodeJapanese && !*flagSetUnicodeChinese {
if !*flagSetAll && !*flagSetAsciiLowercase && !*flagSetAsciiUppercase && !*flagSetNumbers && !*flagSetSpecialChars && !*flagSetSpaces && !*flagSetUnicodeCyrillic && !*flagSetUnicodeJapanese && !*flagSetUnicodeChinese {
*flagSetAsciiLowercase = true
*flagSetAsciiUppercase = true
*flagSetNumbers = true
@ -73,6 +75,9 @@ func main() {
}
// unicode
if *flagSetUnicodeCyrillic {
characterSets = append(characterSets, dictionary.ShuffleDictionarySet(sets.Cyrillic()))
}
if *flagSetUnicodeJapanese {
characterSets = append(characterSets, dictionary.ShuffleDictionarySet(sets.Japanese()))
}
@ -87,5 +92,10 @@ func main() {
for _, i := range password {
fmt.Printf("%c", i)
}
// new line
if i < *flagCount {
fmt.Print("\n")
}
}
}