mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:47:32 +00:00
feat: add crypto pkg
This commit is contained in:
17
internal/crypto/aes_test.go
Normal file
17
internal/crypto/aes_test.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package crypto
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestDecrypt_OK(t *testing.T) {
|
||||
encryptedpw, err := EncryptAESString("ThisIsMySecretPw", "passphrasewhichneedstobe32bytes!")
|
||||
assert.NoError(t, err)
|
||||
|
||||
decryptedpw, err := DecryptAESString(encryptedpw, "passphrasewhichneedstobe32bytes!")
|
||||
assert.NoError(t, err)
|
||||
|
||||
assert.Equal(t, "ThisIsMySecretPw", decryptedpw)
|
||||
}
|
Reference in New Issue
Block a user