Add decrypt() method
This commit is contained in:
parent
4444b143fd
commit
87b4f70de9
|
@ -19,6 +19,7 @@
|
|||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Security.Cryptography;
|
||||
using Mono.Cecil;
|
||||
|
||||
namespace de4dot.code.deobfuscators {
|
||||
|
@ -62,5 +63,13 @@ namespace de4dot.code.deobfuscators {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static byte[] decrypt(byte[] data, byte[] key, byte[] iv) {
|
||||
using (var aes = new RijndaelManaged { Mode = CipherMode.CBC }) {
|
||||
using (var transform = aes.CreateDecryptor(key, iv)) {
|
||||
return transform.TransformFinalBlock(data, 0, data.Length);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user