hash_bruteforce_sha512.pl 659 B

123456789101112131415161718192021222324
  1. #!/usr/bin/perl
  2. # Try to find an IP address that matches the Cicada LP hash.
  3. use 5.036;
  4. use Digest::SHA qw(sha512_hex);
  5. my $from = 27; # test up to this point
  6. foreach my $i ($from .. 255) {
  7. say "i = $i";
  8. foreach my $j (0 .. 255) {
  9. foreach my $k (0 .. 255) {
  10. foreach my $l (0 .. 255) {
  11. my $digest = sha512_hex("$i.$j.$k.$l");
  12. if ($digest eq
  13. '36367763ab73783c7af284446c59466b4cd653239a311cb7116d4618dee09a8425893dc7500b464fdaf1672d7bef5e891c6e2274568926a49fb4f45132c2a8b4') {
  14. die "Found: $i.$j.$k.$l";
  15. }
  16. }
  17. }
  18. }
  19. }