真實場域誤用RSA之現況研析
A Study on The Misuse of RSA in the Field
摘要
在現今網路通訊蓬勃發展的環境之下,RSA密碼系統(RSA Cryptosystem)是目前最廣泛被使用來保護通訊安全與資料安全的密碼系統,雖然截至目前為止RSA密碼系統仍可提供足夠的安全強度,但若未被妥善使用,仍可能會造成安全性上的缺陷。目前已發表之研究提出RSA在真實網路中的誤用(Misused)狀況且針對某些誤用狀況在真實網路進行研究,但是缺少一個針對目前已知RSA誤用狀況的全面性研究。為了更清楚且全面性地了解RSA密碼系統在真實網路中被錯誤使用的情況,我們完成了第一個涵蓋多數RSA主要誤用弱點的大規模研究調查,此研究調查的對象為現今IPv4網路上實際使用中的RSA公開金鑰(RSA public keys)。
本研究針對IPv4 HTTPS下共約三千七百萬把RSA公開金鑰與Alexa 排行前一百萬的熱門網站HTTPS下共約六十萬把RSA公開金鑰進行以下三大類型在真實場域之RSA誤用現況研析: 1) 質因數分解(Factoring) 2) 低私密指數攻擊(Low Private Exponent)攻擊 3) 實作上的攻擊(Attacks on the Implementation) 。
研究結果發現: 1) 在質因數分解攻擊下,多達三分之一的金鑰長度不足;且並未發現肇因於未使用強質數(Strong Prime)而被在平滑度上限(Smoothness Bound) 10,000,000以下Pollard質因數分解方法成功攻擊之案例,實驗結果顯示不強制使用強質數並無立即性威脅;此外,並未發現肇因於未檢查兩質數距離而被Fermat質因數分解攻擊成功攻擊之案例,此結果顯示目前使用之RSA金鑰長度使Fermat攻擊未被發現存在於真實環境。 2) 在低私密指數(Low Private Exponent)攻擊下,並無Wiener與Boneh and Durfee攻擊法成功攻擊之案例。為了防止低私密指數攻擊,現今標準與密碼系統實作限制公開指數(Encrypt Exponent)的選取範圍,實驗結果驗證此方法可以有效防止低指數攻擊的發生。 3) 研究中發現使用預設金鑰的問題持續惡化,且網頁框架(XAMPP、 AppServ、AMPPS) 所安裝之預設金鑰大量地被使用於現實網路上,而針對台灣區域所進行之研究則發現大部分的預設金鑰來自於台灣學術網路;另外,HTTPS下Debian弱金鑰已不存在,且具共用質數問題(Factorable Keys)的弱金鑰數量亦從漏洞被發掘時的0.5%下降到2015年12月的0.09%,再到2016年4月的0.075%。
為了處理大量測試資料,我們實作了一套自動化且模組化的RSA弱點測試平台,此測試平台整合了最新的測試工具並將不同的測試情境進行先後順序的排程以達到自動化測試的功能。藉由我們的模組化測試平台,未來研究者將可以在任何時間點重複實驗以獲取最新的資料,且其模組化的系統亦提供新增額外檢測項目的彈性。
本研究針對IPv4 HTTPS下共約三千七百萬把RSA公開金鑰與Alexa 排行前一百萬的熱門網站HTTPS下共約六十萬把RSA公開金鑰進行以下三大類型在真實場域之RSA誤用現況研析: 1) 質因數分解(Factoring) 2) 低私密指數攻擊(Low Private Exponent)攻擊 3) 實作上的攻擊(Attacks on the Implementation) 。
研究結果發現: 1) 在質因數分解攻擊下,多達三分之一的金鑰長度不足;且並未發現肇因於未使用強質數(Strong Prime)而被在平滑度上限(Smoothness Bound) 10,000,000以下Pollard質因數分解方法成功攻擊之案例,實驗結果顯示不強制使用強質數並無立即性威脅;此外,並未發現肇因於未檢查兩質數距離而被Fermat質因數分解攻擊成功攻擊之案例,此結果顯示目前使用之RSA金鑰長度使Fermat攻擊未被發現存在於真實環境。 2) 在低私密指數(Low Private Exponent)攻擊下,並無Wiener與Boneh and Durfee攻擊法成功攻擊之案例。為了防止低私密指數攻擊,現今標準與密碼系統實作限制公開指數(Encrypt Exponent)的選取範圍,實驗結果驗證此方法可以有效防止低指數攻擊的發生。 3) 研究中發現使用預設金鑰的問題持續惡化,且網頁框架(XAMPP、 AppServ、AMPPS) 所安裝之預設金鑰大量地被使用於現實網路上,而針對台灣區域所進行之研究則發現大部分的預設金鑰來自於台灣學術網路;另外,HTTPS下Debian弱金鑰已不存在,且具共用質數問題(Factorable Keys)的弱金鑰數量亦從漏洞被發掘時的0.5%下降到2015年12月的0.09%,再到2016年4月的0.075%。
為了處理大量測試資料,我們實作了一套自動化且模組化的RSA弱點測試平台,此測試平台整合了最新的測試工具並將不同的測試情境進行先後順序的排程以達到自動化測試的功能。藉由我們的模組化測試平台,未來研究者將可以在任何時間點重複實驗以獲取最新的資料,且其模組化的系統亦提供新增額外檢測項目的彈性。
In the Internet era, we heavily rely on RSA cryptosystem to protect data integrity and privacy. Various misuses of RSA have been discovered even though there are no published algorithms which break RSA efficiently. Former research studies only focus on particular misuse of RSA in the real IPv4 network. To better understand how RSA fails in the wild, we propose the first large-scale survey in this research for major RSA misuse vulnerabilities in the real IPv4 Network.
In this thesis, Factoring, Low Private Exponent Attack, and Attacks on the Implementation are three categories against 37 million of public keys in IPv4 HTTPS and 600 thousand of public keys in Alexa top 1 Million HTTPS.
The result shows: First, there are up to one third of public keys with insufficient key length. No public keys are found to be vulnerable to Pollard’s p-1 Factorization Method with smoothness boundary 〖10〗^6 due to not using Strong Prime. Hence, there is no emergency without using strong prime. Moreover, no public keys are found to br vulnerable to Fermat’s Factorization Method due to not checking the distance between primes in practice. Second, public keys are not vulnerable to Wiener’s attack in our dataset. Similarly, negative result is found on Boneh and Durfees’ attack. The result validates that recent implementation of cryptographic library prevents Wiener’s and Boneh and Durfees’ attacks. Third, the problem caused by using default key is getting worse. Several web frameworks (XAMPP, AppServr, and AMPPS) use default certificates, and the certificates are largely distributed in the Internet. Furthermore, according to the study in Taiwan, we find that the most vulnerable IP group is TANet. Debian’s weak keys disappeared in IPv4 HTTPS, and the number of factorable keys are decreasing from first revealed 0.5% to 0.09% on Dec. 14th, 2015 and 0.075% on Apr. 18th, 2016.
An automatic and modularized testbed is constructed, which integrates the sate-of-the-art tools and schedules the test cases with various time complexities. With the help of the testbed, the survey can be replicated and the testbed can be extended for up-to-date vulnerabilities.
In this thesis, Factoring, Low Private Exponent Attack, and Attacks on the Implementation are three categories against 37 million of public keys in IPv4 HTTPS and 600 thousand of public keys in Alexa top 1 Million HTTPS.
The result shows: First, there are up to one third of public keys with insufficient key length. No public keys are found to be vulnerable to Pollard’s p-1 Factorization Method with smoothness boundary 〖10〗^6 due to not using Strong Prime. Hence, there is no emergency without using strong prime. Moreover, no public keys are found to br vulnerable to Fermat’s Factorization Method due to not checking the distance between primes in practice. Second, public keys are not vulnerable to Wiener’s attack in our dataset. Similarly, negative result is found on Boneh and Durfees’ attack. The result validates that recent implementation of cryptographic library prevents Wiener’s and Boneh and Durfees’ attacks. Third, the problem caused by using default key is getting worse. Several web frameworks (XAMPP, AppServr, and AMPPS) use default certificates, and the certificates are largely distributed in the Internet. Furthermore, according to the study in Taiwan, we find that the most vulnerable IP group is TANet. Debian’s weak keys disappeared in IPv4 HTTPS, and the number of factorable keys are decreasing from first revealed 0.5% to 0.09% on Dec. 14th, 2015 and 0.075% on Apr. 18th, 2016.
An automatic and modularized testbed is constructed, which integrates the sate-of-the-art tools and schedules the test cases with various time complexities. With the help of the testbed, the survey can be replicated and the testbed can be extended for up-to-date vulnerabilities.