Problem is, the test does not test all possibilities as expected. Typically i get results like :
guili195
guili466
guili1051
guili1231
guili1370
guili2026
guili2476
As if, I don't why, some steps were jumped. I can write a bit python but this is the first time I am touching ruby. Please someone help ?
My script takes a shortcut. Electrum doesn't stretch the wallet seed (more here:
https://bitcointalk.org/index.php?topic=330672.0) and most passphrases can be rejected before stretching.
The script is written to be compact instead of readable so it's hard to spot it. The shortcut is: given an invalid key, "$cipher.final" raises a CipherError exception; the program then jumps to "rescue OpenSSL::Cipher::CipherError", skipping the lines where it prints and tests the passphrase.