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)
我可以让您了解暴雪移动验证器的工作原理,因为它们的代码是开源的. (存档)
简而言之,伪代码是:
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)
注意:任何代码都将发布到公共域中.无需归属.