Use all characters for password by default
This commit is contained in:
		
							
								
								
									
										21
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								README.md
									
									
									
									
									
								
							@@ -2,24 +2,17 @@
 | 
				
			|||||||
Store passwords without actually storing them
 | 
					Store passwords without actually storing them
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## How does it work?
 | 
					## How does it work?
 | 
				
			||||||
Ose one password for access all other passwords, but в отличии от does not store them on disk or in memory at all.
 | 
					Use one password for access all other passwords, but unlike password managers (like Keepass family) this tool does not store them on disk or in memory at all.
 | 
				
			||||||
Gaspass is more a password generator than password manager or store tool. Every run you will get the password and this password will be the same if you use the same parameters like length, character set, resource and private key.
 | 
					Gaspass is more a password generator than password manager. Every run you will get the password and this password will always be the same if you use the same parameters such as length, character set, resource and private key.
 | 
				
			||||||
Work scheme is very similar to [lesspass](https://github.com/lesspass/lesspass), but uses modern [argon2id](https://en.wikipedia.org/wiki/Argon2) KDF (key derivation function) instead of PBKDF2-SHA1.
 | 
					Working principle is the same as [lesspass](https://github.com/lesspass/lesspass), but gaspass uses modern [argon2id](https://en.wikipedia.org/wiki/Argon2) KDF (key derivation function) instead of PBKDF2-SHA1.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Is it secure?
 | 
					## Is it secure?
 | 
				
			||||||
Generally yes, but it depends on private key quality and "защиты ключа"
 | 
					Generally yes, but it highly dependent on private key quality and protection
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
## ToDo
 | 
					## ToDo
 | 
				
			||||||
[] Tests
 | 
					[] More tests
 | 
				
			||||||
 | 
					[] Better README.md
 | 
				
			||||||
 | 
					[] Travis CI
 | 
				
			||||||
[] SECURITY.md
 | 
					[] SECURITY.md
 | 
				
			||||||
[] Resource management
 | 
					[] Resource management
 | 
				
			||||||
[] GUI
 | 
					[] GUI
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Это шобы версии текстов основного файла
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Compare this version with version of localized file to make sure toy read an actual information.
 | 
					 | 
				
			||||||
README.md version 0
 | 
					 | 
				
			||||||
							
								
								
									
										28
									
								
								src/gaspass/gaspass_test.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								src/gaspass/gaspass_test.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,28 @@
 | 
				
			|||||||
 | 
					package gaspass
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import "fmt"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func ExampleGeneratePassword(){
 | 
				
			||||||
 | 
					    p := Params{
 | 
				
			||||||
 | 
					        PrivKey:     []byte("asdfghjkl123"),
 | 
				
			||||||
 | 
					        Salt:        []byte(""),
 | 
				
			||||||
 | 
					        Counter:     []byte("0"),
 | 
				
			||||||
 | 
					        PassLength:  16,
 | 
				
			||||||
 | 
					        UseLower:    true,
 | 
				
			||||||
 | 
					        UseUpper:    true,
 | 
				
			||||||
 | 
					        UseNumbers:  true,
 | 
				
			||||||
 | 
					        UseSpecials: true,
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						password, err := p.GeneratePassword()
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							fmt.Println(err)
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						fmt.Println(*password)
 | 
				
			||||||
 | 
						// Output:
 | 
				
			||||||
 | 
						// `wPW`9'Ep$JH,@:7
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -35,7 +35,7 @@ func (p *Params) GeneratePassword() (*string, error) {
 | 
				
			|||||||
	// TODO: Check PassLength <= MAX_UINT32/8
 | 
						// TODO: Check PassLength <= MAX_UINT32/8
 | 
				
			||||||
	var charSet string
 | 
						var charSet string
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if !(p.UseLower && p.UseUpper && p.UseNumbers && p.UseSpecials) {
 | 
						if ! (p.UseLower || p.UseUpper || p.UseNumbers || p.UseSpecials) {
 | 
				
			||||||
		return nil, errors.New("Use at least one character group.")
 | 
							return nil, errors.New("Use at least one character group.")
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if p.UseLower {
 | 
						if p.UseLower {
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										16
									
								
								src/main.go
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								src/main.go
									
									
									
									
									
								
							@@ -24,6 +24,11 @@ func processFlags() {
 | 
				
			|||||||
		os.Exit(1)
 | 
							os.Exit(1)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//    if ! opts.CharsLower && ! opts.CharsUpper && ! opts.CharsNumbers && ! opts.CharsSpecials {
 | 
				
			||||||
 | 
					//		opts.CharsLower, opts.CharsUpper, opts.CharsNumbers, opts.CharsSpecials = true, true, true, true
 | 
				
			||||||
 | 
					//	}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var (
 | 
					var (
 | 
				
			||||||
@@ -32,17 +37,17 @@ var (
 | 
				
			|||||||
		CharsUpper    bool   `short:"u" long:"upper" description:"Use upper-case characters for generating password"`
 | 
							CharsUpper    bool   `short:"u" long:"upper" description:"Use upper-case characters for generating password"`
 | 
				
			||||||
		CharsNumbers  bool   `short:"n" long:"numeric" description:"Use numeric characters for generating password"`
 | 
							CharsNumbers  bool   `short:"n" long:"numeric" description:"Use numeric characters for generating password"`
 | 
				
			||||||
		CharsSpecials bool   `short:"s" long:"specials" description:"Use speacial (punctuation) characters for generating password"`
 | 
							CharsSpecials bool   `short:"s" long:"specials" description:"Use speacial (punctuation) characters for generating password"`
 | 
				
			||||||
		Length        int    `short:"q" long:"quantity" default:"16" description:"Set number of characters in the password"`
 | 
							Length        uint32 `short:"q" long:"quantity" default:"16" description:"Set number of characters in the password"`
 | 
				
			||||||
		Salt          string `short:"r" long:"resource" description:"Resource name (url or some descriptive text) for which password will be generated"`
 | 
							Salt          string `short:"r" long:"resource" description:"Resource name (url or some descriptive text) for which password will be generated"`
 | 
				
			||||||
		Counter       string `short:"c" long:"counter" default:"0" description:"Serial number of the password for the same resource"`
 | 
							Counter       string `short:"c" long:"counter" default:"0" description:"Serial number of the password for the same resource"`
 | 
				
			||||||
 | 
					/*      // Not implemented yet
 | 
				
			||||||
		ActionAdd     bool   `short:"A" long:"add" description:"Add resource record to the database"`
 | 
							ActionAdd     bool   `short:"A" long:"add" description:"Add resource record to the database"`
 | 
				
			||||||
		ActionRemove  bool   `short:"D" long:"delete" description:"Remove resource record from the database"`
 | 
							ActionRemove  bool   `short:"D" long:"delete" description:"Remove resource record from the database"`
 | 
				
			||||||
		ActionUseRes  bool   `short:"R" long:"use-resource" description:"Use existing resource"`
 | 
							ActionUseRes  bool   `short:"R" long:"use-resource" description:"Use existing resource"`
 | 
				
			||||||
		ActionList    bool   `short:"L" long:"list" description:"List resource records in the database"`
 | 
							ActionList    bool   `short:"L" long:"list" description:"List resource records in the database"`
 | 
				
			||||||
		ActionBench   bool   `short:"B" long:"bench" description:"Run benchmark"`
 | 
							ActionBench   bool   `short:"B" long:"bench" description:"Run benchmark"`
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					 | 
				
			||||||
	charSet string = ""
 | 
					 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func main() {
 | 
					func main() {
 | 
				
			||||||
@@ -55,6 +60,7 @@ func main() {
 | 
				
			|||||||
		os.Exit(1)
 | 
							os.Exit(1)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	p := gaspass.Params{
 | 
						p := gaspass.Params{
 | 
				
			||||||
		PrivKey:     privKey,
 | 
							PrivKey:     privKey,
 | 
				
			||||||
		Salt:        []byte(opts.Salt),
 | 
							Salt:        []byte(opts.Salt),
 | 
				
			||||||
@@ -62,7 +68,7 @@ func main() {
 | 
				
			|||||||
		PassLength:  opts.Length,
 | 
							PassLength:  opts.Length,
 | 
				
			||||||
		UseLower:    opts.CharsLower,
 | 
							UseLower:    opts.CharsLower,
 | 
				
			||||||
		UseUpper:    opts.CharsUpper,
 | 
							UseUpper:    opts.CharsUpper,
 | 
				
			||||||
		UseNumber:   opts.CharsNumbers,
 | 
							UseNumbers:  opts.CharsNumbers,
 | 
				
			||||||
		UseSpecials: opts.CharsSpecials,
 | 
							UseSpecials: opts.CharsSpecials,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -71,5 +77,5 @@ func main() {
 | 
				
			|||||||
		println(err.Error())
 | 
							println(err.Error())
 | 
				
			||||||
		os.Exit(1)
 | 
							os.Exit(1)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	fmt.Println(resultPass)
 | 
						fmt.Println(*resultPass)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,11 +0,0 @@
 | 
				
			|||||||
package gaspass
 | 
					 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
import "fmt"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func ExampleGeneratePassword(){
 | 
					 | 
				
			||||||
	fmt.Println(GeneratePassword([]byte("asdfghjkl123")))
 | 
					 | 
				
			||||||
	// Output:
 | 
					 | 
				
			||||||
	// `wPW`9'Ep$JH,@:7
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
*/
 | 
					 | 
				
			||||||
		Reference in New Issue
	
	Block a user