コード例 #1
0
 private static string ScrambleNonce(ulong clientSeed, byte[] serverNonce)
 {
     var scrambler = new Scrambler(clientSeed);
     var byte100 = 0;
     for (int i = 0; i < 100; i++)
         byte100 = scrambler.GetByte();
     var scrambled = string.Empty;
     for (int i = 0; i < serverNonce.Length; i++)
         scrambled += (char)(serverNonce[i] ^ (scrambler.GetByte() & byte100));
     return scrambled;
 }
コード例 #2
0
ファイル: CoCCrypto.cs プロジェクト: maithanhtan/CoCSharp
 private static string ScrambleNonce(ulong clientSeed, byte[] serverNonce)
 {
     var scrambler = new Scrambler(clientSeed);
     var byte100 = 0;
     for (int i = 0; i < 100; i++)
         byte100 = scrambler.GetByte();
     var scrambled = string.Empty;
     for (int i = 0; i < serverNonce.Length; i++)
         scrambled += (char)(serverNonce[i] ^ (scrambler.GetByte() & byte100));
     return scrambled;
 }