diff --git a/pkg/security/encrypt.go b/pkg/security/encrypt.go index 00a6d7fe..3abe33f0 100644 --- a/pkg/security/encrypt.go +++ b/pkg/security/encrypt.go @@ -10,7 +10,12 @@ import ( // Encrypt encrypts a string. func (c Crypto) Encrypt(plainText string) (string, error) { - block, err := aes.NewCipher([]byte(c.EncryptionKey)) + return c.EncryptWithKey(plainText, c.EncryptionKey) +} + +// Encrypt encrypts a string with provided key. +func (c Crypto) EncryptWithKey(plainText, key string) (string, error) { + block, err := aes.NewCipher([]byte(key)) if err != nil { return "", err }