我有一个输入字节数组:


60614e680e705d0fefcf7ac8102c4452

ecb0c85768f2f2dc52415c43a36712f0

31c9037dafd31f01ecb0c85768f2f2dc

7b00be7e5a15fee1e78c63c58c2c6861

fef9a1c4130a354c846448512e6a97ce

4a9005690d1e3808f065c957538e1bac

87e7228322ab39a6900146786840dc0b

c536ad6afb6e4e3267fb045dd9c7e670

f1c2d2ac1fcc71ad06b7b194de4031f4

046744610aafa7b92fd3f392c3a5eeb1

474ffa60c0587e68ecb0c85768f2f2dc

2a88827461b41c99b2539b6bfdcd4325

be3ced59be7b594addb3366e076f6e47

0cc41df1eb3a8d93c99eb7bdad5a474c

33659653762910d0ecb0c85768f2f2dc

ecb0c85768f2f2dc82e715e7952a79c4

660074ccc50741cab5eabb873ae706b4

c8b008128df0af80fece91741fc5f641

1145aab35ac9f6e0f8a937baed012d00

c3be705a5e8c3440ddc1cd4e0051cccc

它们被加密的算法 XTEA ECB。我尝试使用该库进行解密“golang.org/x/crypto/xtea”。


package main


import (

    "golang.org/x/crypto/xtea"

    "fmt"

)



func main() {

    // encripte data

    test :=[]byte{

            0x60, 0x61, 0x4e, 0x68, 0x0e, 0x70, 0x5d, 0x0f, 0xef, 0xcf, 0x7a, 0xc8, 0x10, 0x2c, 0x44, 0x52,

            0xec, 0xb0, 0xc8, 0x57, 0x68, 0xf2, 0xf2, 0xdc, 0x52, 0x41, 0x5c, 0x43, 0xa3, 0x67, 0x12, 0xf0,

            0x31, 0xc9, 0x03, 0x7d, 0xaf, 0xd3, 0x1f, 0x01, 0xec, 0xb0, 0xc8, 0x57, 0x68, 0xf2, 0xf2, 0xdc,

            0x7b, 0x00, 0xbe, 0x7e, 0x5a, 0x15, 0xfe, 0xe1, 0xe7, 0x8c, 0x63, 0xc5, 0x8c, 0x2c, 0x68, 0x61,

            0xfe, 0xf9, 0xa1, 0xc4, 0x13, 0x0a, 0x35, 0x4c, 0x84, 0x64, 0x48, 0x51, 0x2e, 0x6a, 0x97, 0xce,

            0x4a, 0x90, 0x05, 0x69, 0x0d, 0x1e, 0x38, 0x08, 0xf0, 0x65, 0xc9, 0x57, 0x53, 0x8e, 0x1b, 0xac,

            }

    // key

    key := []byte("yuyuyuyuopopopop")

    c, _ := xtea.NewCipher(key)

    myout := make([]byte, len(test))

    // decrypte

    c.Decrypt(myout, test)


    fmt.Println(myout)

}

我的结果与应有的结果不一致。也许我没有正确使用图书馆?还是数据类型有问题?我是golang的新手。