5 Commits

Author SHA1 Message Date
Maximilian e1ced3f76d Update binaries to the latest version 2023-01-30 00:06:15 -06:00
Maximilian cdbca3b074 Add makefile 2023-01-30 00:05:53 -06:00
Maximilian e4eca321f6 Update version 2023-01-29 23:37:46 -06:00
Maximilian 0eacc92a45 Formatting 2023-01-29 23:36:47 -06:00
Maximilian e96fded8ff Cryptographically generate password characters 2023-01-29 23:30:21 -06:00
12 changed files with 47 additions and 2 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+8 -2
View File
@@ -1,12 +1,13 @@
// GoPass
// Author: Maximilian Patterson
// Version: 1.2.1
// Version: 1.2.2
package main
import (
cryptorand "crypto/rand"
"encoding/binary"
"fmt"
"math/big"
mathrand "math/rand"
"os"
"strconv"
@@ -60,7 +61,12 @@ func main() {
// Assign every slot of pass to a random allowedCharacter
for i := range pass {
// Generate a random int greater than 0 and not to exceed the length of allowedCharacters
pass[i] = allowedCharacters[mathrand.Intn(len(allowedCharacters))]
index, err := cryptorand.Int(cryptorand.Reader, big.NewInt(int64(len(allowedCharacters))))
if err != nil {
println("Error securely generating random character!")
return
}
pass[i] = allowedCharacters[index.Int64()]
}
// Print the password
+39
View File
@@ -0,0 +1,39 @@
# The current version number of the program
VERSION := 1.2.2
# List of OS and architecture combinations to build
BUILD_OS_ARCH := \
darwin/amd64 \
linux/386 \
linux/amd64 \
windows/386 \
windows/amd64
# Build all targets
all: $(BUILD_OS_ARCH)
# Build targets in the form of `OS/ARCH`
darwin/amd64:
GOOS=darwin \
GOARCH=amd64 \
go build -ldflags="-s -w" -o "gopass-darwin-amd64-$(VERSION)" main.go
linux/386:
GOOS=linux \
GOARCH=386 \
go build -ldflags="-s -w" -o "gopass-linux-386-$(VERSION)" main.go
linux/amd64:
GOOS=linux \
GOARCH=amd64 \
go build -ldflags="-s -w" -o "gopass-linux-amd64-$(VERSION)" main.go
windows/386:
GOOS=windows \
GOARCH=386 \
go build -ldflags="-s -w" -o "gopass-windows-386-$(VERSION)" main.go
windows/amd64:
GOOS=windows \
GOARCH=amd64 \
go build -ldflags="-s -w" -o "gopass-windows-amd64-$(VERSION)" main.go