2using System.Security.Cryptography;
68 public override string[]
DefaultArgumentNames =>
new string[] {
"Content",
"Key",
"IV",
"CipherMode",
"PaddingMode" };
78 byte[] Data =
Arguments[0].AssociatedObjectValue as
byte[];
82 byte[] Key =
Arguments[1].AssociatedObjectValue as
byte[];
84 throw new ScriptRuntimeException(
"Key to use for decryption must be binary (i.e. an array of bytes).",
this);
86 byte[] IV =
Arguments[2].AssociatedObjectValue as
byte[];
88 throw new ScriptRuntimeException(
"Initiation Vector to use for decryption must be binary (i.e. an array of bytes).",
this);
91 CipherMode CipherMode = c <= 3 ? CipherMode.CBC : this.ToEnum<CipherMode>(
Arguments[3]);
92 PaddingMode PaddingMode = c <= 4 ? PaddingMode.PKCS7 : this.ToEnum<PaddingMode>(
Arguments[4]);
94 using (Aes Aes = Aes.Create())
98 Aes.Mode = CipherMode;
99 Aes.Padding = PaddingMode;
101 using (ICryptoTransform Transform = Aes.CreateDecryptor(Key, IV))
103 byte[] Encrypted = Transform.TransformFinalBlock(Data, 0, Data.Length);
Aes256Decrypt(ScriptNode Content, ScriptNode Key, ScriptNode IV, ScriptNode CipherMode, int Start, int Length, Expression Expression)
AES Decryption
Aes256Decrypt(ScriptNode Content, ScriptNode Key, ScriptNode IV, ScriptNode CipherMode, ScriptNode PaddingMode, int Start, int Length, Expression Expression)
AES Decryption
override string[] DefaultArgumentNames
Default Argument names
Aes256Decrypt(ScriptNode Content, ScriptNode Key, ScriptNode IV, int Start, int Length, Expression Expression)
AES Decryption
override string FunctionName
Name of the function
override IElement Evaluate(IElement[] Arguments, Variables Variables)
Evaluates the function.
Script runtime exception.
Class managing a script expression.
Base class for multivariate funcions.
static readonly ArgumentType[] argumentTypes3Normal
Three normal parameters.
static readonly ArgumentType[] argumentTypes4Normal
Four normal parameters.
ScriptNode[] Arguments
Function arguments.
static readonly ArgumentType[] argumentTypes5Normal
Five normal parameters.
Base class for all nodes in a parsed script tree.
int Length
Length of expression covered by node.
Expression Expression
Expression of which the node is a part.
int Start
Start position in script expression.
Basic interface for all types of elements.