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.

32 lines
526 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. scryptSalt = "linx-server"
  11. scryptN = 16384
  12. scryptr = 8
  13. scryptp = 1
  14. scryptKeyLen = 32
  15. )
  16. func main() {
  17. fmt.Printf("Enter key to hash: ")
  18. scanner := bufio.NewScanner(os.Stdin)
  19. scanner.Scan()
  20. checkKey, err := scrypt.Key([]byte(scanner.Text()), []byte(scryptSalt), scryptN, scryptr, scryptp, scryptKeyLen)
  21. if err != nil {
  22. return
  23. }
  24. fmt.Println(base64.StdEncoding.EncodeToString(checkKey))
  25. }