微信扫码登录

其他登录方式

绑定手机号

注册

我同意用户协议

忘记密码

用户协议

绑定手机号

近期有不法分子打着爱盈利的旗号,制作“爱盈利”名称的App,并伪造爱盈利证件,骗取用户信任,以抖音点赞赚钱或其他方式赚钱为名义,过程中以升级会员获得高佣金为名让用户充值。
爱盈利公司郑重声明:我司没有研发或运营过任何名为“爱盈利”的APP,我司做任务赚钱类产品从没有让任何普通用户充值升级会员。我公司产品均在本网站可查询,请将网站拉至底部,点击“关于我们”可查看爱盈利相关产品与服务。
温馨提示:当遇到此类问题请拨打官方电话或添加官方微信,以免财产损失。爱盈利官网地址:www.aiyingli.com。
  • 推广与合作
X

小程序丨对于wx.getShareInfo解密缺少C#版本的解密

来源: 5776

对于wx.getShareInfo得到的数据encryptedData和iv的解密缺少C#版本的解密,请管理员尽快的解决!!!

还有就是为啥自己写的如下的代码,执行会报错填充值无效,无法删除!!!!请大家给看看,这个如何解决???

RijndaelManaged rijndaelCipher = new RijndaelManaged();

//16进制数据转成byte类型

byte[] edata = Convert.FromBase64String(encryptedData);

rijndaelCipher.Key = Convert.FromBase64String(sessionKey);

rijndaelCipher.IV = Convert.FromBase64String(iv);

rijndaelCipher.Mode = CipherMode.CBC;

rijndaelCipher.BlockSize = 128;

rijndaelCipher.KeySize = 256;

rijndaelCipher.Padding=PaddingMode.PKCS7;

var transform= rijndaelCipher.CreateDecryptor();

byte[] plainText = transform.TransformFinalBlock(edata, 0, edata.Length);

string jieguo = Encoding.UTF8.GetString(plainText);


网友回复:

夜***:

      #region    微信分享好友,得到好友OpenId和Username

        [HttpGet]

        public HttpResponseMessage ShareInfoAES(string appId, string sessionKey, string encryptedData, string iv)

        {

            #region 解密部分

            RijndaelManaged rijndaelCipher = new RijndaelManaged();

            rijndaelCipher.Mode = CipherMode.CBC;

            rijndaelCipher.Padding = PaddingMode.PKCS7;

            rijndaelCipher.KeySize = 128;

            rijndaelCipher.BlockSize = 128;

            byte[] Data = Convert.FromBase64String(encryptedData);

            byte[] pwdBytes = Convert.FromBase64String(sessionKey);

            byte[] keyBytes = new byte[16];

            int len = pwdBytes.Length;

            if (len > keyBytes.Length) len = keyBytes.Length;

            System.Array.Copy(pwdBytes, keyBytes, len);

            rijndaelCipher.Key = keyBytes;

            rijndaelCipher.IV = Convert.FromBase64String(iv);

            ICryptoTransform transform = rijndaelCipher.CreateDecryptor();

            byte[] plainText = transform.TransformFinalBlock(Data, 0, Data.Length);

            string jiemi = Encoding.UTF8.GetString(plainText);

            #endregion

            AESModel aesModel = JsonConvert.DeserializeObject<AESModel>(jiemi);

            if (appId != aesModel.watermark.appid)

            {

                return ReturnHttpResponse("");

            }

            else

            {

                return ReturnHttpResponse(JsonConvert.SerializeObject(aesModel));

            }

        }

        #endregion

#region 序列化的类

 public class AESModel

    {   

        /// <summary>

        /// OPENID

        /// </summary>

        public string openId { get; set; }

        /// <summary>

        ///昵称

        /// </summary>

        public string nickName { get; set; }

        /// <summary>

        ///性别

        /// </summary>

        public string gender { get; set; }

        /// <summary>

        ///城市

        /// </summary>

        public string city { get; set; }

        /// <summary>

        ///省份

        /// </summary>

        public string province { get; set; } 

        /// <summary>

        ///地区

        /// </summary>

        public string country { get; set; }

        /// <summary>

        ///URL

        /// </summary>

        public string avatarUrl { get; set; }

        /// <summary>

        ///unionId

        /// </summary>

        public string unionId { get; set; }

        /// <summary>

        ///水印

        /// </summary>

        public Watermark watermark { get; set; }


        public class Watermark

        {

            public string appid { get; set; }

            public string timestamp { get; set; }

        }

    }

#endregion


爱盈利(aiyingli.com)移动互联网最具影响力的盈利指导网站。定位于服务移动互联网创业者,移动盈利指导。我们的目标是让盈利目标清晰可见!降低门槛,让缺乏经验、资金有限的个人和团队获得经验和机会,提高热情,激发产品。

评论

相关文章推荐

SELECT dw_posts.ID,dw_posts.post_title,dw_posts.post_content FROM dw_posts INNER JOIN dw_term_relationships ON (dw_posts.ID = dw_term_relationships.object_id) WHERE 1=1 AND(dw_term_relationships.term_taxonomy_id = 5246 ) AND dw_posts.post_type = 'post' AND (dw_posts.post_status = 'publish') GROUP BY dw_posts.ID ORDER BY RAND() LIMIT 0, 6

京ICP备15063977号-2 © 2012-2018 aiyingli.com. All Rights Reserved. 京公网安备 11010102003938号