����λ�ã���ҳ > ����ѧԺ > SecureRandom©������������⣨CVE-2013-7372��

SecureRandom©������������⣨CVE-2013-7372��

��Դ����������|��ʱ�䣺2015-03-12 16:08:10 |���Ķ���120��|�� ��ǩ�� ©�� Զ�̹��� ���簲ȫ �� |����������

����SecureRandom API�������ļ�λ��$JAVA_HOME/jre/lib/security/java.security���������ǿ������ø��ļ����securerandom.source������ָ��SecureRandom��ʹ�õ�seed����Դ������ʹ���豸��ص�Դ�������������ã�

securerandom.source=file:/dev/urandom securerandom.source=file:/dev/random

����SecureRandom���弼��ϸ�ڣ��ɲο��ĺ�ο�����2��

�����ص㿴��SecureRandomSpi�����࣬�ļ�������3���ó�����ΪSecureRandom�ඨ���˹��ܽӿ�,�������������󷽷�engineSetSeed,engineGenerateSeed,and engineNextBytes�����Service Providerϣ��ʵ�ּ���ǿ�Ƚϸߵ�α��������������ͱ���ʵ��������������

Ȼ��Apache Harmony 6.0M3����֮ǰ�汾��SecureRandomʵ����engineNextBytes�������ڰ�ȫ©����

0��03 Apache Harmony��s SecureRandomʵ��

Apache Harmony ��2005����Apache License������һ����Դ��java���Ŀ⡣��Ȼ2011���Ժ�������ͣ�������������Ŀ��ΪGoogle Android platform��һ���ּ���������ά����

Apache Harmony's SecureRandomʵ���㷨���£�

SecureRandom©¶´¼¼Êõ·ÖÎöÏê½â£¨CVE-2013-7372£©

Android���PRNGʹ��SHA-1��ϣ�㷨���ɲ���ϵͳ�ṩ���豸��ص�����������α������С��������ͨ��������(��seed+counter+ padding)������ϣ��ͼ�������ġ��㷨����ͼ

SecureRandom©¶´¼¼Êõ·ÖÎöÏê½â£¨CVE-2013-7372£©

���м�����counter��0��ʼ���㷨ÿ����һ������һ��counter��padding���ֶ����Գ�Ϊbuffer��Padding����SHA-1������ʽ������8 byte���Ҫhash��ֵ�ij���len��ʣ�µIJ�����һ��1�������0�ĸ�ʽ������䡣��󷵻�Hash��Ľ����Ҳ�������ɵ�α������С�

0��04 Apache Harmony��s SecureRandom©��ϸ��

��ʹ���޲ι��캯������һ��SecureRandomʵ�������������Ҳ��ʹ��setSeed()���г�ʼ��ʱ,����һ����ʼֵ�󣬴��벻����ȷ�ĵ���ƫ����(byte offset,���offset��ָ��state buffer��ָ��)���⵼�±��ø��������Ӻ���ļ�����(8 byte)��padding(��ʼ4 byte)���������ӵ���ʼ12 byte���ص�ʣ��8 byte(20 byte��������δ�����Dz���),ʹ��PRNG����Ӧ����Ч��

С���Ƽ��Ķ�

�������������Ľ�Ϊ������Ϣ����������������ͬ���޹۵��֤ʵ��������

�����Ƶ����

����

ͬ������

����

ɨ��ά�����������ֻ��汾��

ɨ��ά����������΢�Ź��ںţ�

��վ�������������������ϴ��������ַ���İ�Ȩ���뷢�ʼ�[email protected]

��ICP��2022002427��-10 �湫��������43070202000427��© 2013~2025 haote.com ������