通过查找资料找到如下工具:
https://github.com/spacemonkeygo/openssl
附代码:
func decodeDesEDE3(original string, key []byte) string {
iv := []byte(nil)
cipher, err := GetCipherByNid(NID_des_ede3)
if err != nil {
fmt.Println("Could not get cipher: ", err)
}
origianle_base64, err := base64.StdEncoding.DecodeString(original)
dCtx, err := NewDecryptionCipherCtx(cipher, nil, key, iv)
if err != nil {
fmt.Println("Could not create decryption context: ", err)
}
// 1、
plainbytes, err := dCtx.DecryptUpdate(origianle_base64)
if err != nil {
fmt.Println("DecryptUpdate(ciphertext) failure: ", err)
}
plainOutput := string(plainbytes)
// 2、
plainbytes, err = dCtx.DecryptFinal()
if err != nil {
fmt.Println("DecryptFinal() failure: ", err)
}
plainOutput += string(plainbytes)
return plainOutput
}