The invention discloses a cryptographic device and a data encryption and decryption method thereof, belonging to the field of information security technology. The method includes: the main processor of the cryptographic device receives the cryptographic service instructions sent by the mobile terminal, and the cryptographic service instructions include the identification of the cryptographic algorithm. The cryptographic device is a hardware cryptographic device and installed in the mobile terminal; when the target code of the cryptographic algorithm is stored in the memory of the algorithm coprocessor of the cryptographic device, and the cryptographic algorithm identification of the target code of the cryptographic algorithm is not secret When the code service instruction includes the identification of the cryptographic algorithm, the target code of the cryptographic algorithm indicated by the cryptographic algorithm identification instruction is extracted from the external memory of the cryptographic device, and the target code of the extracted cryptographic algorithm is loaded into the memory, in which at least two sets of the target code of the cryptographic algorithm are stored; and the target of the control algorithm coprocessor through the cryptographic algorithm in the memory is controlled. The code decrypts the decrypted data or encrypts the encrypted data.
【技术实现步骤摘要】
一种密码装置及其数据加解密方法
本专利技术涉及信息安全
,特别涉及一种密码装置及其数据加解密方法。
技术介绍
在采用移动终端进行通信的过程中,用户个人身份信息、语音、图像、以及视频等数据存在泄露的风险。为提供通信安全保障,在移动终端中内置密码装置(也称加密装置)。密码装置是一种保密工具,用于通过密码算法实现数据加、解密的基本密码操作。常见的密码装置包括硬件密码装置。硬件密码装置采用特定硬件电路或专用密码芯片实现数据加解密。常规的硬件密码装置所提供的数据加解密方法流程包括,硬件密码装置接收加密指令或者解密指令,加密指令包括待加密数据,解密指令包括待解密数据;在加密指令的指示下通过内存中密码算法代码对待加密数据进行加密,或者,在解密指令的指示下通过内存中密码算法代码对待解密数据进行解密。其中,密码算法代码是硬件密码装置在接收加密指令和解密指令之前加载至内存的。在实现本专利技术的过程中,专利技术人发现现有技术至少存在以下问题:常规的硬件密码装置仅提供一种密码算法进行数据加解密,移动终端适用需要一种密码算法加解密的应用场景,而需要一种密码算法加解密的应用场景较少,这 ...
【技术保护点】
1.一种密码装置的数据加解密方法,其特征在于,所述方法包括:密码装置的主控处理器接收移动终端发送的密码服务指令,所述密码服务指令包括待加密数据和密码算法标识,或者,所述密码服务指令包括待解密数据和密码算法标识,所述密码装置为硬件密码装置且安装在所述移动终端中;当所述密码装置的算法协处理器的内存中存储有密码算法的目标代码、且所述密码算法的目标代码的密码算法标识不为所述密码服务指令包括的密码算法标识时,从所述密码装置的外存中提取所述密码服务指令包括的密码算法标识指示的密码算法的目标代码,并将提取的密码算法的目标代码加载至所述内存,所述外存中存储有至少两套密码算法的目标代码;控制 ...
【技术特征摘要】
1.一种密码装置的数据加解密方法,其特征在于,所述方法包括:密码装置的主控处理器接收移动终端发送的密码服务指令,所述密码服务指令包括待加密数据和密码算法标识,或者,所述密码服务指令包括待解密数据和密码算法标识,所述密码装置为硬件密码装置且安装在所述移动终端中;当所述密码装置的算法协处理器的内存中存储有密码算法的目标代码、且所述密码算法的目标代码的密码算法标识不为所述密码服务指令包括的密码算法标识时,从所述密码装置的外存中提取所述密码服务指令包括的密码算法标识指示的密码算法的目标代码,并将提取的密码算法的目标代码加载至所述内存,所述外存中存储有至少两套密码算法的目标代码;控制所述算法协处理器通过所述内存中的密码算法的目标代码对所述待解密数据进行解密或者对所述待加密数据进行加密。2.根据权利要求1所述的方法,其特征在于,所述方法还包括:当所述密码装置的算法协处理器的内存中未存储所述密码算法的目标代码时,从所述外存中提取所述密码服务指令包括的密码算法标识指示的密码算法的目标代码,并将提取的密码算法的目标代码加载至所述内存;控制所述算法协处理器通过所述内存中的密码算法的目标代码对所述待解密数据进行解密或者对所述待加密数据进行加密。3.根据权利要求1所述的方法,其特征在于,所述方法还包括:在所述密码装置的算法协处理器的内存中未存储所述密码算法的目标代码时,控制所述算法协处理器的内存中的代码存储空间不被非密码算法的目标代码占用,所述代码存储空间用于存储加载的密码算法的目标代码。4.根据权利要求3所述的方法,其特征在于,所述代码存储空间包括至少一个子空间,所述子空间用于存储密码算法的目标代码,所述子空间的数量小于或者等于所述外存中存储的密码算法的数量;所述将提取的密码算法的目标代码加载至所述内存,包括:从子空间标识与密码算法标识的对应关系中,确定提取的密码算法的目标代码对应的子空间标识;将所述提取的密码算法的目标代码加载至确定的子空间标识指示的子空间。5.根据权利要求2所述的方法,其特征在于,所述外存中存储的密码算法的目标代码是所述主控处理器通过密码算法的源代码生成的。6.一种密码装置,其特...
【专利技术属性】
技术研发人员:刘海峰,严新荣,付俊,程川,邓超,龚智,蔺祥楠,刘四超,金婵鸣,
申请(专利权)人:武汉船舶通信研究所中国船舶重工集团公司第七二二研究所,
类型:发明
国别省市:湖北,42
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。