sign

微信APP支付

☆樱花仙子☆ 提交于 2019-12-22 01:34:49
微信APP支付: 一、涉及到的概念:https://www.cnblogs.com/whatlonelytear/p/9518077.html 1、微信开放平台: 主要面对移动应用/网站应用开发者,为其提供微信登录、分享、支付等相关权限和服务。 微信开放平台还提供了数据统计功能,用于开发者统计接入应用的登录、分享等数据情况。 接入步骤 已京东APP举例,比如京东APP需要使用微信登录、分享和微信支付功能,首先注册微信开发平台-开发者账号,并按照以下流程在微信开放平台创建京东APP: 审核通过后,即可获得以下的初级权限,如要获得更高如微信支付权限,需要再单独申请,具体微信支付权限申请步骤详见附件《移动应用-微信支付权限申请流程》 2、微信公众平台 用于管理、开放微信公众号(包括订阅号、服务号、企业号),简单的说就是微信公众号的后台运营、管理系统。 后台功能(以服务号介绍) (1) 基础运营功能:公众号申请成功后即可获得群发功能、自动回复、自定义菜单、投票管理; (2) 高级功能:微信公众平台还提供了以下高级的功能来丰富公众号,以下权限需要二次开发。 (3) 微信支付:提供公众号内微信支付能力,和移动应用一样也需要单独申请,流程和移动APP流程类似。 (4)管理:包括已关注用户管理、消息管理、素材管理 (5)推广:包括广告主(定向投放广告,精准推广自己的服务)和流量主(按月获取广告收入

Spring Boot: API接口设计之token、timestamp、sign及设计原理

▼魔方 西西 提交于 2019-12-21 16:54:54
一:token 简介-登录令牌验证身份 Token:访问令牌access token, 用于接口中, 用于标识接口调用者的身份、凭证,减少用户名和密码的传输次数。一般情况下客户端(接口调用方)需要先向服务器端申请一个接口调用的账号,服务器会给出一个appId和一个key, key用于参数签名使用,注意key保存到客户端,需要做一些安全处理,防止泄露。 Token的值一般是UUID,服务端生成Token后需要将token做为key,将一些和token关联的信息作为value保存到缓存服务器中(redis),当一个请求过来后,服务器就去缓存服务器中查询这个Token是否存在,存在则调用接口,不存在返回接口错误,一般通过拦截器或者过滤器来实现,Token分为两种: API Token(接口令牌): 用于访问不需要用户登录的接口,如登录、注册、一些基本数据的获取等。 获取接口令牌需要拿appId、timestamp和sign来换,sign=加密(timestamp+key) USER Token(用户令牌): 用于访问需要用户登录之后的接口,如:获取我的基本信息、保存、修改、删除等操作。获取用户令牌需要拿用户名和密码来换 关于Token的时效性:token可以是一次性的、也可以在一段时间范围内是有效的,具体使用哪种看业务需要。 一般情况下接口最好使用https协议,如果使用http协议

某住会app协议分析

自作多情 提交于 2019-12-21 10:15:08
华住会app协议分析 sign与data算法 抓包分析 反编译 寻找data、sign处理逻辑 libhzsign.so 还原算法 验证算法正确性 sign与data算法 经抓包分析得知,华住会app请求参数中有三个,分别是sign、data、time。time一眼可看出,就是当前时间,精确到秒。sign与data是经过一系列运算后 base64编码。 抓包分析 从图中可以看到,请求和响应均不是明文,响应报文从响应头中的content-type application/octet-stream 可以看到是字节流的形式,切换到十六进制模式。 反编译 这里我们用jeb打开,并导出源码,用idea打开 寻找data、sign处理逻辑 经过搜索和分析得知,计算data的代码在 public class NewGetString { static { System . loadLibrary ( "hzsign" ) ; } public static String a ( String arg2 , String arg3 ) { Class v0 = NewGetString . class ; __monitor_enter ( v0 ) ; try { arg2 = NewGetString . getNewStr ( arg2 , arg3 ) . replaceAll ( "\r

HTML5本地存储Localstorage

早过忘川 提交于 2019-12-21 04:53:07
什么是localstorage 前几天在老项目中发现有对cookie的操作觉得很奇怪,咨询下来是要缓存一些信息,以避免在URL上面传递参数,但没有考虑过cookie会带来什么问题: ① cookie大小限制在4k左右,不适合存业务数据 ② cookie每次随HTTP事务一起发送,浪费带宽 我们是做移动项目的,所以这里真实适合使用的技术是localstorage,localstorage可以说是对cookie的优化,使用它可以方便在客户端存储数据,并且不会随着HTTP传输,但也不是没有问题: ① localstorage大小限制在500万字符左右,各个浏览器不一致 ② localstorage在隐私模式下不可读取 ③ localstorage本质是在读写文件,数据多的话会比较卡(firefox会一次性将数据导入内存,想想就觉得吓人啊) ④ localstorage不能被爬虫爬取,不要用它完全取代URL传参 瑕不掩瑜,以上问题皆可避免,所以我们的关注点应该放在如何使用localstorage上,并且是如何正确使用。 localstorage的使用 基础知识 localstorage存储对象分为两种: ① sessionStrage: session即会话的意思,在这里的session是指用户浏览某个网站时,从进入网站到关闭网站这个时间段,session对象的有效期就只有这么长。 ②

WCF over HTTPS and Signing the body

▼魔方 西西 提交于 2019-12-21 02:48:00
问题 I've got a SOAP service I want to connect to. It needs to be accessed trough https and it needs to have it's body signed by a certificate. I've tried the following code: <basicHttpBinding> <binding name="P4Binding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding=

How to see what attributes are signed inside pkcs#7?

。_饼干妹妹 提交于 2019-12-20 16:21:35
问题 I have a pkcs#7 file, which contains signed data. It successfully verifies: $ openssl smime -verify -in data.p7s -CAfile root-certificate.pem Verification successful Signed data But when I extract the signed part, I do not see that it is actually the same as what was signed. I mean the following steps: $ openssl asn1parse -in data.p7s ... 35:d=4 hl=2 l= 9 prim: OBJECT :pkcs7-data 46:d=4 hl=2 l=inf cons: cont [ 0 ] 48:d=5 hl=2 l=inf cons: OCTET STRING 50:d=6 hl=2 l= 5 prim: OCTET STRING :(my

How to see what attributes are signed inside pkcs#7?

爷,独闯天下 提交于 2019-12-20 16:21:11
问题 I have a pkcs#7 file, which contains signed data. It successfully verifies: $ openssl smime -verify -in data.p7s -CAfile root-certificate.pem Verification successful Signed data But when I extract the signed part, I do not see that it is actually the same as what was signed. I mean the following steps: $ openssl asn1parse -in data.p7s ... 35:d=4 hl=2 l= 9 prim: OBJECT :pkcs7-data 46:d=4 hl=2 l=inf cons: cont [ 0 ] 48:d=5 hl=2 l=inf cons: OCTET STRING 50:d=6 hl=2 l= 5 prim: OCTET STRING :(my

What's the point of signing code, like jars?

老子叫甜甜 提交于 2019-12-20 11:21:15
问题 What is the point of signing your code like Java's jars when everyone can do it with jarsigner? How does it provide security? 回答1: The point of signing a JAR file is to verify that it has not been tampered with. Once a jar file is signed you can verify that this file hasn't been modified by someone else. This ensures that the file originates from the person that originally signed it. If someone has modified the file in-between the signature verification process will fail. You may check this

node+express 微信支付

隐身守侯 提交于 2019-12-20 02:35:04
本文不谈框架,不谈代码组织结构,只谈怎么实现, 1,微信移动端支付流程如下: 这个流程可以微信app支付文档找到,最重要的就是统一下单这个接口,可以简化一下这个接口,简化后的流程如下: app给后端传:金额total_fee,32位的商户订单号out_trade_no,支付成功后的回调地址notify_url 这最基本的3个参数,后端通过微信的统一下单接口https://api.mch.weixin.qq.com/pay/unifiedorder 生成一些参数,在返回给app端,app根据这些参数再加上微信授权,调起微信支付,支付成功后返回到商家app,微信后台自动检测是否支出成功,成功后调用app传给微信后端的回调地址notify_url接口,app后端在回调地址的接口中处理什么数据库改写操作,发消息等等的动作。 nodejs需要的一些包: nodejs需要的一些包: "dependencies": { "crypto": "^1.0.1", "express": "^4.16.3", "request": "^2.85.0", "xmlreader": "^0.2.3" } xmlreader处理xml的工具包,crypto数据加密包 2,工具类util.js var xmlreader = require("xmlreader"); var fs = require("fs"

支付宝支付模板

六月ゝ 毕业季﹏ 提交于 2019-12-19 21:15:12
Url from django.contrib import admin from django.urls import path from app01 import views urlpatterns = [ path('admin/', admin.site.urls), path('/update_order/', views.update_order), path('/pay_result/', views.pay_result), path('test/', views.TestView.as_view()), ] View from django.shortcuts import render, redirect, HttpResponse from rest_framework.views import APIView from django.views.decorators.csrf import csrf_exempt from rest_framework.response import Response import time from utils.pay import AliPay # Create your views here. def aliPay(): obj = AliPay( appid="2016101600700776", app