├── .gitignore ├── LICENSE ├── README.md ├── doc └── usage.png ├── go.mod ├── go.sum └── main.go /.gitignore: -------------------------------------------------------------------------------- 1 | vendor/ 2 | qrpwd -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Alexei Samokvalov 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # qrpwd 2 | Creates QR code for your password and prints it on console. 3 | 4 | It's a helper tool to transfer long passwords to a mobile phone. 5 | Now you can scan the created QR code, copy the content to clipboard and paste it in your password prompt. 6 | 7 | ## Installation 8 | Download binaries for your platform from [here](https://github.com/sam701/qrpwd/releases). 9 | 10 | ## Usage 11 | ![usage](/doc/usage.png) 12 | 13 | ## License 14 | [MIT](LICENSE) 15 | -------------------------------------------------------------------------------- /doc/usage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sam701/qrpwd/cf043752745cded9c43f428e0ddfca2141514348/doc/usage.png -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/sam701/qrpwd 2 | 3 | go 1.16 4 | 5 | require ( 6 | github.com/howeyc/gopass v0.0.0-20161003130900-f5387c492211 7 | github.com/mdp/qrterminal v0.1.1 8 | github.com/mdp/rsc v0.0.0-20160131164516-90f07065088d 9 | golang.org/x/crypto v0.0.0-20161122142712-ede567c8e044 10 | golang.org/x/sys v0.0.0-20161122214834-30237cf4eefd 11 | ) 12 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | github.com/howeyc/gopass v0.0.0-20161003130900-f5387c492211 h1:IDxI/EaCdmlyCtkiwK0hqqN4Wp+QAP5nFZGAj7w7nWY= 2 | github.com/howeyc/gopass v0.0.0-20161003130900-f5387c492211/go.mod h1:lADxMC39cJJqL93Duh1xhAs4I2Zs8mKS89XWXFGp9cs= 3 | github.com/mdp/qrterminal v0.1.1 h1:73MMZ1FEMZq60IUyocfBSjPIwfKNXAfdG2wZltZHJNE= 4 | github.com/mdp/qrterminal v0.1.1/go.mod h1:JHFxKzeFy8lXGu3bkkAZ4EwpmxWtm2laIs1MVvWoBt0= 5 | github.com/mdp/rsc v0.0.0-20160131164516-90f07065088d h1:j7DAJd/z/JtaXjFtlrLV8NHflBsg1rkrTqAJNLqMWBE= 6 | github.com/mdp/rsc v0.0.0-20160131164516-90f07065088d/go.mod h1:fIxvRMy+xQMcJGz9JAV25fJOKMRF1VQY/P8Mrni5XJA= 7 | golang.org/x/crypto v0.0.0-20161122142712-ede567c8e044 h1:Y9XVmhDScJq6IYvBArLzE+WUYD+6DbkXWTLHb/JSH88= 8 | golang.org/x/crypto v0.0.0-20161122142712-ede567c8e044/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 9 | golang.org/x/sys v0.0.0-20161122214834-30237cf4eefd h1:+NpmjbOwKk60ZOcrLw/zrhwc0fIJzIA1NWLqmEpxrvU= 10 | golang.org/x/sys v0.0.0-20161122214834-30237cf4eefd/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 11 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "github.com/howeyc/gopass" 6 | "github.com/mdp/qrterminal" 7 | "github.com/mdp/rsc/qr" 8 | "log" 9 | "os" 10 | ) 11 | 12 | func trimEscaped(bb []byte) []byte { 13 | startIx := 0 14 | for bb[startIx] == 27 { 15 | startIx += 3 16 | } 17 | return bb[startIx:] 18 | } 19 | 20 | func main() { 21 | fmt.Print("Type your password: ") 22 | 23 | passb, err := gopass.GetPasswd() 24 | if err != nil { 25 | log.Fatalln("ERROR", err) 26 | } 27 | str := string(trimEscaped(passb)) 28 | qrterminal.Generate(str, qr.H, os.Stdout) 29 | } 30 | --------------------------------------------------------------------------------