Fairly simple no need to explain anything.
Encrypted Dat file to readable txt conversion and vice-versa
Need .NET Framework 3.5 to run it.
Encrypted Dat file to readable txt conversion and vice-versa
Need .NET Framework 3.5 to run it.
public class JEncryptedDatFile
{
private static byte[] Key =
{
(byte) 0xAD, (byte) 0x6B, (byte) 0x4F, (byte) 0xFB, (byte) 0xDD, (byte) 0xB8,
(byte) 0x0E, (byte) 0x09, (byte) 0x13, (byte) 0x33, (byte) 0x8F, (byte) 0xF5,
(byte) 0x43, (byte) 0x09, (byte) 0x15, (byte) 0x88, (byte) 0x5D, (byte) 0x80,
(byte) 0xA3, (byte) 0x45, (byte) 0x2D, (byte) 0x42, (byte) 0x08, (byte) 0x56,
(byte) 0x80, (byte) 0xF8, (byte) 0x19, (byte) 0xC5, (byte) 0x88, (byte) 0x1B,
(byte) 0x3E, (byte) 0xEF, (byte) 0x81, (byte) 0x07, (byte) 0x30, (byte) 0x36,
(byte) 0x95, (byte) 0x52, (byte) 0x00, (byte) 0xF7, (byte) 0xFD, (byte) 0x5B,
(byte) 0x5C, (byte) 0xBC, (byte) 0x6A, (byte) 0x26, (byte) 0x0E, (byte) 0xB2,
(byte) 0xA3, (byte) 0x67, (byte) 0xC5, (byte) 0x5D, (byte) 0x6F, (byte) 0xDC,
(byte) 0x18, (byte) 0x8A, (byte) 0xB5, (byte) 0xE0, (byte) 0xC8, (byte) 0x85,
(byte) 0xE2, (byte) 0x3E, (byte) 0x45, (byte) 0x8D, (byte) 0x8B, (byte) 0x43,
(byte) 0x74, (byte) 0x85, (byte) 0x54, (byte) 0x17, (byte) 0xB0, (byte) 0xEC,
(byte) 0x10, (byte) 0x4D, (byte) 0x0F, (byte) 0x0F, (byte) 0x29, (byte) 0xB8,
(byte) 0xE6, (byte) 0x7D, (byte) 0x42, (byte) 0x80, (byte) 0x8F, (byte) 0xBC,
(byte) 0x1C, (byte) 0x76, (byte) 0x69, (byte) 0x3A, (byte) 0xB6, (byte) 0xA5,
(byte) 0x21, (byte) 0x86, (byte) 0xB9, (byte) 0x29, (byte) 0x30, (byte) 0xC0,
(byte) 0x12, (byte) 0x45, (byte) 0xA5, (byte) 0x4F, (byte) 0xE1, (byte) 0xAF,
(byte) 0x25, (byte) 0xD1, (byte) 0x92, (byte) 0x2E, (byte) 0x30, (byte) 0x58,
(byte) 0x49, (byte) 0x67, (byte) 0xA5, (byte) 0xD3, (byte) 0x84, (byte) 0xF4,
(byte) 0x89, (byte) 0xCA, (byte) 0xFC, (byte) 0xB7, (byte) 0x04, (byte) 0x4F,
(byte) 0xCC, (byte) 0x6E, (byte) 0xAC, (byte) 0x31, (byte) 0xD4, (byte) 0x87,
(byte) 0x07, (byte) 0x72
};
public string FileName { get; private set; }
public JEncryptedDatFile(string File)
{
this.FileName = File;
}
public void Encrypt(string OutputFile)
{
byte[] bytes = File.ReadAllBytes(FileName);
int i = 0;
byte t1 = 0;
int t2;
while (i < bytes.Length)
{
t2 = i % 0x8;
t1 = (byte)((bytes[i] >> (0x8 - t2)) + (bytes[i] << t2));
bytes[i] = (byte)(t1 ^ Key[i % 0x80]);
i++;
}
File.WriteAllBytes(OutputFile, bytes);
}
public void Decrypt(string OutputFile)
{
byte[] bytes = File.ReadAllBytes(FileName);
int i = 0;
int t1 = 0;
int t2;
while (i < bytes.Length)
{
t1 = ((int)bytes[i] ^ (int)Key[i % 0x80]) & 0xff;
t2 = i % 0x8;
bytes[i] = (byte)(((t1 << 0x8 - t2)) | (t1 >> t2));
i++;
}
File.WriteAllBytes(OutputFile, bytes);
}
}