forked from PGR/ascnet
1
0
Fork 0
ascnet/AscNet.Common/Util/Crypto.cs

16 lines
380 B
C#
Raw Normal View History

2023-10-06 13:29:27 +00:00
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;
}
}
}