mirror of
https://git.lewd.wtf/PGR/ascnet
synced 2025-12-13 19:24:36 +01:00
Add project files.
This commit is contained in:
15
AscNet.Common/Util/Crypto.cs
Normal file
15
AscNet.Common/Util/Crypto.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace AscNet.Common.Util
|
||||
{
|
||||
public static class Crypto
|
||||
{
|
||||
public static byte[] XORCrypt(byte[] data, byte[] key)
|
||||
{
|
||||
byte[] encryptedData = new byte[data.Length];
|
||||
|
||||
for (int i = 0; i < data.Length; i++)
|
||||
encryptedData[i] = (byte)(data[i] ^ key[i % key.Length]);
|
||||
|
||||
return encryptedData;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user