- Joined
- Oct 28, 2013
- Messages
- 29
- Reaction score
- 14
I need a method to encrypt files.
function that I am using to decrypt, the function to encrypt is missing, anyone who can help I would appreciate it
function that I am using to decrypt, the function to encrypt is missing, anyone who can help I would appreciate it
C#:
private static void Unshift(IList<byte> data, int start, int length, int bits)
{
var to = start + length;
if (data.Count < to) to = data.Count;
var last = data[to - 1];
for (var i = to - 1; i >= start; i--)
{
var current = i <= start ? last : data[i - 1];
data[i] = (byte)((current << (8 - bits)) | (data[i] >> bits));
}
File.WriteAllBytes(@"decrypt.txt", data.ToArray());
}