这个C#的解密换成JAVA代码怎么写?

这个是C#代码
public static byte[] Encrypt(byte[] s)
{
UInt16 key = 26493;
const UInt16 Var1 = 21469;
const UInt16 Var2 = 12347;

        byte[] bt2 = new byte[s.Length];

        for (int i = 0; i < s.Length; i++)
        {
            bt2[i] = (byte)(s[i] ^ (key >> 8));
            key = (UInt16)((bt2[i] + key) * Var1 + Var2);
        }
        Console.WriteLine(bt2);
        return bt2;
    }

这个是JAVA代码:
public static byte[] Encrypt(byte[] s)
{
int key = 26493;
final int Var1 = 21469;
final int Var2 = 12347;

    byte[] bt2 = new byte[s.length];

    for (int i = 0; i < s.length; i++)
    {
        bt2[i] = (byte)(s[i] ^ (key >> 8));
        key = (int)((bt2[i] + key) * Var1 + Var2);
    }
    return bt2;
}

可是加密之后出来不对。
正确的明文和密文应该是123456,5608C87A5E9837FFD1EA70E4。
是哪里改错了吗?

这个就是简单的xor加密,直接在java里面照着写就可以了。语法一样,连函数都基本一样。

先前的那个是别人给错了。这个才是加密的。可是还是不正确