Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// <summary>
- /// Diablo 3 Encryption
- /// Reversed by Vulnavia
- /// Implemented by kill_seth
- /// </summary>
- public class Diablo3_uint64
- {
- /// <summary>
- /// Decrypts diablo 3 encrypted saves.
- /// </summary>
- public static byte[] Decrypt(byte[] data)
- {
- try
- {
- UInt64 Key = 0x2EC9A01B305F92D8;
- for (int i = 0; i < data.Length; i++)
- {
- data[i] = (byte)((data[i] ^ (Key & 0xFF)) & 0xFF);
- Key = ((Key ^ data[i]) << 56) | (Key >> 8);
- }
- return data;
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- /// <summary>
- /// Encrypts diablo 3 decrypted saves.
- /// </summary>
- public static byte[] Encrypt(byte[] data)
- {
- try
- {
- UInt64 Key = 0x2EC9A01B305F92D8;
- for (int i = 0; i < data.Length; i++)
- {
- byte temp = data[i];
- data[i] = (byte)((temp ^ (Key & 0xFF)) & 0xFF);
- Key = ((Key ^ temp) << 56) | (Key >> 8);
- }
- return data;
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment