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 (30 loc) · 1019 Bytes
/
Copy pathBlowFishKeygen.cs
File metadata and controls
35 lines (30 loc) · 1019 Bytes
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;
namespace L2dotNET.Utility
{
public class BlowFishKeygen
{
private const int CryptKeysSize = 20;
private static readonly byte[][] CryptKeys = new byte[CryptKeysSize][];
public static void GenerateKeys()
{
for (int i = 0; i < CryptKeysSize; i++)
{
CryptKeys[i] = new byte[16];
for (int j = 0; j < CryptKeys[i].Length; j++)
CryptKeys[i][j] = (byte)RandomThreadSafe.Instance.Next(255);
CryptKeys[i][8] = 0xc8;
CryptKeys[i][9] = 0x27;
CryptKeys[i][10] = 0x93;
CryptKeys[i][11] = 0x01;
CryptKeys[i][12] = 0xa1;
CryptKeys[i][13] = 0x6c;
CryptKeys[i][14] = 0x31;
CryptKeys[i][15] = 0x97;
}
}
public static byte[] GetRandomKey()
{
return CryptKeys[RandomThreadSafe.Instance.Next(CryptKeysSize)];
}
}
}