Browse Source

instead of padding with 0's, cycle through the secret.

Anthony Woods 10 years ago
parent
commit
092bb69c41
1 changed files with 1 additions and 5 deletions
  1. 1 5
      pkg/util/encryption.go

+ 1 - 5
pkg/util/encryption.go

@@ -60,11 +60,7 @@ func encryptionKeyToBytes(secret string) []byte {
 	keyBytes := []byte(secret)
 	secretLength := len(keyBytes)
 	for i := 0; i < 32; i++ {
-		if secretLength > i {
-			key[i] = keyBytes[i]
-		} else {
-			key[i] = 0
-		}
+		key[i] = keyBytes[i%secretLength]
 	}
 	return key
 }