Android-加密总结+支付集成问题

本文详细介绍了Android应用中加密算法的应用,包括数字签名、对称加密与非对称RSA,以及消息摘要算法。同时,文章讲解了银联、支付宝和微信支付的集成过程,包括支付步骤、SDK集成、异步通知等关键环节。此外,还提到了混合开发中Android与H5的三种通信方式。
摘要由CSDN通过智能技术生成

> 加密算法总结


> 银联支付


> 支付宝:要求需要公司账号


> 微信支付:微信更新测试服务器,Demo,丢失聊天记录(安全码策略:keystore)


> 扩展:混合开发(android+H5,通信三种方式)


* 1.js主动调用android
* 2.android主动调用js
* 3.js callback回调式调用android


### 01.数字签名应用实战-签名


> 对登录信息(用户名、密码、时间戳 签名)


InputStream ins = null;
String usrename = "heima104";
String password = "123456";
System.out.println(System.currentTimeMillis());
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("username="+usrename)
.append("&password="+MD5Utils.md5(password))
.append("&timestamp="+System.currentTimeMillis());

String input = stringBuilder.toString();

String sign = SignatureUtils.sign(input);

try {
String url = "http://120.77.241.119/EncryptServer/login_v5?"+input+"&sign="+sign;
URL url2 = new URL(url);
HttpURLConnection conn = (HttpURLConnection) url2.openConnection();
System.out.println(url2.toURI().toString());
ins = conn.getInputStream();
String result = IoUtils.convertStreamToString(ins);
System.out.println(result);
} catch (Exception e) {
e.printStackTrace();
} finally {
IoUtils.close(ins);
}


### 02.数字签名应用实战-避免抓包


> 对提交参数md5:如果用户没有登录过,存储到数据库;如果登录过不让登录,该url已经失效


String url = "http://120.77.241.119/EncryptServer/login_v6?"+input+"&sign="+sign;
URL url2 = new URL(url);
String md5 = MD5Utils.md5(input+"&sign="+sign);
System.out.println(md5);
HttpURLConnection conn = (HttpURLConnection) url2.openConnection();
System.out.println(url2.toURI().toString());
ins = conn.getInputStream();
String result = IoUtils.convertStreamToString(ins);


> 手机验证码


### 03.加密算法总结


> 对称加密(DES、AES):

* 1.优先使用DES,如果提高安全度使用AES
* 2.可逆:开发中只要可逆都可以选择对称加密,缓存联系人信息

> 非对称RSA


* 1.可逆:公钥加密私钥解密;私钥加密公钥解密
* 2.秘钥对:公钥和私钥,不能手动指定,必须由系统生成
* 3.加密速度慢:不能加密大文件
* 4.分段加密:每次最大加密长度117字节
* 5.分段解密:每次最大解密长度128字节
* 应用场景:一般很少使用RSA加密和解密,用的最多的是它的数字签名


> 消息摘要:


* md5:16个字节,转成16进制32个字节
* sha1:20个字节,转成16进制40个字节
* sha256:32个字节,转成16进制64个字节
* 应用:md5使用最多
Microsoft 为 Mac 提供了测试版远程客户端,您可转到 Microsoft Remote Desktop for Mac 进行下载。该测试版本客户端由微软官方维护,我们推荐您优先使用该版本客户端(微软已于 2017 年取消其官网提供的下载链接,转而通过其子公司 HockeyApp 的页面进行 Beta 版本的发布)。 地址:https://rink.hockeyapp.net/apps/5e0c144289a51fca2d3bfa39ce7f2b06/ Version 10.2.2 (1285) 更新于05 OCT 2018, 14:35 What's new in this update: Thanks for all the feedback! We have some exciting features and fixes in this release. A brand new Connection Center that supports drag and drop, manual arrangement of items, resizable columns in list view, column-based sorting, and easier group management. Settings import from the version 8 client has been improved (App Store client only). RDP files pointing to RemoteApp endpoints can now be imported into the Connection Center. The Connection Center now remembers the last active pivot (Desktops or Feeds) when closing the app. Retina display optimizations for Remote Desktop scenarios. Support for specifying the graphics interpolation level when not using Retina optimizations. 256-color support to enable connectivity to Windows 2000. Fixed clipping of the right and bottom edges of the screen when connecting to Windows 7/Windows Server 2008 R2 and earlier. Copying a local file into Outlook (running in a remote session) now adds the file as an attachment. Fixed an issue that was slowing down pasteboard-based file transfers if the files originated from a local network share. Addressed a bug that was causing to Excel (running in a remote session) to hang when saving data to a file on a redirected folder. Fixed an issue that was causing no free space to be reported for redirected folders. Added support for enforcing Remote Desktop Gateway device redirection policies. Remote Desktop Gateway feedback is now part of the connecting status UI. Fixed an issue that prevented session windows from closing when disconnecting. If NLA is not enforced by the server, you will now be routed to the login screen if your password has expired. The credential prompting UI and flows have been overhauled. Fixed performance issues that surfaced when lots of data was being transferred over the network. Smart card redirection fixes. Support for all possible values of the "EnableCredSspSupport" and "Authentication Level" RDP file settings if the ClientSettings.EnforceCredSSPSupport user default is set to 0. Support for the "Prompt for Credentials on Client" RDP file setting when NLA is not negotiated. Support for smart card-based login via smart card redirection at the Winlogon prompt when NLA is not negotiated. Fixed a bug that caused thumbnails to consume too much disk storage on macOS 10.14. Please keep the feedback coming. We listen to it all. If you encounter any errors, you can always contact us via Help > Report an Issue. If this does not work, you can mail us at rdios@microsoft.com. Get the app in the store Go to https://aka.ms/rdmac. If you would like to test drive new features and fixes continue using the app from this channel.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值