The invention discloses a secure storage method of client key based on bidirectional password authentication, which mainly includes bidirectional authentication method between client and server, key negotiation mechanism based on authentication and secure storage mechanism of client key after authentication. The bidirectional authentication direction between client and server includes the following steps: client randomly generates client \u2011 nonce, and then The authentication request is sent to the server along with username; after the server receives the request, it queries the salt and iteration \u2011 count corresponding to username from the database, and randomly generates the server \u2011 nonce, and then sends the server \u2011 nonce and the salt and iteration \u2011 count corresponding to username to the client; after the client receives the message, it calculates the client authentication credentials and sends the client to the server After receiving the message, the server calculates key1 and compares whether H (key1) is consistent with the stored H (key). If yes, the client passes the authentication. Otherwise, the client fails the authentication. The invention has the advantages that the safety and practicability are taken into account to the greatest extent.
【技术实现步骤摘要】
基于口令双向认证的客户端密钥安全存储方法
本专利技术涉及一种基于口令双向认证的客户端密钥安全存储方法。
技术介绍
在网络信息化快速发展的今天,越来越多的用户使用网络传输数据信息。为了保护用户传输的数据及隐私安全,一般需要进行网络身份认证(即用户与服务器之间的认证),其中基于用户口令的认证是一种常用且有效的方法。常规方案一般可归纳为以下三类实现。第一类,服务端直接口令明文存储,系统认证时通过用户输入的口令和预先存储的用户口令进行比较进而实现用户的认证;第二类,服务端口令HASH存储,系统认证时对用户输入的口令进行HASH计算,最后与系统预先存储的用户口令的HASH值进行比对,如果一致则认证通过,否则认证失败;第三类,服务端口令HASH加盐存储,系统认证时,对用户输入用户的口令以及注册时对服务端产生并存储的随机盐值进行HASH或者HMAC处理,最后与系统预先存储口令HASH加盐处理的HASH值进行比对,如果一致则认证通过,否则认证失败。网络身份认证作为网络信息安全的第一道防线,具有十分重要的意义。口令认证技术是解决网络安全的核心技术。然而,当前常规方案所采用的三种服务端口令存储技术存在以下缺点:第一类服务端直接口令明文存储,这一类方案基本无安全可言,用户口令完全暴露在数据库,一旦被拖库后果不堪设想;第二类服务端口令HASH存储,这一类如果口令不是特别复杂的话基本使用查字典法或彩虹表破解法都能轻松破解口令,因此一旦数据库被拖库口令基本也能破解;第三类服务端口令HASH加盐存储,这一类虽然在一定意义上 ...
【技术保护点】
1.一种基于口令双向认证的客户端密钥安全存储方法,其特征在于,包括:客户端与服务端的双向认证方法;/n客户端与服务端的双向认证方向包括以下步骤:/n(1)客户端随机产生client-nonce,然后随同username一起发送认证请求给服务端;/n(2)服务端收到请求后,先临时存储username以及client-nonce,并从数据库中查询username对应的salt和iteration-count,同时随机产生server-nonce并临时存储于本地,然后向客户端发送server-nonce以及username对应的salt和iteration-count;/n(3)客户端收到报文后,首先根据客户输入的password以及salt、iteration-count,计算客户端认证凭据ClientProof=Key⊕FUN(H(Key),username,server-nonce);客户端向服务端发送客户端认证凭据ClientProof,其中:Key=Hi(password,salt,iteration-count);/n(4)服务端收到报文后,查询username注册时数据库中对应 ...
【技术特征摘要】
1.一种基于口令双向认证的客户端密钥安全存储方法,其特征在于,包括:客户端与服务端的双向认证方法;
客户端与服务端的双向认证方向包括以下步骤:
(1)客户端随机产生client-nonce,然后随同username一起发送认证请求给服务端;
(2)服务端收到请求后,先临时存储username以及client-nonce,并从数据库中查询username对应的salt和iteration-count,同时随机产生server-nonce并临时存储于本地,然后向客户端发送server-nonce以及username对应的salt和iteration-count;
(3)客户端收到报文后,首先根据客户输入的password以及salt、iteration-count,计算客户端认证凭据ClientProof=Key⊕FUN(H(Key),username,server-nonce);客户端向服务端发送客户端认证凭据ClientProof,其中:Key=Hi(password,salt,iteration-count);
(4)服务端收到报文后,查询username注册时数据库中对应存储的H(Key),根据username及server-nonce,计算Key1=ClientProof⊕FUN(H(Key),username,server-nonce),并比较H(Key1)与存储的H(Key)是否一致,若是则对客户端认证通过,若否则对客户端认证失败;
如对客户端认证通过,服务端根据前面报文收到的username及client-nonce计算ServerProof=FUN(Key1,username,client-nonce),向客户端发送服务端认证凭据ServerProof,
并计算会话密钥:SessionKey=FUN(Key1,username,server-nonce,client-nonce);
(5)客户端收到报文后,计算ServerProof1=FUN(Key,username,client-nonce),并比较ServerProof1与ServerProof是否一致,若是则对服务器认证通过,否则对服务端认证失败;
如对服务器认证通过,
计算会话密钥:SessionKey=FUN(Key,username,server-nonce,client-nonce),并向服务端反馈认证消息;
(6)服务端收到认证报文,确...
【专利技术属性】
技术研发人员:刘志强,毛伟信,
申请(专利权)人:杭州字节信息技术有限公司,
类型:发明
国别省市:浙江;33
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。