So I am trying to write the brute force cipher program. I thought I had everything right, example, when I encode my own message, it comes back out correctly. But when I deal with the cipher1.txt file I get gibberish constantly. For example, the first character when XOR'd with a-z it always produces a symbol. But this is supposed to be all english words.
So I did:
Code: Select all
for(int i=97; i<=122;i++)
{
int currVal = XOR(79,i);
char c=new Character((char) currVal);
PrintShop.print(""+c+PrintShop.nl());
}
and that produces for the first letter:
Expand
.
-
,
+
*
)
(
'
&
%
$
#
"
!
?
>
=
<
;
:
9
8
7
6
5
If the password has to be 3 lower case letters, then it has to be one of a-z deciphering the first character.XOR(79,i)works fine, I've double checked it with the examples they give with answers in the problem text.
65 XOR 42 = 107, then 107 XOR 42 = 65. That works fine. Am I misunderstanding what lower case character is? is that more then just a-z (26 characters).