Ir al contenido principal

Generación y evaluación de aleatoriedad para OneKey Pro

Actualizado hace más de 2 semanas

Requisitos del Entorno del Sistema: Java Runtime (Opcional: JDK)

Generating TRNG from the Device

Entrar en modo Bootloader.

  1. Haga clic en "View Details".

  2. Haga clic en "Build ID" repetidamente hasta que aparezca la pantalla de confirmación, luego haga clic en "OK" para continuar.

  3. Espere a que el proceso se complete.

  4. Haga clic en cualquier lugar para regresar a la página principal.

  5. Reinicie el dispositivo y vuelva a entrar en modo Bootloader.

  6. Los datos aleatorios generados se pueden encontrar en la carpeta "TRNG_Test_Data" dentro de la unidad "ONEKEY DATA".

  7. CC EAL6+ para Pruebas de Números Aleatorios

BSI AIS 20-31 Testing

El software de prueba original está en alemán, que hemos traducido al inglés. (Ver archivos adjuntos).

  • Download the test suite from: BSI Website

  • The original testing software is in German, which we have translated into English. (See attachments.)

cd AIS_31_testsuit_English

  1. Compile el evaluador:javac Evaluator.java

  2. Compile the evaluator:

    • javac Evaluator.java

java -classpath AIS_31_testsuit_English/ Evaluator

pro-trng-evaluation.png
  • Run the testing software with the following command:

    • java -classpath AIS_31_testsuit_English/ Evaluator

  • Enter the absolute path of the data to be tested

    • For example: Data/TRNG_Test_Data_EXAMPLE/batch_2.bin

  • Configure as follows:

    • Output: Detailed

    • Resultados

    • P0

    • P1 (TL;DR)

PRUEBA INICIADA.[17:26:25] SUITE DE PRUEBAS: P1/T1-T5[17:26:25] NOMBRE DE ARCHIVO: Data/TRNG_Test_Data_EXAMPLE/batch_1.bin_rest[17:26:25] DETALLES DE SALIDA: Activados.[17:26:25] FORMATO DE DATOS: 1 byte de archivo contiene 8 bits aleatorios.[17:26:25] TIPO DE PRUEBA: Prueba normal.[17:26:25] ANCHO DE BITS RND: 8 bits.[17:26:25] Archivo en lectura.[17:26:25] Copiando archivo BitStream a RAM[17:26:26] Convirtiendo datos del archivo a ByteStream[17:26:26] Escribiendo archivo restante: Data/TRNG_Test_Data_EXAMPLE/batch_1.bin_rest_rest[17:26:42] 5220000 elementos copiados a RAM.[17:26:42] Archivo leído.[17:26:42] Iniciando prueba T1 (prueba de monobits); Criterio P1.i(ii)[17:26:42] Número de unos: 9931[17:26:42] Rango admisible: [9655; 10345][17:26:42] Prueba T1 superada.[17:26:42] Iniciando prueba T2 (prueba de póker); Criterio P1.i(ii)[17:26:42] Tamaño de prueba = 16.857600000000275[17:26:42] Prueba T2 superada.[17:26:42] Iniciando prueba T3 (prueba de series); Criterio P1.i(ii)[17:26:42] Series de 0-Runs[1] = 2477; Intervalo admisible: [2267; 2733][17:26:42] Series de 1-Runs[1] = 2486; Intervalo admisible: [2267; 2733][17:26:42] Series de 0-Runs[2] = 1266; Intervalo admisible: [1079; 1421][17:26:42] Series de 1-Runs[2] = 1266; Intervalo admisible: [1079; 1421][17:26:42] Series de 0-Runs[3] = 611; Intervalo admisible: [502; 748][17:26:42] Series de 1-Runs[3] = 631; Intervalo admisible: [502; 748][17:26:42] Series de 0-Runs[4] = 301; Intervalo admisible: [223; 402][17:26:42] Series de 1-Runs[4] = 296; Intervalo admisible: [223; 402][17:26:42] Series de 0-Runs[5] = 148; Intervalo admisible: [90; 223][17:26:42] Series de 1-Runs[5] = 165; Intervalo admisible: [90; 223][17:26:42] Series de 0-Runs[6] = 182; Intervalo admisible: [90; 223][17:26:42] Series de 1-Runs[6] = 141; Intervalo admisible: [90; 223][17:26:42] Prueba T3 superada.[17:26:42] Iniciando prueba T4 (prueba de series largas); Criterio P1.i(ii)[17:26:42] Prueba T4 superada.[17:26:42] Iniciando prueba T5 (prueba de autocorrelación); Criterio P1.i(ii)[17:26:42] Desviación máxima de Z_tau de 2500: 132[17:26:42] Ocurrió para desplazamientos: [17:26:42] Desplazamiento: 1307[17:26:42] Volver a ejecutar la prueba de autocorrelación con Desplazamiento: 1307 en bits 10.000 a 14.999[17:26:42] Z_1307 = 2507[17:26:42] Prueba T5 superada.[17:26:42] Ejecución completada con éxito, archivo restante seleccionado para prueba.

Each test will have a clear conclusion. The report will mention "Test xx passed."

Sitio web oficial (código fuente y binarios): Dieharder Official Site

Instalación

P1 (TL;DR)

En Ubuntu, Dieharder se puede instalar directamente desde los repositorios oficiales:

P2

sudo apt install dieharder

Dieharder (Linux Only)

Evaluación

Homepage (Source and Binaries): Dieharder Official Site

Para evaluar los datos de su generador de números aleatorios, utilice el siguiente comando:

  • dieharder -a -f Data/TRNG_Test_Data_EXAMPLE/batch_2.bin -p 10000 -k 2

  • #=============================================================================## dieharder version 3.31.1 Copyright 2003 Robert G. Brown ##=============================================================================# rng_name | filename |rands/second| mt19937|Data/TRNG_Test_Data_EXAMPLE/batch_2.bin| 3.02e+08 |#=============================================================================# test_name |ntup| tsamples |psamples| p-value |Assessment#=============================================================================# diehard_birthdays| 0| 100| 100|0.10212980| PASSED diehard_operm5| 0| 1000000| 100|0.43350080| PASSED diehard_rank_32x32| 0| 40000| 100|0.18356279| PASSED diehard_rank_6x8| 0| 100000| 100|0.26738553| PASSED diehard_bitstream| 0| 2097152| 100|0.50366652| PASSED diehard_opso| 0| 2097152| 100|0.29301752| PASSED diehard_oqso| 0| 2097152| 100|0.51848348| PASSED diehard_dna| 0| 2097152| 100|0.11079065| PASSED diehard_count_1s_str| 0| 256000| 100|0.75364018| PASSED diehard_count_1s_byt| 0| 256000| 100|0.84484993| PASSED diehard_parking_lot| 0| 12000| 100|0.59549008| PASSED diehard_2dsphere| 2| 8000| 100|0.79405887| PASSED diehard_3dsphere| 3| 4000| 100|0.15636471| PASSED diehard_squeeze| 0| 100000| 100|0.07344321| PASSED diehard_sums| 0| 100| 100|0.04236979| PASSED diehard_runs| 0| 100000| 100|0.29853092| PASSED diehard_runs| 0| 100000| 100|0.94361604| PASSED diehard_craps| 0| 200000| 100|0.97112172| PASSED diehard_craps| 0| 200000| 100|0.81518652| PASSED marsaglia_tsang_gcd| 0| 10000000| 100|0.96914597| PASSED marsaglia_tsang_gcd| 0| 10000000| 100|0.66252771| PASSED sts_monobit| 1| 100000| 100|0.25335770| PASSED sts_runs| 2| 100000| 100|0.76610634| PASSED sts_serial| 1| 100000| 100|0.99906599| WEAK sts_serial| 2| 100000| 100|0.84267868| PASSED sts_serial| 3| 100000| 100|0.56502434| PASSED sts_serial| 3| 100000| 100|0.29549437| PASSED sts_serial| 4| 100000| 100|0.15277658| PASSED sts_serial| 4| 100000| 100|0.78789431| PASSED sts_serial| 5| 100000| 100|0.54153910| PASSED sts_serial| 5| 100000| 100|0.95656480| PASSED sts_serial| 6| 100000| 100|0.67941344| PASSED sts_serial| 6| 100000| 100|0.02222963| PASSED sts_serial| 7| 100000| 100|0.93378063| PASSED sts_serial| 7| 100000| 100|0.51126121| PASSED sts_serial| 8| 100000| 100|0.99301136| PASSED sts_serial| 8| 100000| 100|0.94658377| PASSED sts_serial| 9| 100000| 100|0.77767419| PASSED sts_serial| 9| 100000| 100|0.68542670| PASSED sts_serial| 10| 100000| 100|0.30778639| PASSED sts_serial| 10| 100000| 100|0.41977953| PASSED sts_serial| 11| 100000| 100|0.02684849| PASSED sts_serial| 11| 100000| 100|0.36026188| PASSED sts_serial| 12| 100000| 100|0.91429978| PASSED sts_serial| 12| 100000| 100|0.11223234| PASSED sts_serial| 13| 100000| 100|0.85751671| PASSED sts_serial| 13| 100000| 100|0.67034430| PASSED sts_serial| 14| 100000| 100|0.94937608| PASSED sts_serial| 14| 100000| 100|0.74004649| PASSED sts_serial| 15| 100000| 100|0.70378039| PASSED sts_serial| 15| 100000| 100|0.23488205| PASSED sts_serial| 16| 100000| 100|0.43514053| PASSED sts_serial| 16| 100000| 100|0.72498715| PASSED rgb_bitdist| 1| 100000| 100|0.62493231| PASSED rgb_bitdist| 2| 100000| 100|0.27977952| PASSED rgb_bitdist| 3| 100000| 100|0.14363718| PASSED rgb_bitdist| 4| 100000| 100|0.33965132| PASSED rgb_bitdist| 5| 100000| 100|0.75987567| PASSED rgb_bitdist| 6| 100000| 100|0.26392475| PASSED rgb_bitdist| 7| 100000| 100|0.21486496| PASSED rgb_bitdist| 8| 100000| 100|0.42792654| PASSED rgb_bitdist| 9| 100000| 100|0.97964771| PASSED rgb_bitdist| 10| 100000| 100|0.83424911| PASSED rgb_bitdist| 11| 100000| 100|0.01916156| PASSED rgb_bitdist| 12| 100000| 100|0.73187911| PASSED rgb_minimum_distance| 2| 10000| 1000|0.26866265| PASSED rgb_minimum_distance| 3| 10000| 1000|0.05398963| PASSED rgb_minimum_distance| 4| 10000| 1000|0.67617596| PASSED rgb_minimum_distance| 5| 10000| 1000|0.92449868| PASSED rgb_permutations| 2| 100000| 100|0.13542408| PASSED rgb_permutations| 3| 100000| 100|0.97409413| PASSED rgb_permutations| 4| 100000| 100|0.38750909| PASSED rgb_permutations| 5| 100000| 100|0.89404505| PASSED rgb_lagged_sum| 0| 1000000| 100|0.10501506| PASSED rgb_lagged_sum| 1| 1000000| 100|0.44416101| PASSED rgb_lagged_sum| 2| 1000000| 100|0.82801028| PASSED rgb_lagged_sum| 3| 1000000| 100|0.74798672| PASSED rgb_lagged_sum| 4| 1000000| 100|0.21233273| PASSED rgb_lagged_sum| 5| 1000000| 100|0.86174207| PASSED rgb_lagged_sum| 6| 1000000| 100|0.05065469| PASSED rgb_lagged_sum| 7| 1000000| 100|0.00778678| PASSED rgb_lagged_sum| 8| 1000000| 100|0.57018734| PASSED rgb_lagged_sum| 9| 1000000| 100|0.36740461| PASSED rgb_lagged_sum| 10| 1000000| 100|0.06184514| PASSED rgb_lagged_sum| 11| 1000000| 100|0.51783867| PASSED rgb_lagged_sum| 12| 1000000| 100|0.57474017| PASSED rgb_lagged_sum| 13| 1000000| 100|0.60681229| PASSED rgb_lagged_sum| 14| 1000000| 100|0.95652310| PASSED rgb_lagged_sum| 15| 1000000| 100|0.72221499| PASSED rgb_lagged_sum| 16| 1000000| 100|0.13168642| PASSED rgb_lagged_sum| 17| 1000000| 100|0.31100779| PASSED rgb_lagged_sum| 18| 1000000| 100|0.60154425| PASSED rgb_lagged_sum| 19| 1000000| 100|0.71959521| PASSED rgb_lagged_sum| 20| 1000000| 100|0.26005749| PASSED rgb_lagged_sum| 21| 1000000| 100|0.63006056| PASSED rgb_lagged_sum| 22| 1000000| 100|0.42985597| PASSED rgb_lagged_sum| 23| 1000000| 100|0.64170832| PASSED rgb_lagged_sum| 24| 1000000| 100|0.67583741| PASSED rgb_lagged_sum| 25| 1000000| 100|0.09133906| PASSED rgb_lagged_sum| 26| 1000000| 100|0.85510913| PASSED rgb_lagged_sum| 27| 1000000| 100|0.79743340| PASSED rgb_lagged_sum| 28| 1000000| 100|0.75564162| PASSED rgb_lagged_sum| 29| 1000000| 100|0.20620996| PASSED rgb_lagged_sum| 30| 1000000| 100|0.22741111| PASSED rgb_lagged_sum| 31| 1000000| 100|0.20847532| PASSED rgb_lagged_sum| 32| 1000000| 100|0.32156204| PASSED rgb_kstest_test| 0| 10000| 1000|0.10484097| PASSED dab_bytedistrib| 0| 51200000| 1|0.74332305| PASSED dab_dct| 256| 50000| 1|0.32411120| PASSED Preparando para ejecutar la prueba 207. ntuple = 0 dab_filltree| 32| 15000000| 1|0.46943262| PASSED dab_filltree| 32| 15000000| 1|0.10082205| PASSED Preparando para ejecutar la prueba 208. ntuple = 0 dab_filltree2| 0| 5000000| 1|0.59124233| PASSED dab_filltree2| 1| 5000000| 1|0.86619677| PASSED Preparando para ejecutar la prueba 209. ntuple = 0 dab_monobit2| 12| 65000000| 1|0.59267579| PASSED dieharder -a -f Data/TRNG_Test_Data_EXAMPLE/batch_2.bin -p 10000 -k 2 401.62s de usuario 0.02s de sistema 99% cpu 6:41.65 total

Evaluation

  • To evaluate your random number generator data, use the following command:

    • dieharder -a -f Data/TRNG_Test_Data_EXAMPLE/batch_2.bin -p 10000 -k 2

2018-36-ST_Lite.pdf

Dieharder outputs clear test results. A "PASS" indicates the data meets the criteria, while a small number of "WEAK" results can generally be ignored due to the inherent margin of error in testing methods.

Check Result

Requisitos de Criptografía de la Alianza FIDO

Additional Documentation

CC EAL Certificates and Reports

References

¿Ha quedado contestada tu pregunta?