Login to reply

4 posts


by aktionline 12 months ago
can you help me please to make this function posibile using your function node. thanks alot
//Don't forget the using System.Security.Cryptography; statement wher you add this classpublic static class Encrypt{    // This size of the IV (in bytes) must = (keysize / 8).  Default keysize is 256, so the IV must be    // 32 bytes long.  Using a 16 character string here gives us 32 bytes when converted to a byte array.    private const string initVector = "pemgail9uzpgzl88";    // This constant is used to determine the keysize of the encryption algorithm    private const int keysize = 256;    //Encrypt    public static string EncryptString(string plainText, string passPhrase)    {        byte[] initVectorBytes = Encoding.UTF8.GetBytes(initVector);        byte[] plainTextBytes = Encoding.UTF8.GetBytes(plainText);        PasswordDeriveBytes password = new PasswordDeriveBytes(passPhrase, null);        byte[] keyBytes = password.GetBytes(keysize / 8);        RijndaelManaged symmetricKey = new RijndaelManaged();        symmetricKey.Mode = CipherMode.CBC;        ICryptoTransform encryptor = symmetricKey.CreateEncryptor(keyBytes, initVectorBytes);        MemoryStream memoryStream = new MemoryStream();        CryptoStream cryptoStream = new CryptoStream(memoryStream, encryptor, CryptoStreamMode.Write);        cryptoStream.Write(plainTextBytes, 0, plainTextBytes.Length);        cryptoStream.FlushFinalBlock();        byte[] cipherTextBytes = memoryStream.ToArray();        memoryStream.Close();        cryptoStream.Close();        return Convert.ToBase64String(cipherTextBytes);    }    //Decrypt    public static string DecryptString(string cipherText, string passPhrase)    {        byte[] initVectorBytes = Encoding.ASCII.GetBytes(initVector);        byte[] cipherTextBytes = Convert.FromBase64String(cipherText);        PasswordDeriveBytes password = new PasswordDeriveBytes(passPhrase, null);        byte[] keyBytes = password.GetBytes(keysize / 8);        RijndaelManaged symmetricKey = new RijndaelManaged();        symmetricKey.Mode = CipherMode.CBC;        ICryptoTransform decryptor = symmetricKey.CreateDecryptor(keyBytes, initVectorBytes);        MemoryStream memoryStream = new MemoryStream(cipherTextBytes);        CryptoStream cryptoStream = new CryptoStream(memoryStream, decryptor, CryptoStreamMode.Read);        byte[] plainTextBytes = new byte[cipherTextBytes.Length];        int decryptedByteCount = cryptoStream.Read(plainTextBytes, 0, plainTextBytes.Length);        memoryStream.Close();        cryptoStream.Close();        return Encoding.UTF8.GetString(plainTextBytes, 0, decryptedByteCount);    }}

by Rebin 12 months ago
I've created two nodes for both functions.You need to add the Encrypter.cs file (in SourceLibraries) to your project for the nodes to work.Here is a project sample:

Korduene Developer
by aktionline 13 days ago
I am missing the old documentation. i want to learn how to use function nodes. thanks

by Rebin 12 days ago
You can find the old documentations at http://www.korduene.com/oldcontent/docs/.

Korduene Developer
Login to reply
;