Coder Social home page Coder Social logo

android-hmac-sha1's Introduction

Android-hmac-sha1接口签名加密工具

##简介 本工具用于android调用后台接口时对接口进行签名加密,算法使用各大开放平台常用的hmac-sha1。接口签名能有效的防止请求参数被篡改,提高App数据的安全性。 ##编译

  1. 本工具使用Android studio编译,NDK版本为android-ndk-r10d。
  2. 可以修改com_wuhaowen_encrypt_SignatureEncryptor中secureKey值,将secureKey打入so文件中,提高安全性。

##用法 new SignatureEncryptor类,调用encrypt方法返回签名结果。

  1. public final String encrypt(Map<String, String> param, String key)

参数param为访问后台接口使用的参数Map,key为用于签名的secureKey

  1. public final String encrypt(Map<String, String> param)

参数param为访问后台接口使用的参数Map,secureKey硬编码进so文件

##hmac_sha1和base64加密C源码来源于网络,我只是把他们结合起来简单封装,感谢上诉源码作者!

android-hmac-sha1's People

Contributors

wuhaowen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

android-hmac-sha1's Issues

安全问题

有一个安全问题想跟您咨询一下,按照您现在的做法,将key放进so或dll中,保证key的安全性,但so或dll一样暴露了encrypt方法,攻击者直接调用so的方法,不是一样可以得到加密后的字符串吗?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.