openwall / john

John the Ripper jumbo - advanced offline password cracker, which supports hundreds of hash and cipher types, and runs on many operating systems, CPUs, GPUs, and even some FPGAs
https://www.openwall.com/john/
Other
9.98k stars 2.06k forks source link

NEO OpenCL test (as a replacement for Beignet) #4689

Closed frank-dittrich closed 2 months ago

frank-dittrich commented 3 years ago

Since Beignet seems to be deprecated, I tested NEO OpenCL

https://github.com/intel/compute-runtime/blob/master/FAQ.md https://github.com/intel/compute-runtime/blob/master/opencl/doc/DISTRIBUTIONS.md

It looks much better than Beignet, only axcrypt2-opencl and mscash2-opencl failed.

$ ./john --test=0 --format=opencl --device=1
Device 1: Intel(R) UHD Graphics 620 [0x5917]
Testing: sha1crypt-opencl, (NetBSD) [PBKDF1-SHA1 OpenCL 4x]... PASS
Testing: KeePass-opencl [SHA256 AES/Twofish/ChaCha OpenCL]... PASS
Testing: oldoffice-opencl, MS Office <= 2003 [MD5/SHA1 RC4 OpenCL]... PASS
Testing: PBKDF2-HMAC-MD4-opencl [PBKDF2-MD4 OpenCL 4x]... PASS
Testing: PBKDF2-HMAC-MD5-opencl [PBKDF2-MD5 OpenCL 4x]... PASS
Testing: PBKDF2-HMAC-SHA1-opencl [PBKDF2-SHA1 OpenCL 4x]... PASS
Testing: rar-opencl, RAR3 (length 5) [SHA1 OpenCL AES]... (8xOMP) PASS
Testing: RAR5-opencl [PBKDF2-SHA256 OpenCL]... PASS
Testing: TrueCrypt-opencl [RIPEMD160 AES256_XTS OpenCL]... PASS
Testing: lotus5-opencl, Lotus Notes/Domino 5 [OpenCL]... PASS
Testing: AndroidBackup-opencl [PBKDF2-SHA1 AES OpenCL 4x]... PASS
Testing: agilekeychain-opencl, 1Password Agile Keychain [PBKDF2-SHA1 AES OpenCL]... PASS
Testing: ansible-opencl, Ansible Vault [PBKDF2-SHA256 HMAC-SHA256 OpenCL]... PASS
Testing: axcrypt-opencl [SHA1 AES OpenCL]... PASS
Testing: axcrypt2-opencl, AxCrypt 2.x [PBKDF2-SHA512 AES OpenCL]... FAILED (cmp_all(1))
LWS=8 GWS=4096 Testing: bcrypt-opencl ("$2a$05", 32 iterations) [Blowfish OpenCL]... PASS
Testing: Bitcoin-opencl, Bitcoin Core [SHA512 OpenCL AES 64/64]... (8xOMP) PASS
Testing: BitLocker-opencl, BitLocker [SHA256 AES OpenCL]... PASS
Testing: bitwarden-opencl, Bitwarden Password Manager [PBKDF2-SHA256 AES OpenCL]... PASS
Testing: blockchain-opencl, blockchain My Wallet (v2 x5000) [PBKDF2-SHA1 AES OpenCL]... PASS
Testing: cloudkeychain-opencl, 1Password Cloud Keychain [PBKDF2-SHA512 AES OpenCL]... PASS
Testing: md5crypt-opencl, crypt(3) $1$ [MD5 OpenCL]... PASS
Testing: sha256crypt-opencl, crypt(3) $5$ (rounds=5000) [SHA256 OpenCL]... PASS
Testing: sha512crypt-opencl, crypt(3) $6$ (rounds=5000) [SHA512 OpenCL]... PASS
Testing: dashlane-opencl, Dashlane Password Manager [PBKDF2-SHA1 OpenCL 4x AES]... (8xOMP) PASS
Testing: descrypt-opencl, traditional crypt(3) [DES OpenCL]... PASS
Testing: diskcryptor-opencl, DiskCryptor [PBKDF2-SHA512 OpenCL]... (8xOMP) PASS
Testing: diskcryptor-aes-opencl, DiskCryptor AES XTS (only) [PBKDF2-SHA512 AES OpenCL]... PASS
Testing: dmg-opencl, Apple DMG [PBKDF2-SHA1 3DES/AES OpenCL 4x]... PASS
Testing: electrum-modern-opencl, Electrum Wallet 2.8+ [PBKDF2-SHA512 OpenCL]... (8xOMP) PASS
Testing: EncFS-opencl [PBKDF2-SHA1 AES OpenCL 4x]... PASS
Testing: enpass-opencl, Enpass Password Manager [PBKDF2-SHA1/SHA512 AES OpenCL]... PASS
Testing: ethereum-opencl, Ethereum Wallet [PBKDF2-SHA256 Keccak OpenCL]... PASS
Testing: ethereum-presale-opencl, Ethereum Presale Wallet [PBKDF2-SHA256 AES Keccak OpenCL]... PASS
Testing: FVDE-opencl, FileVault 2 [PBKDF2-SHA256 AES OpenCL]... PASS
Testing: geli-opencl, FreeBSD GELI [PBKDF2-SHA512 AES OpenCL]... PASS
Testing: gpg-opencl, OpenPGP / GnuPG Secret Key [SHA1/SHA2 OpenCL]... (8xOMP) PASS
Testing: iwork-opencl, Apple iWork '09 or newer [PBKDF2-SHA1 AES OpenCL]... PASS
Testing: keychain-opencl, Mac OS X Keychain [PBKDF2-SHA1 3DES OpenCL]... PASS
Testing: keyring-opencl, GNOME Keyring [SHA256 AES OpenCL]... PASS
Testing: keystore-opencl, Java KeyStore [SHA1 OpenCL]... PASS
Testing: krb5pa-md5-opencl, Kerberos 5 AS-REQ Pre-Auth etype 23 [MD4 HMAC-MD5 RC4 OpenCL]... PASS
Testing: krb5pa-sha1-opencl, Kerberos 5 AS-REQ Pre-Auth etype 17/18 [PBKDF2-SHA1 OpenCL 4x]... PASS
Testing: krb5asrep-aes-opencl, Kerberos 5 AS-REP etype 17/18 [PBKDF2-SHA1 OpenCL 4x]... PASS
Testing: lp-opencl, LastPass offline [PBKDF2-SHA256 AES OpenCL]... PASS
Testing: lpcli-opencl, LastPass CLI [PBKDF2-SHA256 AES OpenCL]... PASS
Testing: LM-opencl [DES BS OpenCL]... PASS
Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... PASS
Testing: mscash2-opencl, MS Cache Hash 2 (DCC2) [PBKDF2-SHA1 OpenCL]... FAILED (cmp_all(1))
Testing: mysql-sha1-opencl, MySQL 4.1+ [SHA1 OpenCL]... PASS
Testing: notes-opencl, Apple Notes [PBKDF2-SHA256 AES OpenCL]... PASS
Testing: NT-opencl [MD4 OpenCL]... PASS
Testing: ntlmv2-opencl, NTLMv2 C/R [MD4 HMAC-MD5 OpenCL]... PASS
Testing: o5logon-opencl, Oracle O5LOGON protocol [SHA1 AES OpenCL]... PASS
Testing: ODF-opencl, OpenDocument Star/Libre/OpenOffice [PBKDF2-SHA1 BF/AES OpenCL]... PASS
Testing: office-opencl, MS Office [SHA1/SHA512 AES OpenCL]... PASS
Testing: OpenBSD-SoftRAID-opencl [PBKDF2-SHA1 AES OpenCL 4x]... PASS
Testing: PBKDF2-HMAC-SHA256-opencl [PBKDF2-SHA256 OpenCL]... PASS
Testing: PBKDF2-HMAC-SHA512-opencl, GRUB2 / OS X 10.8+ [PBKDF2-SHA512 OpenCL]... PASS
Testing: pem-opencl, PKCS#8 private key (RSA/DSA/ECDSA) [PBKDF2-SHA1 3DES/AES OpenCL 4x]... PASS
Testing: pfx-opencl, (.pfx, .p12) [PKCS#12 PBE (SHA1/SHA-256/512) OpenCL]... PASS
Testing: pgpdisk-opencl, PGP Disk / Virtual Disk [SHA1 AES/TwoFish/CAST OpenCL]... PASS
Testing: pgpsda-opencl, PGP Self Decrypting Archive [SHA1 CAST OpenCL]... PASS
Testing: pgpwde-opencl, PGP Whole Disk Encryption [SHA1 AES OpenCL]... PASS
Testing: phpass-opencl ($P$9) [MD5 OpenCL 4x]... PASS
Testing: pwsafe-opencl, Password Safe [SHA256 OpenCL]... PASS
Testing: RAKP-opencl, IPMI 2.0 RAKP (RMCP+) [HMAC-SHA1 OpenCL 4x]... PASS
Testing: raw-MD4-opencl [MD4 OpenCL]... PASS
Testing: raw-MD5-opencl [MD5 OpenCL]... PASS
Testing: raw-SHA1-opencl [SHA1 OpenCL]... PASS
Testing: raw-SHA256-opencl [SHA256 OpenCL]... PASS
Testing: raw-SHA512-free-opencl [SHA512 OpenCL (inefficient, development use mostly)]... PASS
Testing: raw-SHA512-opencl [SHA512 OpenCL]... PASS
Testing: salted-SHA1-opencl [SHA1 OpenCL]... PASS
Testing: sappse-opencl, SAP PSE [PKCS#12 PBE (SHA1) OpenCL]... PASS
Testing: 7z-opencl, 7-Zip archive encryption (512K iterations) [SHA256 AES OpenCL]... (8xOMP) PASS
Testing: SL3-opencl, Nokia operator unlock [SHA1 OpenCL]... PASS
Testing: solarwinds-opencl, SolarWinds Orion [PBKDF2-SHA1 OpenCL]... PASS
Testing: ssh-opencl [RSA/DSA/EC (SSH private keys) OpenCL]... PASS
Testing: sspr-opencl, NetIQ SSPR / Adobe AEM [MD5/SHA1/SHA2 OpenCL]... PASS
Testing: strip-opencl, Password Manager [PBKDF2-SHA1 AES OpenCL]... PASS
Testing: telegram-opencl [PBKDF2-SHA1 AES OpenCL 4x]... PASS
Testing: tezos-opencl, Tezos Key [PBKDF2-SHA512 OpenCL]... (8xOMP) PASS
Testing: vmx-opencl, VMware VMX [PBKDF2-SHA1 AES OpenCL]... PASS
Testing: wpapsk-opencl, WPA/WPA2/PMF/PMKID PSK [PBKDF2-SHA1 OpenCL]... PASS
Testing: wpapsk-pmk-opencl, WPA/WPA2/PMF/PMKID master key [MD5/SHA-1/SHA-2 OpenCL]... PASS
Testing: XSHA512-free-opencl, Mac OS X 10.7+ [SHA512 OpenCL (efficient at "many salts" only)]... PASS
Testing: XSHA512-opencl, Mac OS X 10.7 salted [SHA512 OpenCL]... PASS
Testing: zed-opencl, Prim'X Zed! encrypted archives [PKCS#12 PBE (SHA1/SHA256) OpenCL]... PASS
Testing: ZIP-opencl, WinZip [PBKDF2-SHA1 OpenCL]... PASS
2 out of 90 tests have FAILED
frank-dittrich commented 3 years ago

For some formats, the speed isn't bad (compared to CPU format or POCL), but for others it is much worse.

[fd@localhost run]$ ./john --test --device=1 --format=md5crypt-opencl
Device 1: Intel(R) UHD Graphics 620 [0x5917]
Benchmarking: md5crypt-opencl, crypt(3) $1$ [MD5 OpenCL]... LWS=128 GWS=24576 (192 blocks) DONE
Warning: "Many salts" test limited: 17/256
Many salts: 204800 c/s real, 244322 c/s virtual
Only one salt:  201831 c/s real, 242902 c/s virtual

[fd@localhost run]$ ./john --test --device=2 --format=md5crypt-opencl
Device 2: pthread-Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
Benchmarking: md5crypt-opencl, crypt(3) $1$ [MD5 OpenCL]... LWS=8 GWS=128 (16 blocks) DONE
Many salts: 43136 c/s real, 6357 c/s virtual
Only one salt:  42496 c/s real, 6221 c/s virtual

[fd@localhost run]$ ./john --test --format=md5crypt       
Will run 8 OpenMP threads
Benchmarking: md5crypt, crypt(3) $1$ (and variants) [MD5 256/256 AVX2 8x3]... (8xOMP) DONE
Many salts: 311424 c/s real, 39099 c/s virtual
Only one salt:  298752 c/s real, 37484 c/s virtual

[fd@localhost run]$ ./john --test --device=1 --format=bcrypt-opencl
Device 1: Intel(R) UHD Graphics 620 [0x5917]
LWS=8 GWS=4096 Benchmarking: bcrypt-opencl ("$2a$05", 32 iterations) [Blowfish OpenCL]... DONE
Speed for cost 1 (iteration count) of 32
Raw:    416 c/s real, 74472 c/s virtual

[fd@localhost run]$ ./john --test --device=2 --format=bcrypt-opencl
Device 2: pthread-Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
LWS=16 GWS=256 Benchmarking: bcrypt-opencl ("$2a$05", 32 iterations) [Blowfish OpenCL]... DONE
Speed for cost 1 (iteration count) of 32
Raw:    4035 c/s real, 537 c/s virtual

fd@localhost run]$ ./john --test --format=bcrypt
Will run 8 OpenMP threads
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X3]... (8xOMP) DONE
Speed for cost 1 (iteration count) of 32
Raw:    5516 c/s real, 693 c/s virtual
frank-dittrich commented 3 years ago

Just in case this is useful:

$ ./john --list=opencl-devices --devices=1
Platform #0 name: Intel(R) OpenCL HD Graphics, version: OpenCL 3.0 
    Device #0 (1) name:     Intel(R) UHD Graphics 620 [0x5917]
    Device vendor:          Intel(R) Corporation
    Device type:            GPU (LE)
    Device version:         OpenCL 3.0 NEO 
    Driver version:         21.15.19533 
    Native vector widths:   char 16, short 8, int 4, long 1
    Preferred vector width: char 16, short 8, int 4, long 1
    Global Memory:          25482 MiB
    Global Memory Cache:    512 KiB
    Local Memory:           64 KiB (Local)
    Constant Buffer size:   4095 MiB
    Max memory alloc. size: 4095 MiB
    Max clock (MHz):        1150
    Profiling timer res.:   83 ns
    Max Work Group Size:    256
    Parallel compute cores: 24
    Stream processors:      192  (24 x 8)
    Speed index:            220800
solardiz commented 2 months ago

It looks much better than Beignet, only axcrypt2-opencl and mscash2-opencl failed.

That's great to know and have recorded in here. No need to track this as an issue, so closing.