RSA令牌如何运作?

Jau*_*u L 39 encryption algorithm cryptography rsa access-token

我想了解RSA令牌(SecurID)是如何工作的,那里使用的算法是什么,它是否与常规RSA加密/解密算法相同?

osg*_*sgx 18

引用Wiki

RSA SecurID身份验证机制由"令牌"组成 - 硬件(例如USB加密狗)或软件(软令牌) - 分配给计算机用户,并使用固定间隔(通常为60秒)生成验证码内置时钟和卡的工厂编码随机密钥(称为"种子".每个令牌的种子不同,并加载到相应的RSA SecurID服务器(RSA Authentication Manager,以前的ACE/Server)中作为购买代币1.

因此,它可能与RSA公钥算法有关.关于SecurID的真正内部(默默无闻的安全性)鲜为人知,但有一些分析,例如最初的securid分析,以及维基百科中SecurID页面底部的更多分析.

此外,硬件令牌具有防篡改功能,因此几乎不可能复制被盗令牌.

更新:感谢eyaler,经典的SecurID中没有任何公钥/私钥; 它们基于"共享秘密",而不是基于非对称算法.维基百科说,AES-128的变体用于从密钥("种子")生成令牌代码.密钥在工厂编码成密钥.


Vol*_*erK 11

您可以在http://seclists.org/bugtraq/2000/Dec/459查看它是如何完成的.

(过度简化)机制是

hash = <some initial value>
every x seconds do:
   hash = hashfunction(hash + secret_key)
   print hash
Run Code Online (Sandbox Code Playgroud)

  • 但是这意味着,如果在时间T处散列,例如h(T)已知,则必须通过顺序计算所有中间散列来计算时间t + T,h(t + T)处的散列. (2认同)
  • @VolterK不完全正确.对于这类事情,你不能依赖"足够准确".我在http://www.ais-cur.com/IntrotoSecurID.pdf上找到了实际答案(第10页和第12页).他们根据用户的输入调整可能的时间漂移​​.我没有足够的空间在这里给出更详细的解释,但是在我给它们的链接中,他们在"有效令牌时间窗口和时钟漂移调整"一节中非常清楚地解释了它. (2认同)
  • 好的,这是RSA交钥匙解决方案的一个(慷慨的)附加功能.设备的时钟仍需要保持在一定的时间范围内.我收回具体的第二和第二分钟陈述并将其替换为"最大时间跨度(您必须在产品的文档中查找)". (2认同)

Ian*_*oyd 7

我可以让您了解暴雪移动验证器的工作原理,因为它们的代码是开源的. (存档)

简而言之,伪代码是:

String GetCurrentFOBValue()
{
   // Calculate the number of intervals since January 1 1970 (in UTC)
   // The Blizzard authenticator rolls over every 30 seconds,
   // so codeInterval is the number of 30 second intervals since January 1 1970.
   // RSA tokens roll over every minute; so your counter can be the number 
   // of 1 minute intervals since January 1, 1970
   // Int64 codeInterval = GetNumberOfIntervals();
   Int64 codeInterval = (DateTime.Now - new DateTime(1970,1,1)).TotalSeconds / 30;

   // Compute the HMAC_SHA1 digest of the code interval, 
   // using some agreed-upon 20-bytes of secret key material.
   // We will generate our 20-bytes of secret key material by
   // using PBKDF2 from a password. 
   // Blizzard's mobile authenticator is given secret key material
   // when it enrolls by fetching it from the web-site.
   Byte[] secret = PBKDF2("Super-secret password that our FOB knows", 20); //20 bytes

   // Compute a message digest of codeInterval using our shared secret key
   Byte[] hmac = HMAC(secret, codeInterval);

   // Pick four bytes out of the hmac array, and convert them into a Int32.
   // Use the last four bits of the digest as an index 
   // to which four bytes we will use to construct our Int32
   int startIndex = hmac[19] & 0x0f;

   Int32 value = Copy(hmac, startIndex, 4).ToUInt32 & 0x7fffffff; 

   // The blizzard authenticator shows 8 digits
   return String.Format("%.8d", value % 100000000);

   // But we could have just as easily returned 6, like RSA FOBs do
   return String.Format("%.6d", value % 1000000);
}
Run Code Online (Sandbox Code Playgroud)

注意:任何代码都将发布到公共域中.无需归属.