golangrc4结果不正确.packagemainimport( "crypto/rc4" "fmt")funcmain(){ rc,err:=rc4.NewCipher([]byte("5813aecc-0d05-497e-aafa-3111610cf44c")) iferr!=nil{ panic(err) } src:=[]byte("helloworld") fmt.Println(src) rc.XORKeyStream(src,src) fmt.Println(src) rc.XORKeyStream(src,src) fmt.Println(src)}输出:[10410110810811132119111114108100][2163614356205016920731252154][03270107105652362824624821]
2 回答
qq_遁去的一_1
TA贡献1725条经验 获得超7个赞
每次XORKeyStream之前都要执行一下rc4.NewCipher([]byte("5813aecc-0d05-497e-aafa-3111610cf44c"))
添加回答
举报
0/150
提交
取消