|
@@ -40,6 +40,7 @@ func EncryptAES(key, data []byte) []byte {
|
|
// DecryptAES func
|
|
// DecryptAES func
|
|
func DecryptAES(key, ori []byte) []byte {
|
|
func DecryptAES(key, ori []byte) []byte {
|
|
ciphertext := make([]byte, len(ori))
|
|
ciphertext := make([]byte, len(ori))
|
|
|
|
+ copy(ciphertext, ori)
|
|
block, err := aes.NewCipher(key)
|
|
block, err := aes.NewCipher(key)
|
|
if err != nil {
|
|
if err != nil {
|
|
panic(fmt.Errorf("Error creating new block cipher\n%v\n", err))
|
|
panic(fmt.Errorf("Error creating new block cipher\n%v\n", err))
|