aes_test.go 595 B

123456789101112131415161718192021222324
  1. package aes
  2. import (
  3. "testing"
  4. "go-common/app/interface/main/report-click/service/crypto/padding"
  5. . "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestAES(t *testing.T) {
  8. var (
  9. aesKey = ""
  10. aesIv = ""
  11. bs = []byte("this is test massage ")
  12. )
  13. Convey("aes test ", t, func() {
  14. bs, _ = CBCDecrypt(bs, []byte(aesKey), []byte(aesIv), padding.PKCS5)
  15. ECBDecrypt(bs, []byte(aesKey), padding.PKCS5)
  16. bs = []byte("this is test massage ")
  17. bs, _ = CBCEncrypt(bs, []byte(aesKey), []byte(aesIv), padding.PKCS5)
  18. CBCDecrypt(bs, []byte(aesKey), []byte(aesIv), padding.PKCS5)
  19. })
  20. }