Заметка о пользе оптимизации John

Discussion in 'Криптография, расшифровка хешей' started by ShadOS, 10 Apr 2009.

  1. ShadOS

    ShadOS ы

    Joined:
    11 Feb 2007
    Messages:
    667
    Likes Received:
    351
    Reputations:
    413
    Ещё раз хотелось бы напомнить о пользе сборки брутфорсеров из исходников. Проведем эксперимент со старым добрым джонни риппером (http://www.openwall.com/john/).
    Тестовая платформа - ноутбук с Ubuntu 8.04 на AMD x64x2.
    Пакет из репозитория после apt-get:
    Code:
    john --test
    Benchmarking: Standard DES [64/64 BS]... DONE
    Many salts:	534979 c/s real, 535662 c/s virtual
    Only one salt:	502906 c/s real, 502906 c/s virtual
    
    Benchmarking: BSDI DES (x725) [64/64 BS]... DONE
    Many salts:	18822 c/s real, 18822 c/s virtual
    Only one salt:	18609 c/s real, 18609 c/s virtual
    
    Benchmarking: FreeBSD MD5 [32/64]... DONE
    Raw:	4184 c/s real, 4184 c/s virtual
    
    Benchmarking: OpenBSD Blowfish (x32) [32/64]... DONE
    Raw:	282 c/s real, 282 c/s virtual
    
    Benchmarking: Kerberos AFS DES [48/64 4K]... DONE
    Short:	243259 c/s real, 243259 c/s virtual
    Long:	662566 c/s real, 663615 c/s virtual
    
    Benchmarking: NT LM DES [48/64 4K]... DONE
    Raw:	2301392 c/s real, 2298240 c/s virtual
    
    Качаем исходники, распаковываем, правим ./Makefile. В нем нам необходимо поставить ключ оптимизации -O3 вместо -O2.
    Затем собираем под нашу платформу:
    make linux-x86-64
    Проверяем:
    Code:
    ./john --test
    Benchmarking: Traditional DES [128/128 BS SSE2-16]... DONE
    Many salts:	720844 c/s real, 722289 c/s virtual
    Only one salt:	679884 c/s real, 678527 c/s virtual
    
    Benchmarking: BSDI DES (x725) [128/128 BS SSE2-16]... DONE
    Many salts:	25548 c/s real, 25548 c/s virtual
    Only one salt:	25089 c/s real, 25139 c/s virtual
    
    Benchmarking: FreeBSD MD5 [32/64 X2]... DONE
    Raw:	7143 c/s real, 7128 c/s virtual
    
    Benchmarking: OpenBSD Blowfish (x32) [32/64 X2]... DONE
    Raw:	450 c/s real, 451 c/s virtual
    
    Benchmarking: Kerberos AFS DES [48/64 4K]... DONE
    Short:	236032 c/s real, 236979 c/s virtual
    Long:	682598 c/s real, 692290 c/s virtual
    
    Benchmarking: LM DES [128/128 BS SSE2-16]... DONE
    Raw:	5237K c/s real, 5247K c/s virtual
    
    Как видим, результат налицо. Однако, справедливости ради отмечу что в репозитории убунты последняя версия 1.6, я же собирал 1.7.3.

    Вывод: если вам нужна производительность и скорость - не поленитесь собрать из исходников требуемую вам программу. Ничего сложного в этом нет ;)
     
    3 people like this.
  2. ShadOS

    ShadOS ы

    Joined:
    11 Feb 2007
    Messages:
    667
    Likes Received:
    351
    Reputations:
    413
    А вот данные для четырехядерного Intel Core 2 Quad:
    Code:
    processor	: 0
    vendor_id	: GenuineIntel
    cpu family	: 6
    model		: 23
    model name	: Intel(R) Core(TM)2 Quad CPU    Q9400  @ 2.66GHz
    stepping	: 10
    cpu MHz		: 2666.360
    cache size	: 3072 KB
    physical id	: 0
    siblings	: 4
    core id		: 0
    cpu cores	: 4
    apicid		: 0
    initial apicid	: 0
    fpu		: yes
    fpu_exception	: yes
    cpuid level	: 13
    wp		: yes
    flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl pni monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr sse4_1 lahf_lm
    bogomips	: 5332.72
    clflush size	: 64
    cache_alignment	: 64
    address sizes	: 36 bits physical, 48 bits virtual
    power management:
    
    Неоптимизированный джон из состава Ubuntu 8.10 x86-64, версия джона 1.7.2:
    Code:
    john --test
    Benchmarking: Traditional DES [64/64 BS]... DONE
    Many salts:	1237K c/s real, 1239K c/s virtual
    Only one salt:	1133K c/s real, 1135K c/s virtual
    
    Benchmarking: BSDI DES (x725) [64/64 BS]... DONE
    Many salts:	37069 c/s real, 37174 c/s virtual
    Only one salt:	36705 c/s real, 36705 c/s virtual
    
    Benchmarking: FreeBSD MD5 [32/64 X2]... DONE
    Raw:	11397 c/s real, 11397 c/s virtual
    
    Benchmarking: OpenBSD Blowfish (x32) [32/64]... DONE
    Raw:	396 c/s real, 396 c/s virtual
    
    Benchmarking: Kerberos AFS DES [48/64 4K]... DONE
    Short:	380561 c/s real, 380561 c/s virtual
    Long:	1205K c/s real, 1205K c/s virtual
    
    Benchmarking: NT LM DES [64/64 BS]... DONE
    Raw:	11001K c/s real, 11001K c/s virtual
    
    Benchmarking: NT MD4 [Generic 1x]... DONE
    Raw:	10568K c/s real, 10568K c/s virtual
    
    Benchmarking: M$ Cache Hash [Generic 1x]... DONE
    Many salts:	15013K c/s real, 14996K c/s virtual
    Only one salt:	5991K c/s real, 5991K c/s virtual
    
    Benchmarking: LM C/R DES [netlm]... DONE
    Many salts:	465516 c/s real, 465516 c/s virtual
    Only one salt:	454913 c/s real, 455407 c/s virtual
    
    Benchmarking: NTLMv1 C/R MD4 DES [netntlm]... DONE
    Many salts:	666820 c/s real, 665762 c/s virtual
    Only one salt:	640351 c/s real, 639375 c/s virtual
    
    Собственно, оптимизированный джон 1.7.3.1:
    Code:
    ./john --test
    Benchmarking: Traditional DES [128/128 BS SSE2-16]... DONE
    Many salts:	2545K c/s real, 2550K c/s virtual
    Only one salt:	2170K c/s real, 2170K c/s virtual
    
    Benchmarking: BSDI DES (x725) [128/128 BS SSE2-16]... DONE
    Many salts:	82918 c/s real, 82918 c/s virtual
    Only one salt:	80716 c/s real, 80716 c/s virtual
    
    Benchmarking: FreeBSD MD5 [32/64 X2]... DONE
    Raw:	11430 c/s real, 11430 c/s virtual
    
    Benchmarking: OpenBSD Blowfish (x32) [32/64 X2]... DONE
    Raw:	689 c/s real, 691 c/s virtual
    
    Benchmarking: Kerberos AFS DES [48/64 4K]... DONE
    Short:	380620 c/s real, 379861 c/s virtual
    Long:	1205K c/s real, 1205K c/s virtual
    
    Benchmarking: LM DES [128/128 BS SSE2-16]... DONE
    Raw:	13414K c/s real, 13414K c/s virtual
    
    Результат уже лучше. Предлагаю здесь делиться результатами.
     
    #2 ShadOS, 11 Apr 2009
    Last edited: 11 Apr 2009
  3. ShadOS

    ShadOS ы

    Joined:
    11 Feb 2007
    Messages:
    667
    Likes Received:
    351
    Reputations:
    413
    Та же самая система, но джон с патчем MPI:
    Code:
    Benchmarking: Traditional DES [64/64 BS]... DONE
    Many salts:	1239K c/s real, 1240K c/s virtual
    Only one salt:	1139K c/s real, 1138K c/s virtual
    
    Benchmarking: BSDI DES (x725) [64/64 BS]... DONE
    Many salts:	37174 c/s real, 37174 c/s virtual
    Only one salt:	36808 c/s real, 36860 c/s virtual
    
    Benchmarking: FreeBSD MD5 [32/64 X2]... DONE
    Raw:	11417 c/s real, 11397 c/s virtual
    
    Benchmarking: OpenBSD Blowfish (x32) [32/64]... DONE
    Raw:	397 c/s real, 396 c/s virtual
    
    Benchmarking: Kerberos AFS DES [48/64 4K]... DONE
    Short:	380561 c/s real, 380561 c/s virtual
    Long:	1206K c/s real, 1206K c/s virtual
    
    Benchmarking: NT LM DES [64/64 BS]... DONE
    Raw:	11001K c/s real, 10983K c/s virtual
    
    Benchmarking: NT MD4 [Generic 1x]... DONE
    Raw:	10669K c/s real, 10669K c/s virtual
    
    Benchmarking: M$ Cache Hash [Generic 1x]... DONE
    Many salts:	15013K c/s real, 15029K c/s virtual
    Only one salt:	6002K c/s real, 6002K c/s virtual
    
    Benchmarking: LM C/R DES [netlm]... DONE
    Many salts:	465516 c/s real, 465000 c/s virtual
    Only one salt:	455407 c/s real, 455902 c/s virtual
    
    Benchmarking: NTLMv1 C/R MD4 DES [netntlm]... DONE
    Many salts:	666820 c/s real, 666820 c/s virtual
    Only one salt:	641330 c/s real, 641330 c/s virtual
    
    
    Я удивлен.
     
  4. [underwater]

    [underwater] Member

    Joined:
    29 Mar 2009
    Messages:
    78
    Likes Received:
    92
    Reputations:
    27
    Мои старые результаты
    Linux 2.6.7

    Win2000 SP4

    Теперь новые проверял на пентиуме 4, использовал оптимизированные сборки Starteam( В конце темы линки на них)


    Тест 1

    Тест 2
    Тест 3
    Мой john

    =======================================

    Ну вот час назад на ноутбук поставил Fedora и протестил джона:
    Code:
    ./john --test
    Benchmarking: Traditional DES [24/32 4K]... DONE
    Many salts:	125056 c/s real, 125056 c/s virtual
    Only one salt:	117504 c/s real, 117504 c/s virtual
    
    Benchmarking: BSDI DES (x725) [24/32 4K]... DONE
    Many salts:	4032 c/s real, 4032 c/s virtual
    Only one salt:	3976 c/s real, 3976 c/s virtual
    
    Benchmarking: FreeBSD MD5 [32/32]... DONE
    Raw:	3022 c/s real, 3022 c/s virtual
    
    Benchmarking: OpenBSD Blowfish (x32) [32/32]... DONE
    Raw:	203 c/s real, 203 c/s virtual
    
    Benchmarking: Kerberos AFS DES [24/32 4K]... DONE
    Short:	115456 c/s real, 115456 c/s virtual
    Long:	332032 c/s real, 332032 c/s virtual
    
    Benchmarking: LM DES [32/32 BS]... DONE
    Raw:	1993K c/s real, 2098K c/s virtual
    
    Benchmarking: NT MD4 [32/32]... DONE
    Raw:	3981K c/s real, 3981K c/s virtual
    
    Benchmarking: Mac OS X 10.4+ salted SHA-1 [32/32]... DONE
    Many salts:	1279K c/s real, 1279K c/s virtual
    Only one salt:	1108K c/s real, 1108K c/s virtual
    
    Benchmarking: M$ Cache Hash [Generic 1x]... DONE
    Many salts:	6053K c/s real, 5993K c/s virtual
    Only one salt:	2300K c/s real, 2323K c/s virtual
    
    Benchmarking: Apache MD5 [32/32]... DONE
    Raw:	2972 c/s real, 3032 c/s virtual
    
    Benchmarking: HMAC MD5 [hmac-md5]... DONE
    Raw:	502735 c/s real, 502735 c/s virtual
    
    Benchmarking: Post.Office MD5 [STD]... DONE
    Many salts:	1173K c/s real, 1173K c/s virtual
    Only one salt:	1122K c/s real, 1122K c/s virtual
    
    Benchmarking: Raw MD5 [raw-md5]... DONE
    Raw:	2151K c/s real, 2151K c/s virtual
    
    Benchmarking: IPB2 MD5 [Invision Power Board 2.x salted MD5]... DONE
    Many salts:	1039K c/s real, 1050K c/s virtual
    Only one salt:	608961 c/s real, 621388 c/s virtual
    
    Benchmarking: Raw SHA-1 [raw-sha1]... DONE
    Raw:	1218K c/s real, 1218K c/s virtual
    
    Benchmarking: Kerberos v5 TGT [krb5 3DES (des3-cbc-sha1)]... DONE
    Raw:	17713 c/s real, 17713 c/s virtual
    
    Benchmarking: Netscape LDAP SHA [SHA-1]... DONE
    Raw:	1276K c/s real, 1276K c/s virtual
    
    Benchmarking: Netscape LDAP SSHA [salted SHA-1]... DONE
    Many salts:	1272K c/s real, 1285K c/s virtual
    Only one salt:	1148K c/s real, 1148K c/s virtual
    
    Benchmarking: OpenLDAP SSHA [salted SHA-1]... DONE
    Many salts:	1270K c/s real, 1270K c/s virtual
    Only one salt:	1188K c/s real, 1188K c/s virtual
    
    Benchmarking: Eggdrop [blowfish]... DONE
    Raw:	9164 c/s real, 9164 c/s virtual
    
    Benchmarking: Oracle [oracle]... DONE
    Raw:	295345 c/s real, 295345 c/s virtual
    
    Benchmarking: MYSQL [mysql]... DONE
    Raw:	987699 c/s real, 987699 c/s virtual
    
    Benchmarking: MySQL 4.1 double-SHA-1 [mysql-sha1]... DONE
    Raw:	641496 c/s real, 647975 c/s virtual
    
    Benchmarking: Lotus5 [Lotus v5 Proprietary]... DONE
    Raw:	94520 c/s real, 95474 c/s virtual
    
    Benchmarking: More Secure Internet Password [RSA MD defined by BSAFE 1.x - Lotus v6]... DONE
    Many salts:	60718 c/s real, 60718 c/s virtual
    Only one salt:	36763 c/s real, 36763 c/s virtual
    
    Benchmarking: LM C/R DES [netlm]... DONE
    Many salts:	177255 c/s real, 177255 c/s virtual
    Only one salt:	171348 c/s real, 171348 c/s virtual
    
    Benchmarking: NTLMv1 C/R MD4 DES [netntlm]... DONE
    Many salts:	245431 c/s real, 245431 c/s virtual
    Only one salt:	237913 c/s real, 237913 c/s virtual
    
    Benchmarking: LMv2 C/R MD4 HMAC-MD5 [netlmv2]... DONE
    Many salts:	180776 c/s real, 180776 c/s virtual
    Only one salt:	182050 c/s real, 182050 c/s virtual
    
    Benchmarking: HalfLM C/R DES [nethalflm]... DONE
    Many salts:	436317 c/s real, 436317 c/s virtual
    Only one salt:	432329 c/s real, 432329 c/s virtual
    
    Benchmarking: MS-SQL [ms-sql]... DONE
    Many salts:	1370K c/s real, 1384K c/s virtual
    Only one salt:	1244K c/s real, 1244K c/s virtual
    
    Benchmarking: MS-SQL05 [ms-sql05]... DONE
    Many salts:	1367K c/s real, 1367K c/s virtual
    Only one salt:	1263K c/s real, 1276K c/s virtual
    
    Benchmarking: EPiServer SID Hashes [SHA-1]... DONE
    Many salts:	1333K c/s real, 1347K c/s virtual
    Only one salt:	1237K c/s real, 1237K c/s virtual
    
    Benchmarking: PHPS MD5 [MD5(MD5($pass).$salt)]... DONE
    Many salts:	1632K c/s real, 1632K c/s virtual
    Only one salt:	791927 c/s real, 791927 c/s virtual
    
    Benchmarking: MYSQL_fast [mysql-fast]... DONE
    Raw:	7574K c/s real, 7574K c/s virtual
    
    Benchmarking: PIX MD5 [pix-md5]... DONE
    Raw:	1606K c/s real, 1606K c/s virtual
    
    Benchmarking: SAP CODVN G (PASSCODE) [sapg]... DONE
    Many salts:	397360 c/s real, 401373 c/s virtual
    Only one salt:	373438 c/s real, 373438 c/s virtual
    
    Benchmarking: SAP BCODE [sapb]... DONE
    Many salts:	502915 c/s real, 507994 c/s virtual
    Only one salt:	443354 c/s real, 443354 c/s virtual
    
    Benchmarking: Netscreen MD5 [NS MD5]... DONE
    Raw:	1286K c/s real, 1286K c/s virtual
    
    Benchmarking: HTTP Digest access authentication [HDAA-MD5]... DONE
    Many salts:	473044 c/s real, 487674 c/s virtual
    Only one salt:	496500 c/s real, 501515 c/s virtual
    
    
     
    #4 [underwater], 11 Apr 2009
    Last edited: 18 Apr 2009
    1 person likes this.
  5. ShadOS

    ShadOS ы

    Joined:
    11 Feb 2007
    Messages:
    667
    Likes Received:
    351
    Reputations:
    413
    Приводите cat /proc/cpuinfo для полноты картины
     
  6. Thanat0z

    Thanat0z Негрин

    Joined:
    6 Dec 2006
    Messages:
    645
    Likes Received:
    498
    Reputations:
    311
    А что собственно необычного в теме? Сборка под проц/версию цыгвина и тд и тп ОЧЕНЬ РЕКОМЕНДУЕМАЯ операция
     
Loading...
Similar Threads - Заметка пользе оптимизации
  1. Thanat0z
    Replies:
    21
    Views:
    18,530