The invention discloses a digital key protection method based on Android system, which receives resource files, generates encrypted plaintext keys and encrypts resource files; double encrypts encrypted plaintext keys based on AES symmetric encryption algorithm; and double encrypts encrypted plaintext keys according to RSA asymmetric encryption algorithm to obtain ciphertext. The invention also discloses a digital key protection system based on Android system, including file encryption module, AES encryption module and RSA encryption module. The invention adopts AES symmetric encryption to encrypt and decrypt resource files; then uses RSA asymmetric encryption to encrypt and decrypt encrypted plaintext keys; solves the problem of unsecured key static storage in Android system, solves the problem that keys are easy to be intercepted by packets in Android system, and also solves the problem that DEX files in Android system are easy to be reversed into Java codes and keys. The security of key, user information and resource files are improved.
【技术实现步骤摘要】
基于Android系统的数字密钥保护方法及其系统
本专利技术涉及数字密钥
,具体涉及一种基于Android系统的数字密钥保护方法及其系统。
技术介绍
密钥对于用户数据的保护起了非常重要的作用,所以对于密钥的保护也是首要任务。在传统的密钥保护方式分为以下几种:1、通过SharedPreferences保存静态秘钥:这种密钥的保存方式及其不安全,通过反编译android产品后,就能直接从android产品中获取明文存储的密钥。2、服务器保存密钥方式:将密钥存储在服务器,虽然安全性得到的一定的提升,但是也很容易被抓包截取。3、通过Java硬编码的方式保存:将密钥分成不同的几段,有的存储在文件中、有的存储在代码中,最后将他们拼接起来,可以将整个操作写的很复杂,这因为还是在java层,逆向者只要花点时间,也很容易被逆向。
技术实现思路
基于此,针对上述问题,有必要提出一种可解决在android系统中密钥静态保存不安全、密钥容易被抓包截取,以及dex文件很容易被逆向成java代码,密钥被直接获取等问题的基于Android系统的数字密钥保护方法及其系统,提高了密钥的安全性、用 ...
【技术保护点】
1.一种基于Android系统的数字密钥保护方法,其特征在于,包括以下步骤:a、接收资源文件,生成加密明文key对资源文件进行加密;b、基于AES对称加密算法,对加密明文key进行一重加密;c、根据RSA非对称加密算法,对加密明文key进行二重加密,得到密文。
【技术特征摘要】
1.一种基于Android系统的数字密钥保护方法,其特征在于,包括以下步骤:a、接收资源文件,生成加密明文key对资源文件进行加密;b、基于AES对称加密算法,对加密明文key进行一重加密;c、根据RSA非对称加密算法,对加密明文key进行二重加密,得到密文。2.根据权利要求1所述的基于Android系统的数字密钥保护方法,其特征在于,所述步骤c包括以下步骤:b101、获取加密明文key后,调取RSA公钥,对该加密明文key进行二重加密,获得密文;b102、将用于解密的RSA公钥存储至服务器中;b103、将RSA私钥写入c文件,并编译c文件,生成对应的so库,对RSA私钥进行封装。3.根据权利要求2所述的基于Android系统的数字密钥保护方法,其特征在于,还包括以下步骤:当加密完成后,若接收到解密指令,则调用so库接口,获取RSA私钥;若RSA私钥与存储于服务器中的RSA公钥匹配,则解密成功,获取加密明文key。4.根据权利要求3所述的基于Android系统的数字密钥保护方法,其特征在于,还包括以下步骤:根据解密所获取的加密明文key解密资源文件,获得解密后的资源文件。5.一种基于Android系统的数字密钥保护系统,其特征在于,包括文件加密模块、AES加密模块和RSA加密模块,其...
【专利技术属性】
技术研发人员:刘汉操,彭付林,赵海涛,
申请(专利权)人:中新金桥数字科技北京有限公司,
类型:发明
国别省市:北京,11
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。