feat: add crypto pkg

This commit is contained in:
Livio Amstutz
2020-03-23 07:06:44 +01:00
parent c89397e1b4
commit 90342ed872
10 changed files with 1091 additions and 0 deletions

View 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)
}