1. 首页 > 端游评测 >

变异upx解密(upx变异加密)

关于变异upx解密,upx变异加密这个很多人还不知道,今天源源来为大家解答以上的问题,现在让我们一起来看看吧!

1、packagemainimport("crypto/rand""crypto/rsa""crypto/x509""encoding/base64""encoding/pem""errors""flag""fmt")vardecryptedstringfuncinit(){flag.StringVar(&decrypted,"d","","加密过的数据")flag.Parse()}funcmain(){vardata[]bytevarerrerrorifdecrypted!=""{data,err=base64.StdEncoding.DecodeString(decrypted)iferr!=nil{panic(err)}}else{data,err=RsaEncrypt([]byte(""))iferr!=nil{panic(err)}fmt.Println("rsaencryptbase64:"+base64.StdEncoding.EncodeToString(data))}origData,err:=RsaDecrypt(data)iferr!=nil{panic(err)}fmt.Println(string(origData))}//公钥和私钥可以从文件中读取varprivateKey=[]byte(`-----BEGINRSAPRIVATEKEY-----MIICXQIBAAKBgQDZsfv1qscqYdy4vY+P4e3cAtmvppXQcRvrF1cB4drkv0haU24Y7m5qYtT52Kr539RdbKKdLAM6s20lWy7+5C0DgacdwYWd/7PeCELyEipZJL07Vro7Ate8Bfjya+wltGK9+XNUIHiumUKULW4KDx21+1NLAUeJ6PeW+DAkmJWF6QIDAQABAoGBAJlNxenTQj6OfCl9FMR2jlMJjtMrtQT9InQEE7m3m7bLHeC+MCJOhmNVBjaMZpthDORdxIZ6oCuOf6Z2+Dl35lntGFh5J7S34UP2BWzF1IyyQfySCNexGNHKT1G1XKQtHmtc2gWWthEg+S6ciIyw2IGrrP2Rke81vYHExPrexf0hAkEA9Izb0MiYsMCB/jemLJB0Lb3Y/B8xjGjQFFBQT7bmwBVjvZWZVpnMnXi9sWGdgUpxsCuAIROXjZ40IRZ2C9EouwJBAOPjPvV8Sgw4vaseOqlJvSq/C/pIFx6RVznDGlc8bRg7SgTPpjHG4G+M3mVgpCX1a/EU1mB+fhiJ2LAZ/pTtY6sCQGaW9NwIWu3DRIVGCSMm0mYh/3X9DAcwLSJoctiODQ1Fq9rreDE5QfpJnaJdJfsIJNtX1F+L3YceeBXtW0Ynz2MCQBI89KP274Is5FkWkUFNKnuKUK4WKOuEXEO+LpR+vIhs7k6WQ8nGDd4/mujoJBr5mkrwDPwqA3N5TMNDQVGv8gMC CaKGJgWYgvo3/milFfImbp+m7/Y3vCptarldXrYQWOAQjxwc71ZGBFDITYvdgJM1MTqc8xQek1FXn1vfpy2c6O-----ENDRSAPRIVATEKEY-----`)varpublicKey=[]byte(`-----BEGINPUBLICKEY-----MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDZsfv1qscqYdy4vY+P4e3cAtmvppXQcRvrF1cB4drkv0haU24Y7m5qYtT52Kr539RdbKKdLAM6s20lWy7+5C0DgacdwYWd/7PeCELyEipZJL07Vro7Ate8Bfjya+wltGK9+XNUIHiumUKULW4KDx21+1NLAUeJ6PeW+DAkmJWF6QIDAQAB-----ENDPUBLICKEY-----`)//加密funcRsaEncrypt(origData[]byte)([]byte,error){block,_:=pem.Decode(publicKey)ifblock==nil{returnnil,errors.New("publickeyerror")}pubIntece,err:=x509.ParsePKIXPublicKey(block.Bytes)iferr!=nil{returnnil,err}pub:=pubIntece.(rsa.PublicKey)returnrsa.EncryptPKCS1v15(rand.Reader,pub,origData)}//解密funcRsaDecrypt(ciphertext[]byte)([]byte,error){block,_:=pem.Decode(privateKey)ifblock==nil{returnnil,errors.New("privatekeyerror!")}priv,err:=x509.ParsePKCS1PrivateKey(block.Bytes)iferr!=nil{returnnil,err}returnrsa.DecryptPKCS1v15(rand.Reader,priv,ciphertext)}。

本文到这结束,希望上面文章对大家有所帮助。

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 836084111@qq.com 举报,一经查实,本站将立刻删除。

联系我们

工作日:9:30-18:30,节假日休息