The present invention discloses a kind of encryption method Hybrid front-end code based on the characteristics of APP itself, which comprises the following steps: Step 1, Hybrid APP DEX to calculate the MD5 value of the file, and save it; step 2, the front-end JS code file encryption, encryption key for step 1 from step 3, the MD5 value; step 2 the MD5 value was divided into two segments, denoted a and key B key; step 4, the key segment of a dispersion insert JS code encryption ciphertext; step 5, the corresponding Java function key B and call the JS page; step 6, the first in accordance with the rules from the ciphertext decryption in Section A and then to extract the key from the Java code to extract the key segment of B and both the stitching, get the decryption key. The invention guarantees the uniqueness of the key, makes the JS page unavailable, not available and can not be cracked in the case of APP environment, and ensures the security of the front end code.
【技术实现步骤摘要】
基于HybridAPP自身特征的前端代码加密方法
本专利技术涉及一种代码加密方法,具体涉及一种基于HybridAPP自身特征的前端代码加密方法,属于移动终端应用安全
技术介绍
HybridAPP是指混合开发应用程序,主要以JS+Native两者相互调用为主,从开发层面实现“一次开发,多处运行”的机制,成为真正适合跨平台开发的应用。HybridAPP兼具了NativeAPP良好用户体验的优势,也兼具了WebAPP使用HTML5跨平台开发低成本的优势。据统计目前有超过50%的移动应用是使用的混合开发技术。随着移动互联网的发展,移动应用安全已成为开发者/发布者/使用者共同关注的热点问题。目前市场上针对nativeAPP一般是采用加壳的方式进行应用加固,但该类加壳只局限于dex文件。js代码是作为资源文件存在于APP包中,其相较于本地代码更容易获得,于是针对HybridAPP中js代码的保护成了开发者研究的重点。JavaScript是一种解释性脚本语言,执行前代码不进行预编译。所以该类代码文件不能像java文件那样在内存中进行加解密。目前js代码的加密方式有编码 ...
【技术保护点】
基于Hybrid APP自身特征的前端代码加密方法,其特征在于包括如下步骤:步骤1,计算Hybrid APP的dex文件的MD5值,并保存;步骤2,对前端js代码文件进行加密,加密密钥为步骤1所得的MD5值;步骤3,将步骤2所得MD5值分做两段,记做密钥段a和密钥段b;步骤4,将密钥段a分散插入js代码的加密密文中;步骤5,将密钥段b保存在调用js页面的对应java函数中;步骤6,解密时首先按照规律从密文中提取密钥段a然后从java代码中提取密钥段b并将两者进行拼接,得到解密密钥。
【技术特征摘要】
1.基于HybridAPP自身特征的前端代码加密方法,其特征在于包括如下步骤:步骤1,计算HybridAPP的dex文件的MD5值,并保存;步骤2,对前端js代码文件进行加密,加密密钥为步骤1所得的MD5值;步骤3,将步骤2所得MD5值分做两段,记做密钥段a和密钥段b;步骤4,将密钥段a分散插入js代码的加密密文中;步骤5,将密钥段b保存在调用js页面的对应java函数中;步骤6,解密时首先按照规律从密文中提取密钥段a然后从java代码中提取密钥段b并将两者进行拼接,得到解密密钥。2.根据权利要求1所述基于HybridAPP自身特征的前端代码加密方法,其特征在于:步骤2中,采用任意对称加密算法对前端js代码文件进行加密。3.根据...
【专利技术属性】
技术研发人员:翟栋,邓密密,
申请(专利权)人:四川长虹电器股份有限公司,
类型:发明
国别省市:四川,51
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。