The line where I use the XOR module to combine the two strings isn't working. For example, $pass = abc; but the code output doesn't change when the last letter changes, so the output will be the same when $pass=abd or $pass=abx. But if the first or second letter change, the output changes too. I tested and saw that for some reason, the XOR module doesn't read the last letter, only the two first ones, but when I try a simple version only with strings, it works.until ($numcount==24) { $pass = @list[$count3].@list[$count2].@list[$count1]; #a combination o +f three letters $foo = "@s[$numcount]"; #a ASCII character to try to decrypt $karp = xor_buf($foo,$pass); # put these together using the XOR module push @lister,$karp; $numcount++; }
Full code:0M@O@KKHM@ILBHAHIHILABCLANLJKKCLNLANMOHJHNKHHM@BLMAM@BLMHIAKIMHHNKKH - +- zyy 0M@O@KKHM@ILBHAHIHILABCLANLJKKCLNLANMOHJHNKHHM@BLMAM@BLMHIAKIMHHNKKH - +- zyz 0MCOCKHHMCIOBHBHJHILBBCLBNOJKHCLMLBNMOHIHMKHKMCBOMBMCBOMKIBKJMKHMKHH - +- zza 0MCOCKHHMCIOBHBHJHILBBCLBNOJKHCLMLBNMOHIHMKHKMCBOMBMCBOMKIBKJMKHMKHH - +- zzb
#!/usr/bin/perl use Math::XOR; #$outfile = "output.txt"; #open(HANDLE, ">>$outfile"); @list = (a..z); $count1 = 0; $count2 = 0; $count3 = 0; @s=(79,59,12,2,79,35,8,28,20,2,3,68,8,9,68,45,0,12,9,67,68,4,7,5,23,27 +,1,21,79,85,78,79,85,71,38,10,71,27,12,2,79,6,2,8,13,9); until ($count3==26) { until ($count2==26) { until ($count1==26) { until ($numcount==40) { $pass = @list[$count3].@list[$count2].@list[$count1]; $foo = "@s[$numcount]"; $karp = xor_buf($foo, $pass); push @lister,$karp; $numcount++; } print @lister," -- $pass\n"; @lister = 0; $numcount=0; $count1++; } $count1=0; $count2++; } $count2=0; $count3++; }
In reply to Math::XOR problem by kuratkull
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |