Okay, I figured out the problem. The problem was that my algorythm filed the numbers into the matrix as so: 1 2 3 4 5 6 7 8... While it should have been 1 5 9 13 2 6 10 14 ... When this was fixed, the program works great! That's what I get for testing only asymetrical keys... Oh well, thanks for the help in fixing the problem!