AN ASYMMETRIC CRYPTOGRAPHY SECURE CHANNEL PROTOCOL FOR SMART CARDS
- 格式:pdf
- 大小:163.54 KB
- 文档页数:15
加密解密程序设计加密解密程序设计通常用于保护敏感信息的传输和存储,确保只有授权的用户才能访问和理解这些信息。
本文将讨论一个基本的加密解密程序设计,其中包含了常用的加密算法和解密算法,以及一些常见的加密解密技巧和策略。
一、加密算法设计1. 替换加密算法(Substitution Cipher):将原始消息中的字符替换为其他字符,通常使用一个固定的字母表和一个加密密钥。
例如,可以通过移位加密算法将字母A替换为字母D,将字母B替换为字母E,以此类推。
解密时,将密文中的字符替换回原始字符即可。
2. 移位加密算法(Caesar Cipher):也称为凯撒密码,是一种简单的替换密码。
将原始消息中的每个字母按照固定的位移量向后移动,例如,位移量为3时,字母A将被替换为字母D,字母B将被替换为字母E,以此类推。
解密时,将密文中的字母按照相同的位移量向前移动即可恢复原始消息。
3. 对称加密算法(Symmetric Cryptography):使用同一个密钥进行加密和解密,常用的对称加密算法包括DES、AES和RC4等。
加密时,将原始消息和密钥作为输入,通过特定的算法生成密文。
解密时,将密文和相同的密钥作为输入,通过逆算法恢复原始消息。
4. 非对称加密算法(Asymmetric Cryptography):使用两个不同的密钥进行加密和解密,分别为公钥和私钥。
常用的非对称加密算法包括RSA、DSA和ECC等。
加密时,将原始消息和公钥作为输入,通过特定的算法生成密文。
解密时,将密文和私钥作为输入,通过逆算法恢复原始消息。
5. 哈希函数(Hash Function):将任意长度的输入数据映射到固定长度的输出数据。
常用的哈希函数有MD5和SHA1等。
哈希函数通常用于生成消息的摘要,以验证消息的完整性和防止数据篡改。
二、加密解密程序设计示例以下是一个基本的加密解密程序设计示例,使用移位加密算法和对称加密算法进行加密和解密。
1.移位加密算法:```pythondef shift_cipher_encrypt(message, shift):encrypted_message = ""for character in message:if character.isalpha(:encrypted_character = chr((ord(character) - ord('A') + shift) % 26 + ord('A'))else:encrypted_character = characterencrypted_message += encrypted_characterreturn encrypted_messagedef shift_cipher_decrypt(encrypted_message, shift):decrypted_message = ""for character in encrypted_message:if character.isalpha(:decrypted_character = chr((ord(character) - ord('A') - shift) % 26 + ord('A'))else:decrypted_character = characterdecrypted_message += decrypted_characterreturn decrypted_message```2. 对称加密算法(使用Python的PyCrypto库进行AES加密):```pythonfrom Crypto.Cipher import AESdef symmetric_encrypt(message, key):cipher = AES.new(key, AES.MODE_ECB)encrypted_message = cipher.encrypt(message)return encrypted_messagedef symmetric_decrypt(encrypted_message, key):cipher = AES.new(key, AES.MODE_ECB)decrypted_message = cipher.decrypt(encrypted_message)return decrypted_message```三、加密解密技巧和策略1.密钥管理:确保只有授权的用户才能获得密钥。
遇到电子商务法问题?赢了网律师为你免费解惑!访问>>美国电子商务法美国是全球因特网的策源地之一,其研究、开发与应用计算机风格技术的历史已有30年之久。
90年代中期以来,美国大力推广以因特网为运行平台的电子商务这种新的交易形式,使之成为国民经济增长的重要支点。
为了促进和保障电子商务的全面发展,美国的大多数州都制定了电子商务法(注:本文所说的电子商务,主要是指以数据电讯(DATAMESSAGE,包括计算机网络和各种电讯方式)为交易手段而进行的商务活动。
而本文所谓的电子商务法,则是指以数据电讯(DATA MESSAGE)为交易手段而形成的以交易形式为内容的商事关系的规范体系。
它实质上解决的是电子合同的形式问题,诸如计算机网络通讯记录效力的确认、电子鉴别技术的选定、认证机构的确立等,均属此类。
),美国国会也正在就全国性的电子商务法案进行审议、辩论。
研究美国电子商务立法方面的经验与教训,无疑对我国在电子交易方面的立法、司法与理论研究工作,都会有一定的参考作用。
一、立法活动概况及特点(一)各州立法要览美国的电子商务法立法,是以各州的立法行动为先导的。
尤他州1995年颁布的《数字签名法》(Utah Digital Signature Act),〔1〕是美国、乃至全世界范围的第一部全面确立电子商务运行规范的法律文件。
截止1999年9月本文写作之时,美国已有44 个州制定了与电子商务有关的法律,〔2〕就是说美国除了有6个州在电子商务立法方面没有正式的法律文件出台外,其余各州都在电子商务立法方面有了实质性进展。
从数量上看,美国州一级关于电子商务的法律文件有近百部之多。
〔2〕有些州在主干电子商务法之外,还有些配套的法规。
譬如伊利诺斯州除了《电子商务安全法》(Illionis Electronic CommerceSecurety Act ),还有《金融机构数字签名法》(FinancialInstitutions Digital Signature Act ); 佛罗里达州在《电子签名法》(Electronic SignatureAct )之外,另有《数字签名与电子公证法》(Digital Signature & Electronic Notarization)。
标准咨询国产商用密码算法及其相关标准介绍谢宗晓(中国金融认证中心)董坤祥(山东财经大学管理科学与工程学院)甄杰(重庆工商大学管理科学与工程学院)1 概述《中华人民共和国密码法》第六条中规定:密码分为核心密码、普通密码和商用密码。
同时,在第七条和第八条中规定:核心密码、普通密码属于国家秘密,商用密码用于保护不属于国家秘密的信息。
因此,在常见应用中,商用密码得到了大面积的推广,以至于,在实践中,提到“国密”,经常就被默认为国产商用密码算法。
在现代密码系统中,密码算法、密码协议和密钥管理是三个不可或缺的部分,而在这三者之中,最为核心的毫无疑问就是密码算法。
虽然实践证明,绝大部分的安全漏洞都产生于实现和部署过程中,但是,算法的安全与否,直接决定了一个密码系统的基础是否安全。
例如,选用SHA-1、MD4、MD5、RC4和密钥长度小于2048位的RSA 等不安全的算法,不可能实现安全的密码系统。
已经发布的国产商用密码算法,按照类别可以分为:1)对称密码算法,主要包括ZUC 和SM4;2)非对称密码算法,主要包括SM2和SM9;3)密码杂凑算法,主要包括SM3。
2 对称密码算法对称密码(symmetric cryptography)是用相同的密钥(或方法)进行加密解密,这在逻辑上非常清晰,也最直观,有时候也被称之为共享密钥密码,对称密码算法的基本过程如图1所示。
1) 注意,RC4算法已经证明不安全。
图1 对称密码的工作过程已经发布国产商用密码算法中属于对称密码算法的有ZUC 和SM4。
ZUC(祖冲之密码算法)属于序列密码,也称为“流密码”,与之类似的国外密码算法如RC41)。
ZUC 对应的国家标准、行业标准,如表1所示。
SM4属于分组密码,也称为“块密码”,与之类似的国外密码算法如DES(数据加密标准),TDEA/3DES(三重数据加密标准)以及AES(高级加密标准)等。
SM4对应的国家标准、行业标准,如表2所示。
Part 1.Explanation of Terms, 30 pointsNOTE: Give the definitions or explanations of the following terms, 5 points for each.(1)Data IntegrityAssures that information and programs are changed only in a specified and authorized manner.In information security, integrity means that data cannot be modified undetectably.Integrity is violated when a message is actively modified in transit. Information security systems typically provide messageintegrity in addition to data confidentiality(2)Information Security AuditAn information security audit is an audit on the level of information security in an organization(3)PKIPKI provides well-conceived infrastructures to deliver security services in an efficient and unified style. PKI is a long-term solutionthat can be used to provide a large spectrum of security protection.(4)X.509In cryptography, X.509 is an ITU-T standard for a public key infrastructure (PKI) for single sign-on (SSO,单点登录)and Privilege Management Infrastructure (PMI,特权管理基础架构).The ITU-T recommendation X.509 defines a directory service that maintains a database of information about users for theprovision of authentication services…(5)Denial-of-Service AttackDoS (Denial of Service) is an attempt by attackers to make a computer resource unavailable to its intended users.(6)SOA(Service-Oriented Architecture)SOA is a flexible set of design principles used during the phases of systems development and integration in computing. A systembased on a SOA will package functionality as a suite of interoperable services that can be used within multiple, separate systemsfrom several business domains.(7)Access ControlAccess control is a system that enables an authority to control access to areas and resources in a given physical facility orcomputer - based information system. An access control system, within the field of physical security, is generally seen as the second layer in the security of a physical structure.(Access control refers to exerting control over who can interact with a resource. Often but not always, this involves an authority,who does the controlling. The resource can be a given building, group of buildings, or computer-based information system. But itcan also refer to a restroom stall where access is controlled by using a coin to open the door)(8)Salted ValueIn cryptography, a salt consists of random bits, creating one of the inputs to a one-way function. The other input is usually apassword or passphrase. The output of the one-way function can be stored (alongside the salt) rather than the password, and stillbe used for authenticating users. The one-way function typically uses a cryptographic hash function. A salt can also be combinedwith a password by a key derivation function such as PBKDF2 to- generate a key for use with a cipher or other cryptographicalgorithm. The benefit provided by using a salted password is making a lookup table assisted dictionary attack against the storedvalues impractical, provided the salt is large enough. That is, an attacker would not be able to create a precomputed lookup table(i.e. a rainbow table) of hashed values (password i salt), because it would require a large computation for each salt.(9)SOAPSOAP is a protocol specification for exchanging structured information in the implementation of Web Services in computernetworks. It relies on Extensible Markup Language (XML) for its message format, and usually relies on other Application Layerprotocols, most notably Hypertext Transfer Protocol (HTTP) and Simple Mail Transfer Protocol (SMTP), for message negotiationand transmission(10)ConfidentialityConfidentiality is the term used to prevent the disclosure of information to unauthorized individuals or systems. Confidentiality isnecessary (but not sufficient) for maintaining the privacy of the people whose personal information a system holds.(ll)AuthenticationIn computing, e-Business and information security is necessary to ensure that the data, transactions, communications ordocuments (electronic or physical) are genuine. It is also important for authenticity to validate that both parties involved are whothey claim they are.(12)KerberosKerberos is an authentication service developed at MIT which allows a distributed system to be able to authenticate requests forservice generated from workstations.Kerberos (ITU-T) is a computer network authentication protocol which works on the basis of “tickets” to allow nodescommunicating over a non-secure network to prove their identity to one another in a secure manner.(13)SSL/TLSSSL are cryptographic protocols that provide communication security over the Internet. TLS and its predecessor, SSL encrypt thesegments of network connections above the Transport Layer, using asymmetric cryptography for key exchange, symmetricencryption for privacy, and message authentication codes for message integrity.(14)Man-in-the-Middle AttackMan-in-the-Middle Attack is a form of active eavesdropping in which the attacker makes independent connections with the victimsand relays messages between them, making them believe that they are talking directly to each other over a private connection,when in fact the entire conversation is controlled by the attacker.(15)System VulnerabilityA vulnerability is a flaw or weakness in a system,s design, implementation, or operation and management that could be exploitedto violate the system,s security policy (which allows an attacker to reduce a system's information assurance). Vulnerability is theintersection of three elements: a system susceptibility or flaw, attacker access to the flaw, and attacker capability to exploit theflaw.(16)Non-RepudiationNon-repudiation refers to a state of affairs where the author of a statement will not be able to successfully challenge theauthorship of the statement or validity of an associated contract.The term is often seen in a legal setting wherein the authenticity of a signature is being challenged. In such an instance, theauthenticity is being "repudiated".(17)Bastion HostA bastion host is a computers on a network, specifically designed and configured to withstand attacks. It,s identified by the firewalladmin as a critical strong point in the network,s security. The firewalls (application - level or circuit - level gateways) and routers can be considered bastion hosts. Other types of bastion hosts include web, mail, DNS, and FTP servers.(18)CSRFCross-Site Request Forgery (CSRF) is an attack that forces an end user to execute unwanted actions on a web application in whichthey're currently authenticated. CSRF attacks specifically target state-changing requests, not theft of data, since the attacker hasno way to see the response to the forged request. With a little help of social engineering (such as sending a link via email or chat),an attacker may trick the users of a web application into executing actions of the attacker's choosing. If the victim is a normaluser, a successful CSRF attack can force the user to perform state changing requests like transferring funds, changing their emailaddress, and so forth. If the victim is an administrative account, CSRF can compromise the entire web application.Part 2.Brief Questions, 40 pointsNOTE: Answer the following HOW TO questions in brief, 8 points for each.(1)Asymmetric Cryptographic Method.非对称加密算法需要两个密钥:公开密钥(public - key)和私有密钥(private - key)。
SSH是英文Secure Shell的简写形式。
通过使用SSH,你可以把所有传输的数据进行加密,这样“中间人“这种攻击方式就不可能实现了,而且也能够防止DNS 欺骗和IP欺骗。
使用SSH,还有一个额外的好处就是传输的数据是经过压缩的,所以可以加快传输的速度。
SSH有很多功能,它既可以代替Telnet,又可以为FTP、Pop、甚至为PPP提供一个安全的“通道“。
最初的SSH是由芬兰的一家公司开发的。
但是因为受版权和加密算法的限制,现在很多人都转而使用OpenSSH。
OpenSSH是SSH的替代软件包,而且是免费的,可以预计将来会有越来越多的人使用它而不是SSH。
SSH是由客户端和服务端的软件组成的,有两个不兼容的版本分别是:和。
用SSH 的客户程序是不能连接到SSH 的服务程序上去的。
OpenSSH 同时支持SSH 和。
SSH协议的内容SSH协议是建立在应用层和传输层基础上的安全协议,它主要由以下三部分组成,共同实现SSH的安全保密机制。
传输层协议,它提供诸如认证、信任和完整性检验等安全措施,此外它还可以任意地提供数据压缩功能。
通常情况下,这些传输层协议都建立在面向连接的TCP 数据流之上。
用户认证协议层,用来实现服务器的跟客户端用户之间的身份认证,它运行在传输层协议之上。
连接协议层,分配多个加密通道至一些逻辑通道上,它运行在用户认证层协议之上。
当安全的传输层连接建立之后,客户端将发送一个服务请求。
当用户认证层连接建立之后将发送第二个服务请求。
这就允许新定义的协议可以和以前的协议共存。
连接协议提供可用作多种目的通道,为设置安全交互Shell会话和传输任意的TCP/IP端口和X11连接提供标准方法。
SSH的安全验证从客户端来看,SSH提供两种级别的安全验证。
第一种级别(基于口令的安全验证),只要你知道自己的帐号和口令,就可以登录到远程主机,并且所有传输的数据都会被加密。
但是,这种验证方式不能保证你正在连接的服务器就是你想连接的服务器。
skc维度证书类型
SKC 维度证书类型是指在 SKC(Symmetric Key Cryptography,对称密钥密码学)中使用的证书类型。
SKC 是一种加密算法,使用
相同的密钥进行加密和解密。
在 SKC 中,证书用于验证通信双方的
身份,并确保通信内容的机密性和完整性。
在 SKC 中,常见的证书类型包括以下几种:
1. 对称密钥证书(Symmetric Key Certificates),这种证书
包含了用于对称密钥交换的信息,用于验证通信双方的身份,并确
保密钥的安全性。
2. 数字证书(Digital Certificates),数字证书是一种使用
非对称密钥密码学(Asymmetric Key Cryptography)的证书类型。
它包含了公钥和与之关联的数字签名,用于验证证书的真实性和完
整性。
3. TLS/SSL 证书(Transport Layer Security/Secure
Sockets Layer Certificates),这种证书用于在网络通信中实现
安全的传输层连接。
它包含了服务器的公钥和与之关联的数字签名,
用于验证服务器的身份,并启用加密通信。
4. IPsec 证书(Internet Protocol Security Certificates),IPsec 证书用于在 IP 网络中实现安全的通信。
它包含了用于身份验证和加密的密钥材料,用于确保通信的机密性和完整性。
以上是一些常见的 SKC 维度证书类型,它们在不同的安全通信协议和场景中起着重要的作用。
具体使用哪种证书类型取决于具体的安全需求和实际应用情况。
最新资料,WORD文档,可编辑目录1基本概念 ................................................................ ................................................................. (3)1.1电子商务 ................................................................ ................................................................. .. (3)1.2证书 ................................................................ ................................................................. .. (3)1.3 CA................................................................ ................................................................. .. (3)1.4 RA................................................................ ................................................................. .. (3)1.5 C P................................................................ ................................................................. (4)1.6 R S................................................................ ................................................................. (4)1.7 CRL ................................................................ ................................................................. .. (4)1.8 OCSP ................................................................ ................................................................. (4)2 基本安全技术和算法............................................................... ................................................................. (4)2.1 加密 ................................................................ ................................................................. .. (4)2.2安全(de)单向散列函数(Secure Hash) ................................................................ .. (7)2.3几种常用(de)算法 ................................................................ ................................................................. . (8)3电子商务体系结构及功能模型 ................................................................ ................................................................. .. (9)3.1 电子商务体系层次结构............................................................... ................................................................. . (9)3.2 电子商务功能模型 ................................................................ ................................................................. (10)3.3 CA体系 ................................................................ ................................................................. .. (11)4公共密钥基础结构(PKI) ................................................................ ................................................................. (12)4.1 PKI简介 ................................................................ ................................................................. . (12)4.2 PKI体系结构及实体功能 ................................................................ ................................................................. (13)4.2.1 PAA ................................................................................................................................. .. (14)4.2.2 PCA................................................................ ................................................................. (14)4.2.3 CA ................................................................ ................................................................. .. (15)4.2.4 ORA ................................................................ ................................................................. .. (15)4.3 PKI体系结构(de)组织方式 ................................................................ ................................................................. (16)4.4 PKI(de)操作思想............................................................... ................................................................. . (16)4.4.3 证书(de)获取 ................................................................ ................................................................. . (18)4.4.9 CRL(de)获取 ................................................................ ................................................................. (20)4.5 PKI体系(de)互通性 ................................................................ ................................................................. . (21)4.6 PKIX系列协议简介 ................................................................ ................................................................. . (23)4.6.1 PKIX体系协议标准 ................................................................ .. (23)4.6.2 PKI(de)实体对象说明 ................................................................ . (24)4.6.3 PKI(de)功能 ................................................................ ................................................................. .. (25)5电子商务基本安全技术 ................................................................ ................................................................. . (27)5.1数字信封 ................................................................ ................................................................. (28)5.2数字签名 ................................................................................................................................. (28)5.3双重数字签名............................................................... ................................................................. .. (29)5.4身份认证技术............................................................... ................................................................. .. (30)5.5一个完整(de)数据加解密/身份认证流程 ................................................................ .. (33)1基本概念1.1电子商务广义地说,电子商务是指在计算机与通信网络基础上,利用电子工具实现商业交换和商业作业活动(de)全过程.一般电子商务是指利用TCP/IP公众网络和技术(中国公众多媒体通信网,含CHINANET)进行(de)在线交易和商业作业活动.涉及对象包括:金融机构、商家、生产企业、网络服务提供商、个人用户、政府部门和事业单位等.1.2证书在一个电子商务系统中,所有参与活动(de)实体都必须用证书来表明自己(d e)身份.证书一方面可以用来向系统中(de)其它实体证明自己(de)身份(每份证书都是经“相对权威(de)机构”签名(de)),另一方面由于每份证书都携带着证书持有者(de)公钥(签名证书携带(de)是签名公钥,密钥加密证书携带(de)是密钥加密公钥),所以,证书也可以向接收者证实某人或某个机构对公开密钥(de)拥有,同时也起着公钥分发(de)作用.1.3 CACA是Certificate Authority(de)缩写,是证书授权(de)意思.在电子商务系统中,所有实体(de)证书都是由证书授权中心既CA中心分发并签名(de).一个完整、安全(de)电子商务系统必须建立起一个完整、合理(de)CA体系. CA体系由证书审批部门和证书操作部门组成.1.4 RARA即证书发放审核部门,它是CA系统(de)一个功能组件.它负责对证书申请者进行资格审查,并决定是否同意给该申请者发放证书,并承担因审核错误引起(de)、为不满足资格(de)证书申请者发放证书所引起(de)一切后果,因此它应由能够承担这些责任(de)机构担任.1.5 CPCP即证书发放(de)操作部门,它是CA系统(de)一个功能组件,负责为已授权(de)申请者制作、发放和管理证书,并承担因操作运营错误所产生(de)一切后果,包括失密和为没有获得授权者发放证书等,它可以由审核授权部门自己担任,也可委托给第三方担任.1.6 RSRS即证书授理者,它是CA系统(de)一个功能组件,接收用户(de)证书申请请求,转发给CP和RA进行相应(de)处理.1.7 CRLCRL是证书作废表(de)缩写.CRL中记录尚未过期但已声明作废(de)用户证书序列号,供证书使用者在认证对方证书时查询使用.CRL通常被称为证书黑名单.1.8 OCSPOCSP即在线证书状态协议(Online Certificate Status Protocol),使用户可以实时查询证书(de)作废状态.2 基本安全技术和算法2.1 加密加密用来保护敏感信息(de)传输,保证信息(de)安全性.在一个加密系统中,信息使用加密密钥加密后,得到(de)密文传送给接收方,接收方使用解密密钥对密文解密得到原文.目前主要有两种加密体系:秘密密钥加密和公开密钥加密.秘密密钥加密也称为对称密钥加密,加密和解密使用同一个密钥.因此信息(de)发送方和接收方必须共享一个密钥.如图2.1所示.图2.1 对称密钥加密(Symmetric Cryptography )这种加密类型快速牢固,但能力却很有限,入侵者用一台运算能力足够强大(de)计算机依靠“野蛮力量”就能破译,也就是说尝试亿万次密码直到其被解开.对称密钥加密(de)另一不足是密钥本身必须单独进行交换以使接收者能解密数据,如果密钥没有以安全方式传送,它就很可能被劫获并用于信息解密.公开密钥加密也称为非对称密钥加密.公开密钥加密使用两个不同(de)密钥:一个用来加密信息,称为加密密钥;另一个用来解密信息,称为解密密钥.用户把加密密钥公开,因此加密密钥也称为公开密钥,简称公钥.解密密钥保密,因此解密密钥也称为私有密钥,简称私钥.这两个密钥是数学相关(de),用某用户(de)加密密钥加密后所得(de)数据只能用该用户(de)解密密钥才能解密.因而要求用户(de)私钥不能透露给自己不信任(de)任何人.RSA(由发明者Rivest,Shmir和Adleman而得名)是着名(de)公开密钥加密算法.如图2.2所示.图2.2 非对称密钥加密 (Asymmetric Cryptography)公钥加密与对称密钥加密相比,其优势在于不需要一把共享(de)通用密钥,用于解密(de)私钥不发往任何地方,这样,即使公钥被截获,因为没有与其匹配(de)私钥,所以截获(de)公钥对入侵者是没有任何用处(de).公钥加密(de)另一个用处是身份验证.如果某一方用私钥加密了一条信息,拥有公钥拷贝(de)任何人都能对其解密,接收者由此可以知道这条信息确实来自于拥有私钥(de)人一方.密钥(de)安全分发是保证实现有效加密(de)重要环节.密钥(de)分发包括秘密密钥(de)分发和公开密钥加密中公钥(de)分发.实现秘密密钥加密必须保证信息发送方与信息接收方之间通过安全通道分发秘密密钥.因此秘密密钥加密不适合用在公共网络上许多事先互不认识(d e)通信者之间(de)信息传送.适合于公共网络上事务处理业务中分发公钥(de)方法有:使用公钥数据库管理公钥;使用认证公钥(de)数字证书.使用公钥数据库管理公钥适合于参与通信(de)用户比较少(de)情况.每个用户必须建立一个公钥数据库储存与他通信(de)用户(de)公钥.该方式建立(de)数据库要满足以下条件:在该数据库中,每一个公钥唯一与一个用户对应;输入到数据库中(de)公钥必须被证实是对应用户(de)公钥,而该用户必须被数据库(de)使用者证实身份;该数据库(de)访问必须是安全(de).使用数字证书是一种更易安全分发公钥(de)方式.数字证书中基本包括证书持有人(de)个人信息、公钥以及证书签发者(de)对这些信息(de)数字签名和证书签发者(de)数字证书.因为数字证书是由第三方签发(de),所以确认数字证书持有人身份和从该证书获取证书持有人(de)公钥,需要信任数字证书(de)签发者.CA认证中心是签发数字证书(de)机构,有关CA(de)体系结构及证书(de)内容应遵循ITU--T建议X.509中(de)技术要求.密钥(de)安全是保证密钥有效(de)重要前提.秘密密钥与公开密钥加密方法中(de)私钥(de)密钥长度一般比较长,因此必须使用保密模块来保存这些密钥.用户使用这些密钥前必须被保密模块认证.保密模块可以是纯软件产品、纯硬件产品、软件和硬件结合产品等.2.2安全(de)单向散列函数(Secure Hash)单向散列函数用于对要传输(de)数据作运算生成信息摘要,它并不是一种加密机制,但却能产生信息(de)数字“指纹”,它(de)目(de)是为了确保数据没有被修改或变化,保证信息(de)完整性不被破坏.单向散列函数有三个主要特点:1、它能处理任意大小(de)信息,并将其按信息摘要(message digest)方法生成固定大小(de)数据块,对同一个源数据反复执行Hash函数将总是得到同样(de)结果.2、它是不可预见(de).产生(de)数据块(de)大小与原始信息(de)大小没有任何联系,同时源数据和产生(de)数据块(de)数据看起来也没有明显关系,源信息(de)一个微小变化都会对小数据块产生很大(de)影响.3、它是完全不可逆(de),没有办法通过生成(de)数据块直接恢复源数据.2.3几种常用(de)算法上面介绍了基本安全技术(de)原理,下面介绍几种常用(de)算法:RC2RC4DES,3DESIDEASDBI目前在NetWorld CA体系中使用(de)对称算法是IDEA,SDBIRSADSAECA目前在NetWorld CA体系中使用(de)非对称算法是RSAMD2MD5SHA1目前在NetWorld CA体系中使用(de)单向散列函数算法是SHA13电子商务体系结构及功能模型3.1 电子商务体系层次结构电子商务体系分为四个层次,其体系结构如下图所示.支付型电子商务业务基于CTEC支付体系(de)基于SET支付体系(de)电子商务业务电子商务业务非支付型电子商务业务CTEC支付体系T支付体系支付体系安全基础结构(包括CA安全认证体系和基本(de)安全技术)网络基础中国公众多媒体通信网(含CHINANET)/语音接入平台/… ...图2 电子商务体系结构电子商务网络基础包括中国公众多媒体通信网(含CHINANET)以及语音接入平台.电子商务(de)安全基础结构包括CA安全认证体系(包括SET CA体系和Net World CA体系)和基本(de)安全技术,它是整个电子商务体系(de)安全基础,提供电子商务所需要(de)各种安全技术(包括实现数据传输(de)安全性、完整性、身份认证和不可抵赖(de)各种技术).支付体系架构在安全基础结构之上,分为CTEC支付体系和SET支付体系.支付体系为支付型电子商务业务提供各种支付手段,包括基于SET标准(de)信用卡支付方式、以及符合CTEC标准(de)各种支付手段.正如前面业务分类中提到(de),电子商务业务包括支付型业务和非支付型业务,其中支付型业务架构在支付体系之上, 分别根据业务需求使用相应(de)支付体系;而非支付型业务则直接架构在安全基础结构之上,使用这一层提供(de)各种认证手段和安全技术提供安全(de)电子商务服务.3.2 电子商务功能模型电子商务功能模型包括(de)元素有:CA中心、支付网关、电子柜员机、客户端电子钱包.其功能模型如下图所示.3.3 CA体系电子商务(de)安全是通过使用加密手段来达到(de),非对称密钥加密技术(公开密钥加密技术)是电子商务系统中主要(de)加密技术,主要用于对称加密密钥(de)分发(数字信封)和数字签名以实现身份认证和信息(de)完整性检验、交易防抵赖等.CA体系为用户(de)公钥签发证书,以实现公钥(de)分发并证明其有效性.该证书证明了该用户拥有证书中列出(de)公开密钥.证书是一个经证书授权中心数字签名(de)包含公开密钥拥有者信息以及公开密钥(de)文件.CA机构(de)数字签名使得攻击者不能伪造和篡改证书.证书(de)格式遵循X.509标准.CA机构应包括两大部门:一是审核授权部门(简称RA,Registry Authorit y),它负责对证书申请者进行资格审查,并决定是否同意给该申请者发放证书,并承担因审核错误引起(de)、为不满足资格(de)证书申请者发放证书所引起(de)一切后果,因此它应由能够承担这些责任(de)机构担任;另一个是证书操作部门(简称CP,Certificate Processor),负责为已授权(de)申请者制作、发放和管理证书,并承担因操作运营错误所产生(de)一切后果,包括失密和为没有获得授权者发放证书等,它可以由审核授权部门自己担任,也可委托给第三方担任.NetWorld CA安全认证系统建立在中国公众多媒体通信网(含CHINANET)上,通过该网络向终端用户、支付网关和业务应用系统提供证书和授权服务. 4公共密钥基础结构(PKI)4.1 PKI简介为了提高Internet(de)安全性,越来越多(de)安全协议得到应用,目前国际上流行(de)电子商务所采用(de)协议主要包括:基于信用卡交易(de)安全电子交易协议(Secure Electronic Transaction,即SET协议)、用于接入控制(de)SSL协议(Secure Socket Layer安全套接字层)、安全HTTP(S-HTTP)协议、安全电子邮件协议(如PEM、S/MIME等)、用于公对公交易(de)Int ernet EDI等.此外,也可以在Internet网上建设虚拟专网VPN,利用VPN为企业、政府提供一些基本(de)安全服务如企业、政府间(de)公文、报表传送、电子报税业务等.这些协议都建立在公钥加密技术(de)基础上.它们分别工作在不同(de)层次上,实现了不同(de)PKI系统,在Internet网上提供安全(de)电子商务服务. PKI(Public Key Infrastructure),即公钥基础结构,利用公钥加密技术为网上电子商务(de)开展提供了一套安全基础平台,用户利用PKI平台提供(de)安全服务进行安全通信.使用基于公钥技术系统(de)用户建立安全通信信任机制(de)基础是:网上进行(de)任何需要安全服务(de)通信都建立在公钥(de)基础之上,而与公钥相对(de)私钥只掌握在他们与之通信(de)另一方.这个信任基础通过公钥证书(de)使用来实现.公钥证书即是一个用户(de)公钥和他(de)身份(de)绑定,在绑定之前由一个可以信任(de)CA来证实用户(de)身份,然后这个可信任C A对证明该绑定(de)证书进行数字签名.PKI指在公钥加密技术(de)基础上实现证书(de)产生, 管理, 存储, 发放以及作废而必须(de)全部硬件, 软件, 人力资源, 相关政策和操作程序以及为PKI体系中(de)成员提供(de)安全服务(de)全部.简单地说,PKI(de)功能是绑定证书持有者(de)身份和相关(de)密钥对(通过为公钥及相关(de)用户身份信息签发数字证书),为用户提供方便(de)直接或间接获取证书(de)途径,对证书发放环境(de)方便(de)访问途径,证书作废(de)直接或间接宣告途径,并进而利用数字证书及相关(de)各种服务(证书发布,黑名单发布,时戳服务等)实现通信中各实体(de)身份认证,完整性,不可否认性和保密性.4.2 PKI体系结构及实体功能随着信息和电信技术(de)飞速发展,电子信息和电子商务(de)应用越来越广,为网上电子事务提供安全服务(de)PKI系统也得到了广泛关注.在PKI体系基础上建立(de)安全证书体系得到了从普通用户,商家到政府各职能部门(d e)普遍关注. 美国, 加拿大等政府机构都提出了建立国家PKI体系(de)具体实施方案.PKI系统(de)建立应该着眼于用户使用证书及相关服务(de)便利性,用户身份(de)可靠认证,制定完善(de)证书管理政策,建立高可信度(de)CA中心,用户属性(de)管理,用户身份隐私保护,证书作废列表(de)管理,CA中心为用户提供(de)证书及CRL有关服务(de)管理,安全和相应(de)法规确立,责任(de)划分和完善(de)责任政策(de)建立.一个典型(de)PKI体系结构如下:4.2.1 PAA政策批准机构,创建整个PKI系统(de)方针,批准本PAA下属PCA(de)政策,为下属PCA签发公钥证书,建立整个PKI体系(de)安全政策,并具有监测各P CA行为(de)责任.它(de)具体功能是:1、发布PAA(de)公钥证书2、设置本体系(de)政策和操作程序3、设置本PKI体系中建立新PCA(de)政策和操作程序4、对下属PCA和需要交叉认证(de)其他根证书进行身份认证和鉴别.5、为下属PCA和需要交叉认证(de)其他根证书产生证书6、发布下属PCA(de)身份和位置信息7、接收和发布下级PCA(de)政策8、定义下级PCA申请证书作废请求所需(de)信息9、接收和认证对它所签发(de)证书(de)作废申请请求10、为它所签发(de)证书产生CRL11、保存证书,CRL,审计信息,PCA政策12、发布它所签发(de)证书和CRL4.2.2 PCA政策CA,制定本PCA下(de)具体政策,可以是PAA政策(de)扩充或细化,但不能与之相背离.这些政策可能包括本PCA范围内密钥(de)产生,长度,证书(d e)有效期规定,CRL(de)处理等.并为下属CA签发公钥证书.它(de)具体功能是:1、发布自己(de)身份和位置信息2、发布它所签发(de)下属CA(de)身份和位置信息3、公布它(de)服务对象4、发布它制定(de)安全政策和证书处理有关程序:如密钥(de)产生和模长,对PCA,CA,ORA系统(de)安全控制,用户私钥(de)安全控制,CRL(de)发布频率,审计程序等5、对下属各成员进行身份认证和鉴别.6、产生和管理下属成员(de)公钥7、发布PAA和自己(de)证书到下属成员8、定义证书作废请求生效所需(de)信息和程序9、接收和认证对它所签发(de)证书(de)作废申请请求10、为它所签发(de)证书产生CRL11、保存证书,CRL,审计信息,和它所签发(de)政策12、发布它所签发(de)证书和CRL4.2.3 CA不具备或具备有限(de)政策制定功能,按照上级PCA制定(de)政策,担任具体(de)用户公钥证书(de)生成和发布,或CRL生成发布职能.它(de)具体功能是:1、发布本地CA对PCA政策(de)增补部分2、对下属各成员进行身份认证和鉴别.3、产生和管理下属证书4、发布自身证书和上级证书5、证实ORA(de)证书申请请求6、向ORA返回证书制作(de)确认信息或已制定好(de)证书7、接收和认证对它所签发(de)证书(de)作废申请请求8、为它所签发(de)证书产生CRL9、保存证书,CRL,审计信息,和它所签发(de)政策10、发布它所签发(de)证书和CRL4.2.4 ORA进行证书申请者(de)身份认证,向CA提交证书申请请求,验证接收到(de)CA 签发(de)证书,并将之发放给证书申请者.必要时,还协助证书作废过程.它(de)具体功能是:1、对用户进行身份认证和鉴别.2、将用户身份信息和公钥以签名数据(de)方式发送给CA3、接收CA返回(de)证书制作确认信息或制作好(de)证书4、发放CA证书,CA(de)上级证书,以及(在返回制作好(de)用户证书(de)情况下)用户证书给用户5、接收证书作废请求,验证其有效性,验证通过(de)情况下向CA发放请求4.3 PKI体系结构(de)组织方式在一个PKI体系结构内,成员(de)组织可以有很多方式.例如,COI(Communi ty of interest)方式,这种方式将成员按他们(de)日常职能分类,将日常行为中通信较频繁(de)成员划分到一个CA或PCA下,政策(de)制定就由COI组织来决定;而组织化方式将PKI体系建立在现有(de)政府或组织机构(de)管理结构基础之上,而安全政策就由每一个组织(de)管理机构来制定;担保等级方式则基于在一个PKI系统中,成员(de)行为可以分为三到四个安全级别,成员按照他们相应(de)安全级别来组织,而安全政策(de)制定可以由类似委员会(de)机构来完成.这些方式都是基于两点(de)考虑:由哪个机构来设置安全政策,在安全政策下用户该如何组织.在具体(de)实施过程中采取哪种或哪几种方式(de)组合应考虑到以下因素后选取:系统可靠性,系统可扩展性,系统(de)灵活性和使用(de)便利性,CA机构(de)可信任性,在需要(d e)情况下,与其他系统(de)互操作性,建立系统或增加成员(de)时间开销,系统各模块(de)管理结构,责任划分等.4.4 PKI(de)操作思想在PKI(de)实际运行中,与PKI操作有关(de)许多行为都有多种实现方式,而且,这些行为各自选取了怎样(de)实现方式又将影响到其他行为(de)实现方式.不同实现方式(de)组合将形成不同(de)PKI全局操作思想(CONOPS).PKI操作有十二种主要行为,包括:产生,证明和分发密钥;签名和验证;证书(de)获取;验证证书;保存证书;本地保存(de)证书(de)获取;密钥泄漏或证书中证明(de)某种关系中止(de)报告;密钥泄漏(de)恢复;CRL(de)获取;密钥更新;审计;存储等,这些行为分别和PKI中下列成员相关:PKI 认证机构(P),数据发布(de)目录(D)和用户(U).用户(de)公私钥对(de)产生,验证和分发可以有两种方式:自己产生或由代理方产生.由实际(de)PCA政策决定.如果由用户自己产生,那么用户对产生密钥方法(de)选取,私钥(de)存放应负有责任,用户还应向CA提交和自己(de)公钥和身份证明,CA对用户进行身份认证,并对密钥(de)强度和持有者进行测试,在测试通过(de)情况下为用户(de)公钥产生证书,然后通过面对面,信件或电子方式将证书发放给用户,最后CA还负责将证书发布到相应(de)目录服务器.在某些情况下,用户将到ORA去进行证书申请.此时,ORA完成对用户(de)身份认证,通过后,以签名数据(de)方式向CA提供用户(de)公钥和相关信息,C A完成对公钥(de)测试然后产生证书,CA将证书返回给ORA,并由ORA发放给用户,或者,CA通过电子方式将证书发放给用户.另一种情况下,用户(de)密钥对由密钥产生中心系统来完成.这个密钥产生中心系统可以配置在CA里或作为一个单独机构.此时,用户应到密钥产生中心去产生密钥并取得密钥对,成功后密钥产生中心应自动销毁本地(de)用户密钥对拷贝,用户取得密钥对后,按照上面描述(de)方式到CA或ORA申请证书.CA(包括PAA,PCA,CA)自己产生自己(de)密钥对.ORA(de)密钥对可由自己或第三方产生)(由PCA(de)政策制定).PCA(de)公钥证书由PAA签发,同时,它取得PAA(de)公钥证书,CA(de)公钥由上级PCA签发,同时取得上级PC A和PAA(de)公钥证书,当它签发下级(用户或ORA)证书时向下级发送上级PCA,PAA(de)公钥证书.在PKI体系中,对信息或文件(de)签名,以及相应(de)对数字签名(de)验证属于使用非常普遍(de)操作.PKI(de)成员可以使用多种算法来计算数字签名和进行相应(de)验证,这些算法可以是硬件,软件或者软硬件结合(de)固件来完成.密钥和证书可以存放在内存中,或通过IC卡或软盘等其他介质存放.4.4.3 证书(de)获取在验证信息(de)数字签名时,用户必须获取信息(de)发送者(de)公钥证书,以及一些需要附加获得(de)证书(如CA证书等,用于验证发送者证书(de)有效性).证书(de)获取可以有多种方式,如发送者发送签名信息时附加发送自己(de)证书,或以另外(de)单独信息发送证书,或者可以通过访问证书发布(de)目录服务器来获得,或者直接从证书相关(de)实体处获得.在一个PKI体系中,可以采取某种或某几种上述方式获得证书.发送者在发送签名数据(de)同时可能发送证书链.此时,接收者拥有证书链上(de)每一个证书从而可以验证发送者证书;如果发送者没有发送这些证书,接收者必须判断为验证发送者(de)证书应取得哪些其他证书,可以通过检查发送者证书(de)发放机构CA从而从目录服务器取得该CA证书,并重复这个步骤直到追溯到一个已拥有可信任公钥证书(de)CA机构为止.或者通过判断证书(de)唯一名称中包括(de)证书验证机构名称从而取得该验证机构(de)证书,并重复该步骤直到追溯到一个已拥有可信任公钥证书(de)CA机构为止.在这两种方法中,必须借助目录服务来定位证书请求和相应CRL请求(de)目录服务器.签名验证(de)过程包括迭代(de)决定证书链中(de)下一个证书和它相应(de)上级CA证书.在使用每个证书前必须检查相应(de)CRL.用户从检查证书路径中最后一个证书(即用户确认可以信任(de)CA证书)所签发(de)证书(de)有效性开始,验证每一个证书,一旦证实后,提取被证实(de)证书中(de)公钥用于验证下一个证书,直到验证完签名信息发送者(de)证书,并将此证书中包括(de)公钥用于验证签名.保存证书是指PKI实体在本地储存证书以减少在PKI体系中获取证书(de)时间并提高签名验证(de)效率.在储存每个证书之前,应该验证证书(de)有效性.PKI实体可以选择储存所有从其他实体接收到(de)证书链上所有证书,也可以只存储签名数据发送者(de)证书等.证书存储区应定时管理维护,清除已作废或已过期(de)证书和一定时间内未使用过(de)证书,并同最新发布(de)CRL文件比较,删除CRL文件中发布(de)证书.证书存储区存满后,一般采取删除最少使用(LRU,least recently us ed)证书(de)方式维护.。
AN ASYMMETRIC CRYPTOGRAPHY SECURE CHANNEL PROTOCOL FOR SMART CARDS Konstantinos Rantos, Konstantinos MarkantonakisInformation Security Group, Royal Holloway, University of London, Egham, Surrey, TW200EX, United Kingdom, k.rantos@ Information Security Group Smart card Centre, Royal Holloway, University of London, Egham, Surrey, TW20 0EX, United Kingdom., k.markantonakis@Abstract: Smart card secure channel protocols based on public key cryptography are not widely utilised mainly due to processing overheads introduced in theunderlying smart card microprocessors and the complexities introduced by theoperation of a PKI infrastructure. In this paper we analyse the significance ofpublic key secure channel protocols in multi application smart cards. Webelieve that multi application smart card technology (e.g. the GlobalPlatformsmart card specification) should benefit more from the advantages of publickey cryptography specifically for the initiation and maintenance of a securechannel. This paper introduces a public key based cryptographic protocol forsecure entity authentication, data integrity and data confidentiality. Theproposed secure channel protocol uses a combination of public key, secret keyand the main idea behind the Diffie-Hellmann key establishment protocols inorder to achieve the desired goals.Key words: Secure Channel Protocol, Public Key Cryptography, Diffie-Hellmann, GlobalPlatform, Java Card, Multi-application smart cards1.INTRODUCTIONIn the recent years with the introduction of multi-application smart cards it became possible to securely host multiple applications, dynamically and securely download or delete them at any point during the card’s lifecycle. As a result, the complexity of the smart card operating system (SCOS) increased exponentially. Similarly, the complexity of the terminal2Konstantinos Rantos, Konstantinos Markantonakis applications increased significantly as new architectures [1, 2] emerged. Likewise, as smart card technology evolves (the performance of smart card cryptographic algorithms improves) and as new smart card applications are invented the benefits of public key cryptography are widely scrutinised.Multi-application smart card technology can benefit from the use of public key cryptography both at the application level and in the SCOS level e.g. with the provision of secure channel protocols based on Public Key Infrastructures (PKI). Current versions of secure multi-application smart card standards [6] do not fully take advantage of the benefits of public key cryptography, specifically for the provision of a secure channel mechanism. The reasons range from the increased prices due to the additional processing power, up to the potentially limited performance of public key cryptographic primitives in the current generation of smart card microprocessors, or simply because there is no immediate need for such functionality.The advantages and disadvantages of public key cryptography are widely documented in the academic literature [3, 4, 5]. In this paper we propose a public key secure channel protocol for smart cards. The protocol is based on the well known Diffie-Hellman key exchange protocol and it was designed by taking into account the processing and storage restrictions of current smart card microprocessors. Alongside with the protocol description we also provide a discussion on the operation and security requirements for its successful and efficient operation. We believe that as the number of smart card applications increases and the nature of smart card applications changes along with the differentiations on the operational requirements (e.g. dynamic application downloading and deletion), the demand for efficient smart card PKI will potentially increase.The remainder of this paper is organised as follows. Firstly, we set up the scenery by elaborating more on motivation behind the paper along with providing an overview of the main characteristics of a multi-application smart card standard, namely GlobalPlatform [6]. Subsequently, we highlight the main characteristics of the supporting public key infrastructure required for the successful operation of the protocol. Moving to the core idea of this paper we present the protocol details and architectural design. In order to provide a more complete coverage of the issues surrounding the implementation and operation of the proposed architecture we also provide a discussion around the security properties of the protocol by highlighting practical issues that imposed certain design decisions. Finally, we discuss several practical issues and provide directions for further research.An asymmetric cryptography secure Channel protocol for smart cards3 2.PUBLIC KEY SMART CARD SECURE CHANNELPROTOCOLS AND THE REAL WORLD In the following sections we provide an overview of limiting factors along with the driving forces behind the adoption of public key cryptography in multi application smart card platforms. Similarly, we highlight the main characteristics of a widely used multi application smart card standard in order to provide a reference point to the specifics of an existing architecture along supporting the case for the existence of such a protocol.2.1MotivationThe advantages and disadvantages of public key cryptography have been a topic of discussion for many years. The significance of public key cryptography in smart cards, impose certain restrictions and complexities that are unique to smart card microprocessors and the nature of the infrastructures they operate.A few years ago the main prohibiting factor for the utilization of public key cryptography in smart card microprocessors was the limited processing power of the underlying technology. However, following a number of significant improvements both at the hardware [24] and software level [20, 21, 22] the operation and performance of public key cryptography in smart card microprocessors has improved significantly.The nature of smart card applications is also changing. There are instances, in which public key cryptography specifically for the establishment of a secure channel might be considered beneficial e.g. when two unknown parties want to establish keys and protect subsequent communications. Another example can be drawn by the nature of the fact that secure channels are normally used for personalization or in order to protect post issuance operations (e.g. application/card management functions [6], protection of application or smart card operating system (SCOS) data [25]).Although the significance of public key cryptography in a smart card environment cannot be underestimated at the same time the drawbacks are negligible. For example, a secure channel protocol designed specifically for smart cards has to be as lightweight as possible, depending of course on the underlying security and operational requirements. Furthermore, in order to improve the required performance and fulfill the security objectives, a combination of cryptographic primitives and algorithms might be used. Finally, further constraints arise from the fact that a public key based4Konstantinos Rantos, Konstantinos Markantonakis architecture requires the existence of a public key infrastructure (PKI) [26] for the management keys and certificates.Our proposed protocol aims to fulfil some of the aforementioned requirements. It is designed by keeping in mind the performance requirements and operational characteristics of smart card microprocessors. Although there is a plethora of public key cryptography secure channel protocols [33], most of them are not specifically designed by taking into account the specific characteristics of smart cards. For example, smart card microprocessors have limited communication buffers, often ranging between 190-255bytes. Therefore, if a protocol requires a large number of messages to be exchanged between the card and an off-card entity this will add to the communication and processing overheads [32]. Furthermore, the nature of a public key infrastructure requires the existence of cryptographic key certificates. For example, if a protocol requires regular checks in order to identify whether certificates are revoked or expired this might add to overall protocol security but on the other hand it will potentially complicate its mitigation in smart card environment.The proposed solution does not claim to introduce a protocol based on new cryptographic techniques. Instead it is an implementation adaptation of existing cryptographic primitives and techniques which are carefully selected in order to be used in a smart card environment. Before moving into the details of the proposed architecture, we highlight the main characteristics of a multi aplication smart card platform.2.2An Overview of GlobalPlatform Card SpecificationIn this section we highlight the main characteristics and the core components of the GlobalPlatform (GP) card specification [6], as a typical example of a multi application smart card architecture that could benefit from the utilization of the proposed protocol. Please note that among the main reasons behind the description of the GlobalPlatform architecture is that it provides the necessary functionality (e.g. secure storage of keys, key management, etc.) required by the protocol. However there are no restrictions or prerequisite for a specific type of smart card technology as the protocol could be utilised and implemented either at the application or at the (SCOS) [7, 8] level irrespectively of the characteristics of the underlying smart card microprocessor.The GlobalPlatform smart card architecture is comprised of a number of on-card components that offer secure multi-application card management functionality at any given point during the card’s lifecycle. Furthermore, the GlobalPlatform smart card architecture is closely coupled with the Java cardAn asymmetric cryptography secure Channel protocol for smart cards5 [9] technology although there are no restrictions on it’s portability to other smart card platforms [10, 11].The functionality provided by the underline card management system includes the necessary mechanisms (e.g. secure channels [12]) that enable secure communication with the outside world. A secure channel is a mechanism that allows a card and an off-card entity to authenticate each other and establish session keys in order to protect the integrity and confidentiality of subsequent communications.The GlobalPlatform card specification defines two protocols which are used to establish a secure channel. SCP01 is defined in Appendix D of the GlobalPlatform card specification as a symmetric key protocol that provides three levels of security (i.e. mutual authentication, integrity and data origin authentication, confidentiality). The details of the other secure channel protocol (SCP02) can be found in Appendix E of the GlobalPlatform card specification. The two protocols use symmetric key cryptography for the authentication, establishment of session keys and protection of subsequent communication between the card and the outside world. Although, the existing protocols are mainly used for card content management purposes they can also be used by applications for secure communications. For example, secure communication between a card and an off-card entity is considered necessary whenever a sensitive operation (e.g. during cryptographic key exchanges) is about to be performed.Another main component of GlobalPlatform is the notion of security domains. GlobalPlatform security domains are the on-card representatives of the card Issuer or an application provider. It is the security domains that allow Issuers to share control, over selected portions of their card, with approved partners. Additionally, security domains are responsible for cryptographic functions and key handling/separation functionality. In terms of communicating with the off-card entity in a secure way the security domains implement different secure channel protocols, as aforementioned. For the purpose of this paper we will be using the notion of a security domain as a mechanism that will securely store keys and control access to the secure channel mechanisms.The GlobalPlatform smart card specification is becoming the de-facto mechanism for secure application handling especially for Java cards [9] used in the GSM [28] and finance sectors [27]. There are currently on going discussions in order to enhance the functionality offered with the provision of additional secure channel protocols based on public key cryptography. In the following sections we present the main characteristics of the proposed protocol.6Konstantinos Rantos, Konstantinos Markantonakis 3.THE PROPOSED PUBLIC KEY ARCHITECTUREIn a multi application smart card usage scenario the entities that are likely to get involved in a communication session with the card are the Issuer and any Application Provider who has a business relationship with the Issuer. Given the number of the entities involved, there is clearly a need for a Public-Key Infrastructure (PKI) [29, 30] that assists these entities in managing their keys and supports the security functions of the proposed protocol. The supporting functions of a PKI include key certification, authorisation of participating entities, and the ability of a participating entity to have multiple keys.In this section we highlight the main characteristics of a PKI for supporting the protocol described in this paper. For simplicity and in order to sustain the practicality of the overall architecture the description of the proposed infrastructure will provide examples linked with the GP architecture as described above. Furthermore, we also assume that adequate key and entity management procedures are in place.According to the proposed infrastructure, each participating off-card entity (being an Issuer or an Application Provider) has a key pair (namely certification key pair) which is used for the certification of other keys. The public key of this key pair is securely loaded on the card (e.g. in a security domain that represents the off-card entity on the card). The corresponding private key is used for the certification of RSA public encryption keys (which are used for the establishment of a secure channel). These certificates bind the included public key to the entity that is authorised to use this public key encryption key during the establishment of a secure session. As an alternative, the certification key pair might belong to a Certification Authority, which has a business relationship with the off-card entity.Secure loading and replacement of these keys can take place by establishing a secure channel that will enable the secure transfer of keys to the card (e.g. by using the Put Key command as described in the GP specifications). Initial keys for the Issuer can be hard-coded (e.g. masked in ROM) and used, during the personalisation phase, for the loading of the public certification keys. Loading of the public keys for Application Providers has to be done in a secure way (e.g. during the loading of the corresponding GP security domains or during the personalisation of these security domains). Following the loading of these certification keys, any public encryption key that belongs to an entity recognised by the security domain and is certified using the certification private key can be used for the establishment of a secure channel.Given the proposed infrastructure, the card (or a security domain) is able to tell whether the key presented to it belongs to an entity that is authorisedAn asymmetric cryptography secure Channel protocol for smart cards7 to establish a secure channel by verifying the certificate. For instance, if the certified key belongs to an Application Provider and is certified using the certification key loaded on the Application Provider’s logical space in the card (e.g. a security domain) then the off-card entity is authorised to establish a secure session with one of the applications belonging to this Provider.To strengthen the security provided by this scheme and considering that the off-card entity might use the certification key pair to certify keys not used by this protocol, certificates have to explicitly state that the certified keys are authorised to be used for the establishment of a secure channel. This explicit authorisation is granted when specified in one of the certificate extensions. Given an Issuer who would typically have many certified keys for different purposes, there is clearly a need to protect the card from accidental or deliberate misuse of a key that is not authorised for this purpose. Therefore, the card should only use those keys that explicitly state in a dedicated extension that they can be used for communications with the card, and more specifically, for establishing a secure channel.Apart from the off-card entities’ RSA public encryption keys, the proposed protocol requires each card to have one or more Diffie-Hellman keys [12]. There are two options for the certification of these keys; either the card has a single key pair which is certified by the Issuer and shared among applications (or security domains) that exist on the card, or each application (or security domain) has its own key pair certified by the entity it belongs to. The second option provides more flexibility as it allows the corresponding entity to specify the format based on their applications requirements. Given that none of these approaches introduce any risks to the security of the protocol it is up to the issuer’s discretion to adopt either of these options. Please note that the infrastructure required for supporting the certification and verification of these keys by the participating off-card entities is beyond the scope of this paper.4. A PUBLIC KEY SECURE CHANNELESTABLISHMENT PROTOCOLIn this section we present a protocol that utilizes well-established public key techniques for mutual authentication and key establishment between a smart card and an off-card entity based on the Diffie-Hellman key agreement protocol and a combination of symmetric and asymmetric cryptography. The established session keys are used for providing integrity and confidentiality on the exchanged messages. For this protocol the following requirements must be satisfied:8Konstantinos Rantos, Konstantinos Markantonakis1.All entities share public values p and a, where p is a large primenumber and a is an element of large prime multiplicative ordermodulo p. We will write a x for (a x mod p) throughout.2.Each card has a Diffie-Hellman key agreement key pair. Morespecifically, card C has private key agreement key y withcorresponding public key a y. The card’s key pair can be eithergenerated off-card by the issuer or the application provider andsubsequently loaded onto the card, or it can be generated on-card(if the functionality is provided by the card). In either case thepublic key has to be certified by the corresponding off-cardentity, i.e. the issuer or an application provider.3.The host has an RSA public encryption key (HPEK), which iscertified by the corresponding certification authority.4.The card and the host share a symmetric cryptosystem and twodifferent key generation functions (e.g. a one-way function) f1and f2.5.The card is capable of generating pseudorandom numbers.6.Each security domain on the card has a trusted copy of itsowner’s (issuer or application provider) public certification keywhose corresponding private key is used by the off-card entityfor issuing certificates.The proposed protocol, which involves a host (off-card entity) H and a card C, consists of the following steps (please note that messages in brackets are considered optional):1.The host initiates the protocol by generating a random secret x, 1 ≤x≤p-2, and computes αx. The host sends (e.g. as part of the I NITIALIZE U PDATE command) the computed value αx, together with its public encryption key certificate Cert(HPEK):H ! C: αx, Cert(HPEK), {options}where options is used by the host to inform the card on certain communication requirements (e.g. protecting certain card details and whether the card has to return to the host the certificate on its Diffie-Hellman public key or just the certificate’s identification number).2.On receipt of the message the card verifies the certificate Cert(HPEK)using the preloaded public certification key of the corresponding off-card entity. If the certificate verification is successful and the entity is pre-An asymmetric cryptography secure Channel protocol for smart cards9 authorised (e.g. the entity possesses a security domain) then the card generates the following: a random value randC and if the options field sent by the host requires anonymity the card generates a session key K1 and encrypts its Diffie-Hellman certificate (Cert(C-DH)) using this key (encryption is done using a symmetric cryptosystem). Note that, if neither the card, nor the host require anonymity the card still has to send its certificate or the certificate’s serial number (CSN) but this time in clear. The card, using the host’s public encryption key HPEK, encrypts the random number randC, the CSN, and if encryption of Cert(C-DH) is required, the key K1, and sends the following response to the host:C ! H: E HPEK(randC, {K1}, CSN), E K1(Cert(C-DH))where E K(M) denotes encryption of message M using key K, and CSN is the card’s unique identifier. K1 is the output of a key generation function f1 whose input is the shared Diffie-Hellman key αxy, i.e. K1 = f1 (αxy). 3.On receipt of the card’s response the host decrypts the first encryptedmessage using its private decryption key and extracts the random value randC, the optional key value K1 and the CSN. If anonymity was a requirement, which implies that the card’s certificate is encrypted, the host decrypts the received certificate and checks its validity. Following that, the host generates the shared key αxy using the card’s public Diffie-Hellman key and the secret value x that the host generated, and verifies that the key K1 used to encrypt the certificate was the output of the key generation function f1. The calculation of the shared secret and the correct verification of K1 enables the host to authenticate the card. The host sends (e.g. with the E XTERNAL A UTHENTICATE command) the following encrypted, using a symmetric cryptosystem, message that consists of the random value randC and the optional session keys:H ! C: E K2(randC, {session keys})where K2 denotes the output of a key generating function f2 which takes as input the shared Diffie-Hellman key αxy, i.e. K2 = f2 (αxy). The optional session keys, if sent to the card, will be used as the session keys for the established session. This is useful during card personalisation and card updates where the off-card system has pre-computed the messages to speed up the process. Note that if the off-card entity does not send session keys, a similar key generating function can be utilised for the generation of session keys (which will be used to provide integrity and confidentiality for the exchanged messages).10Konstantinos Rantos, Konstantinos Markantonakis 4.On receipt of the above message the card generates the temporary keyK2, decrypts the received message, and checks whether the random number included in the message matches the number that the card sent to the host. This check proves to the card that the message is not a replay of an old message.If all the steps are successful, the host and the card will use the established session keys (or the keys provided by the host in step three of the protocol) for the protection of exchanged messages throughout this session. 5.PROPERTIES AND SECURITY ANALYSISThe proposed protocol provides mutual authentication and session key establishment between the communicating entities, i.e. an off-card entity and the card. The established session keys can be used to optionally provide integrity and message authentication as well as confidentiality on subsequent communications. Although the protocol is based on public key techniques it takes into account the restricted computing resources offered by a smart card (as briefly described in the previous sections). Therefore, the number of expensive computations (like the ones required by public key cryptography) are minimised to avoid processing overheads.One of the factors that could affect the number of expensive computations was the choice of the Diffie-Hellman keys. Diffie-Hellman keys can be of two flavours; either long term, preferably certified, keys or just short term keys that are typically used for a single session. The card’s Diffie-Hellman key pair is fixed so that to avoid the computational overhead required for the generation of a new key pair (a relatively computationally expensive operation for a smart card given that the card has this capability) for each session. However, it is assumed that the host possesses the computational resources for computing and storing a large number of key pairs. For that particular reason it uses a new key pair (for each communication), as opposed to a fixed certified one, so that to avoid one more certificate verification on the card. Note that the host can generate these keys in advance to avoid delays introduced by the generation of these keys during the establishment of a secure session.5.1Compromise of Cryptographic KeysAmong the main issues surrounding the deployment and operation of a security protocol is the compromise of the scheme’s private keys. If a card’sDiffie-Hellman key pair is compromised it is the Issuer’s decision whether to terminate or block this card, or simply update this card’s Diffie-Hellman key pair. In the GP analogy if the key belongs to an Application Provider’s security domain the Application Provider has to simply update this key by using the Put Key command.If an off-card entity’s RSA encryption key pair is compromised, the off-card entity has to perform the following actions in order to prevent further use of the compromised key by a malicious user:1.The off-card entity has to generate a new certification key pair, whichwill replace the one used to certify the compromised key.2.The off-card entity has to generate a new RSA encryption key pair andcertify the public key of this key pair using the new private certification key. Note that if the issuer has issued multiple certification keys, it then has the option not to generate a newly created key pair but use an existing one.3.All the cards that carry the old public certification key have to beupdated with the new public key. As soon as the cards obtain the new certification key they will be able to reject certificates that were created using the compromised key.Replacement of the certification key pair is also deemed necessary when RSA public encryption key certificates are due to expire to ensure that a key is not used beyond its expiration date. The off-card entity can use the above method to replace these keys.An off-card entity, being the Issuer or an Application Provider, can have multiple RSA encryption key pairs to avoid unnecessary exposure of a single key. Given that the public key of this key pair is certified by a certification private key whose public counterpart is loaded on the card, the card will be able to verify this key and use it for the establishment of the secure channel. Off-card entities can also use multiple certification keys. In that case, however, the off-card entity has to have access to information that will assist it in the choice of the correct public encryption key certificate, prior to initiating the establishment of a secure channel. In the GP analogy this information can be part of the security domain management data provided to the host as a response to a SELECT command as defined in [6].5.2Protocol EfficiencyIt can be argued that protocol is relatively heavy, especially when compared with corresponding symmetric key protocols. However, the。