forked from Elfocrash/L2dotNET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBlowfishKeygen.cs
More file actions
35 lines (31 loc) · 1.12 KB
/
Copy pathBlowfishKeygen.cs
File metadata and controls
35 lines (31 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using L2dotNET.Utility;
namespace L2dotNET.Encryption
{
public static class BlowfishKeygen
{
private const int _cryptKeysSize = 20;
private static readonly byte[][] _cryptKeys = new byte[_cryptKeysSize][];
public static void Init()
{
for (int index1 = 0; index1 < _cryptKeysSize; ++index1)
{
_cryptKeys[index1] = new byte[16];
for (int index2 = 0; index2 < _cryptKeys[index1].Length; ++index2)
_cryptKeys[index1][index2] = (byte) RandomThreadSafe.Instance.Next(byte.MaxValue);
_cryptKeys[index1][8] = 200;
_cryptKeys[index1][9] = 39;
_cryptKeys[index1][10] = 147;
_cryptKeys[index1][11] = 1;
_cryptKeys[index1][12] = 161;
_cryptKeys[index1][13] = 108;
_cryptKeys[index1][14] = 49;
_cryptKeys[index1][15] = 151;
}
}
public static byte[] GetRandomKey()
{
return _cryptKeys[RandomThreadSafe.Instance.Next(_cryptKeysSize)];
}
}
}