LethalCompany/Lethal Company/ExportedProject/Assets/Plugins/Assembly-CSharp-firstpass/ES3Internal/EncryptionAlgorithm.cs

26 lines
695 B
C#
Raw Normal View History

2023-12-22 22:51:17 +00:00
using System.IO;
namespace ES3Internal
{
public abstract class EncryptionAlgorithm
{
public abstract byte[] Encrypt(byte[] bytes, string password, int bufferSize);
public abstract byte[] Decrypt(byte[] bytes, string password, int bufferSize);
public abstract void Encrypt(Stream input, Stream output, string password, int bufferSize);
public abstract void Decrypt(Stream input, Stream output, string password, int bufferSize);
protected static void CopyStream(Stream input, Stream output, int bufferSize)
{
byte[] buffer = new byte[bufferSize];
int count;
while ((count = input.Read(buffer, 0, bufferSize)) > 0)
{
output.Write(buffer, 0, count);
}
}
}
}