تخط وانتقل إلى المحتوى الرئيسي

اختبار أمان الأرقام العشوائية لتطبيق OneKey

آخر تحديث كان منذ أكثر من 2 أسبوع

يقدم هذا المقال تقرير اختبار أمان حول عشوائية توليد العبارات الدليلية في تطبيق OneKey (محفظة برمجية)، والذي يشمل جميع أنظمة التشغيل المدعومة بواسطة تطبيق OneKey (macOS، Windows، Android، iOS) وعملائها المعنيين (سطح المكتب والإضافات).

Conclusion

على المنصات المستندة إلى Chrome (Windows، macOS)، يتم استخدام واجهة برمجة تطبيقات الأرقام العشوائية الزائفة الآمنة crypto.getRandomValues المقدمة من Chrome لتوليد أرقام عشوائية زائفة قوية التشفير.

  • على منصات Android و iOS المستندة إلى React Native، يتم استدعاء واجهات الأرقام العشوائية الآمنة التي يوفرها النظام SecureRandom و SecRandomCopyBytes على التوالي.

  • On React Native-based Android and iOS platforms, the system-provided secure random interfacesSecureRandomandSecRandomCopyBytesare respectively called.

NIST SP 800-22 FIPS 140-2

NIST SP 800-22 (منشور المعهد الوطني للمعايير والتكنولوجيا الخاص 800-22) هو وثيقة نشرها المعهد الوطني للمعايير والتكنولوجيا (NIST) في الولايات المتحدة، والتي تتضمن في المقام الأول مجموعة اختبارات إحصائية لاختبار مولدات الأرقام العشوائية الزائفة (PRNG). توفر هذه المجموعة مجموعة من الاختبارات الإحصائية لتقييم عشوائية وجودة تسلسلات البت التي تولدها مولدات الأرقام العشوائية.

Security Testing

برنامج الاختبار: NIST SP 800-22 Statistical Test Suite (مجموعة الاختبارات الإحصائية)

NIST SP 800-22 FIPS 140-2

بيئة الاختبار: macOS 14.5

  • معايير الاختبار:

  • المعايير

  • 1024000

1 (جميع الاختبارات الـ 15)

اختبار تكرار الكتلة - طول الكتلة (M)

20480

اختبار القالب غير المتداخل - طول الكتلة (m)

10

اختبار القالب المتداخل - طول الكتلة (m)

10

اختبار حجم المعلومات التقريبي - طول الكتلة (m)

10

اختبار المسلسل - طول الكتلة (m)

16

اختبار التعقيد الخطي - طول الكتلة (M)

5000

تدفقات البت

20 (20 * 1024000 بت = 20480000 بت = 20 ميجابايت)

Windows

النظام: Win10 22H2؛ الأجهزة: i7-13700h

عميل سطح المكتب

Block Frequency Test - block length(M)

عميل Windows لسطح المكتب لتطبيق OneKey هو تطبيق Electron يعتمد على محرك Chrome. باستخدام أدوات المطور، يتم استدعاء واجهة برمجة التطبيقات لتوليد إنتروبيا العبارة الدليلية crypto.getRandomValues في وقت التشغيل لأخذ عينات من الأرقام العشوائية، بإجمالي 20 ميجابايت. أسفر الاختبار وفقًا للمعايير المحددة عن "تقرير اختبار" (انظر المرفق أدناه)، حيث مرت جميع العناصر، وتم استيفاء متطلبات الأمان.

النتائج: NIST SP 800-22-windows-desktop-wini713.txt (متوفر في المرفق)

إضافة المتصفح

NonOverlapping Template Test - block length(m)

تعتمد إضافة Chrome على محرك Chrome. باستخدام أدوات المطور، يتم استدعاء واجهة برمجة التطبيقات لتوليد إنتروبيا العبارة الدليلية crypto.getRandomValues في وقت التشغيل لأخذ عينات من الأرقام العشوائية، بإجمالي 20 ميجابايت. أسفر الاختبار وفقًا للمعايير المحددة عن "تقرير اختبار" (انظر المرفق أدناه)، حيث مرت جميع العناصر، وتم استيفاء متطلبات الأمان.

النتائج: NIST SP 800-22-windows-ext-wini713.txt (متوفر في المرفق)

macOS

النظام: Sonoma 14.6؛ الأجهزة: MacBook Pro 2020 13 بوصة M1

Overlapping Template Test - block length(m)

عميل سطح المكتب

عميل macOS لسطح المكتب لتطبيق OneKey هو تطبيق Electron يعتمد على محرك Chrome. باستخدام أدوات المطور، يتم استدعاء واجهة برمجة التطبيقات لتوليد إنتروبيا العبارة الدليلية crypto.getRandomValues في وقت التشغيل لأخذ عينات من الأرقام العشوائية، بإجمالي 20 ميجابايت. أسفر الاختبار وفقًا للمعايير المحددة عن "تقرير اختبار" (انظر المرفق أدناه)، حيث مرت جميع العناصر، وتم استيفاء متطلبات الأمان.

النتائج: NIST SP 800-22-macOS-desktop-macm1p.txt (متوفر في المرفق)

Approximate Entropy Test - block length(m)

إضافة المتصفح

تعتمد إضافة Chrome على محرك Chrome. باستخدام أدوات المطور، يتم استدعاء واجهة برمجة التطبيقات لتوليد إنتروبيا العبارة الدليلية crypto.getRandomValues في وقت التشغيل لأخذ عينات من الأرقام العشوائية، بإجمالي 20 ميجابايت. أسفر الاختبار وفقًا للمعايير المحددة عن "تقرير اختبار" (انظر المرفق أدناه)، حيث مرت جميع العناصر، وتم استيفاء متطلبات الأمان.

النتائج: NIST SP 800-22-macOS-ext-macm1p.txt (متوفر في المرفق)

Android

النظام hyperOS 1.0.4.0؛ الأجهزة Xiaomi 10s snapdragon870

عميل Android

عميل Android لتطبيق OneKey، بكونه تطبيق React Native، يعتمد على واجهات برمجة التطبيقات الأصلية. على Android، يتم استدعاء واجهة برمجة تطبيقات النظام SecureRandom عند استدعاء crypto.getRandomValues في التطبيق. باستخدام تصحيح JavaScript عن بعد React، يتم استدعاء واجهة برمجة التطبيقات لتوليد إنتروبيا العبارة الدليلية crypto.getRandomValues في وقت التشغيل لأخذ عينات من الأرقام العشوائية، بإجمالي 20 ميجابايت. أسفر الاختبار وفقًا للمعايير المحددة عن "تقرير اختبار" (انظر المرفق أدناه)، حيث مرت جميع العناصر، وتم استيفاء متطلبات الأمان.

Linear Complexity Test - block length(M)

النتائج: NIST SP 800-22-android-app-andsm870.txt (متوفر في المرفق)

iOS

النظام: IOS 17.5؛ الأجهزة: iPhoneX A11

عميل iOS

bitstreams

عميل iOS لتطبيق OneKey، بكونه تطبيق React Native، يعتمد على واجهات برمجة التطبيقات الأصلية. على iOS، يتم استدعاء واجهة برمجة تطبيقات النظام SecRandomCopyBytes عند استدعاء crypto.getRandomValues في التطبيق. باستخدام تصحيح JavaScript عن بعد React، يتم استدعاء واجهة برمجة التطبيقات لتوليد إنتروبيا العبارة الدليلية crypto.getRandomValues في وقت التشغيل لأخذ عينات من الأرقام العشوائية، بإجمالي 20 ميجابايت. أسفر الاختبار وفقًا للمعايير المحددة عن "تقرير اختبار" (انظر المرفق أدناه)، حيث مرت جميع العناصر، وتم استيفاء متطلبات الأمان.

النتائج: NIST SP 800-22-iOS-app-x.txt (متوفر في المرفق)

FIPS 140-2 (منشور معيار معالجة المعلومات الفيدرالية 140-2) هو معيار لأمن الكمبيوتر صادر عن NIST. ويفصل متطلبات الأمان للوحدات التشفيرية، مع التركيز بشكل خاص على أنواع RNG، وقوة الأمان، والبذور، والإنتروبيا، والدورية، والاختبارات الدورية، والاختبارات المستمرة.

Windows

برنامج الاختبار: rng-tools

  • معايير الاختبار: لا شيء

  • قم بتثبيت gcc و automake بشكل صحيح

macOS

قم بتشغيل make لتصنيف الملفات rngd و rngtest

  • قم بتشغيل ./rngtest < testfile.bin

  • Browser Extension

    • The Chrome extension relies on the Chrome engine. Using developer tools, the mnemonic entropy generation APIcrypto.getRandomValuesis called at runtime to sample random numbers, totaling 20MB. Testing according to the defined parameters yielded a "Test Report" (see attachment below), where all items passed, meeting security requirements.

    • Results: NIST SP 800-22-macOS-ext-macm1p.txt (Available in the attachment)

تعتمد إضافة Chrome على محرك Chrome. باستخدام أدوات المطور، يتم استدعاء واجهة برمجة التطبيقات لتوليد إنتروبيا العبارة الدليلية crypto.getRandomValues في وقت التشغيل لأخذ عينات من الأرقام العشوائية، بإجمالي 20 ميجابايت. تم تحويل الملف النصي إلى ملف ثنائي، ويظهر "تقرير الاختبار" أدناه اختبار 1024 جولة مع فشل جولة واحدة من التشغيلات، ولكن مرت جميع العناصر بشكل عام، مع استيفاء متطلبات الأمان.

macOS

  • Android Client

    • The Android client for OneKey App, being a React Native application, relies on native APIs. On Android, the system APISecureRandomis invoked whencrypto.getRandomValuesis called in the application. Using React remote JS debug, the mnemonic entropy generation APIcrypto.getRandomValuesis called at runtime to sample random numbers, totaling 20MB. Testing according to the defined parameters yielded a "Test Report" (see attachment below), where all items passed, meeting security requirements.

    • Results: NIST SP 800-22-android-app-andsm870.txt (Available in the attachment)

إضافة المتصفح

System: IOS 17.5; Hardware: iPhoneX A11

  • Android

    • The iOS client for OneKey App, being a React Native application, relies on native APIs. On iOS, the system APISecRandomCopyBytesis invoked whencrypto.getRandomValuesis called in the application. Using React remote JS debug, the mnemonic entropy generation APIcrypto.getRandomValuesis called at runtime to sample random numbers, totaling 20MB. Testing according to the defined parameters yielded a "Test Report" (see attachment below), where all items passed, meeting security requirements.

    • Results: NIST SP 800-22-iOS-app-x.txt (Available in the attachment)

عميل Android لتطبيق OneKey، بكونه تطبيق React Native، يعتمد على واجهات برمجة التطبيقات الأصلية. على Android، يتم استدعاء واجهة برمجة تطبيقات النظام SecureRandom عند استدعاء crypto.getRandomValues في التطبيق. باستخدام تصحيح JavaScript عن بعد React، يتم استدعاء واجهة برمجة التطبيقات لتوليد إنتروبيا العبارة الدليلية crypto.getRandomValues في وقت التشغيل لأخذ عينات من الأرقام العشوائية، بإجمالي 20 ميجابايت. تم تحويل الملف النصي إلى ملف ثنائي، ويظهر "تقرير الاختبار" أدناه ثلاثة جولات من أصل 1024 فشلت في جميع عناصر الاختبار، ولكن مرت جميع العناصر بشكل عام، وتم استيفاء متطلبات الأمان.

  • iOS

  • Testing Parameters: None

  • Testing Environment: ubuntu 24.04 arm64

  • Compilation Process:

    1. Install gcc, automake properly

    2. Execute ./autogen.sh

    3. Execute ./configure (if errors occur, configure dependencies as per the error messages)

    4. Execute make to compile files rngd and rngtest

    5. Execute ./rngtest < testfile.bin

⚠️ Note: Test files must be in binary format as inputs, not ASCII.

Windows

System: Win10 22H2; Hardware: i7-13700h

  • Desktop Client

    • The Windows desktop client for OneKey App is an Electron application that relies on the Chrome engine. Using developer tools, the mnemonic entropy generation APIcrypto.getRandomValuesis called at runtime to sample random numbers, totaling 20MB. The text file was converted to a binary file, and "Test Report" below shows all items pass, meeting security requirements.

      app-v5-randomness-fips-140-2-windows-desktop.png
  • Browser Extension

    • The Chrome extension relies on the Chrome engine. Using developer tools, the mnemonic entropy generation APIcrypto.getRandomValuesis called at runtime to sample random numbers, totaling 20MB. The text file was converted to a binary file, and "Test Report" below shows 1024 rounds tested with one round of Runs failing, but all items passed overall, meeting security requirements.

      app-v5-randomness-fips-140-2-windows-ext.png

macOS

System: Sonoma 14.6; Hardware: MacBook Pro 2020 13-inch M1

  • Desktop Client

    • The macOS desktop client for OneKey App is an Electron application that relies on the Chrome engine. Using developer tools, the mnemonic entropy generation APIcrypto.getRandomValuesis called at runtime to sample random numbers, totaling 20MB. The text file was converted to a binary file, and "Test Report" below shows all items pass, meeting security requirements.

      app-v5-randomness-fips-140-2-mac-desktop.png
  • Browser Extension

    • The Chrome extension relies on the Chrome engine. Using developer tools, the mnemonic entropy generation APIcrypto.getRandomValuesis called at runtime to sample random numbers, totaling 20MB. The text file was converted to a binary file, and "Test Report" below shows all items pass, meeting security requirements.

      app-v5-randomness-fips-140-2-mac-ext.png

Android

System: hyperOS 1.0.4.0;Hardware: Xiaomi 10s snapdragon870

  • Android Client

    • The Android client for OneKey App, being a React Native application, relies on native APIs. On Android, the system API SecureRandom is invoked when crypto.getRandomValuesis called in the application. Using React remote JS debug, the mnemonic entropy generation APIcrypto.getRandomValuesis called at runtime to sample random numbers, totaling 20MB. The text file was converted to a binary file, and "Test Report" below shows three rounds out of 1024 that failed all test items, but all items passed overall, meeting security requirements.

      app-v5-randomness-fips-140-2-android.png

    ⚠️ Note: The Android client had three test rounds out of 1024 where all test items failed. This issue might be a bug in the rng-test tool and does not affect the overall conclusion of the test.

iOS

System iOS 17.5;Hardware: iPhoneX A11

  • iOS Client

    • The iOS client for OneKey App, being a React Native application, relies on native APIs. On iOS, the system APISecRandomCopyBytesis invoked whencrypto.getRandomValuesis called in the application. Using React remote JS debug, the mnemonic entropy generation APIcrypto.getRandomValuesis called at runtime to sample random numbers, totaling 20MB. The text file was converted to a binary file, and "Test Report" below shows one failed test in Long run out of 1024 rounds, but all items passed overall, meeting security requirements.

      app-v5-randomness-fips-140-2-ios.png

Results Attachments


هل أجاب هذا عن سؤالك؟