我想了解RSA令牌(SecurID)是如何工作的,它使用的算法是什么,它与常规的RSA加/解密算法是相同的吗?
发布于 2011-12-01 20:03:27
你可以在http://seclists.org/bugtraq/2000/Dec/459上看看它是如何做到的
(过于简化的)机制是
hash = <some initial value>
every x seconds do:
hash = hashfunction(hash + secret_key)
print hash发布于 2012-10-30 05:48:27
我可以让你了解一下暴雪移动授权码是如何工作的,因为他们的代码是has been open-sourced.
基本要点是:
以来的30秒间隔数
简而言之,伪代码是:
String GetCurrentFOBValue()
{
// Any code is released into the public domain. No attribution required.
// 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);
}发布于 2018-01-15 12:04:54
@VolkerK's answer链接到描述“64位”RSA令牌算法的C代码,该令牌使用基本上自定义的算法(逆向工程~2000)。
但是,如果您对更现代的“128位”令牌(包括无处不在的SID700硬件令牌和等效的软令牌)所使用的算法感兴趣,那么可以查看stoken的源代码,这是一个全面记录其工作原理的开源项目;securid_compute_tokencode是主要的入口点。
本质上,算法是这样工作的:
从当前时间和串行number
它与Google Authenticator、YubiKey、Symantec VIP access等中使用的开放标准TOTP算法(Initiative For Open Authentication的一部分)并没有太大不同。只需MOAR SPESHUL和专有的EKSTRA SECURITEH!
https://stackoverflow.com/questions/8340495
复制相似问题