Contains the Concourse pipeline definition for building a line-server container
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
550 B

9 years ago
  1. package main
  2. import (
  3. "bufio"
  4. "encoding/base64"
  5. "fmt"
  6. "os"
  7. "golang.org/x/crypto/scrypt"
  8. )
  9. const (
  10. authPrefix = "Linx "
  11. scryptSalt = "linx-server"
  12. scryptN = 16384
  13. scryptr = 8
  14. scryptp = 1
  15. scryptKeyLen = 32
  16. )
  17. func main() {
  18. fmt.Printf("Enter key to hash: ")
  19. scanner := bufio.NewScanner(os.Stdin)
  20. scanner.Scan()
  21. checkKey, err := scrypt.Key([]byte(scanner.Text()), []byte(scryptSalt), scryptN, scryptr, scryptp, scryptKeyLen)
  22. if err != nil {
  23. return
  24. }
  25. fmt.Println(base64.StdEncoding.EncodeToString(checkKey))
  26. }