public static string Encrypt(string plainText, IDictionary <string, object> options)
        {
            var toEncrypt     = plainText;
            var encryptedText = string.Empty;

            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            var decodeFromBase64 = options.ContainsKey("DecodeFromBase64") &&
                                   Convert.ToBoolean(options["DecodeFromBase64"], CultureInfo.InvariantCulture);
            var encodeToBase64 = options.ContainsKey("EncodeToBase64") && Convert.ToBoolean(options["EncodeToBase64"], CultureInfo.InvariantCulture);

            var method = options.ContainsKey("Method") ? options["Method"].ToString() : string.Empty;

            switch (method)
            {
            // RSA
            case "RSA":
                var publicKeyPath = options["PublicKeyPath"].ToString();

                if (publicKeyPath.StartsWith("\"", StringComparison.InvariantCulture))
                {
                    publicKeyPath = publicKeyPath.Substring(1, publicKeyPath.Length - 1);
                }

                if (publicKeyPath.EndsWith("\"", StringComparison.InvariantCulture))
                {
                    publicKeyPath = publicKeyPath.Substring(0, publicKeyPath.Length - 1);
                }

                if (decodeFromBase64)
                {
                    toEncrypt = GeneralUtils.Base64Decode(toEncrypt);
                }

                encryptedText = encodeToBase64 ? RsaUtils.EncryptAndBase64Encode(toEncrypt, publicKeyPath) : RsaUtils.Encrypt(toEncrypt, publicKeyPath);
                break;

            // AES
            case "AES":
                var key = options["key"].ToString();
                var initializationValue = options["iniValue"].ToString();

                encryptedText = encodeToBase64 ? AesUtils.EncryptAndBase64Encode(toEncrypt, key, initializationValue) : AesUtils.Encrypt(toEncrypt, key, initializationValue);
                break;

            // Base64
            case "Base64":
                encryptedText = GeneralUtils.Base64Encode(toEncrypt);
                break;

            // Hashing
            case "Hashing":
                switch (options["hashMethod"].ToString())
                {
                case "MD5":
                    // create new instance of MD5
                    var md5 = MD5.Create();

                    try
                    {
                        // convert the input text to array of bytes
                        var hashDataMd5 = md5.ComputeHash(Encoding.Default.GetBytes(toEncrypt));

                        // return hexadecimal string
                        encryptedText = BitConverter.ToString(hashDataMd5).Replace("-", string.Empty);
                    }
                    finally
                    {
                        md5.Dispose();
                    }

                    break;

                case "SHA1":
                    // create new instance of SHA1
                    var sha1 = SHA1.Create();

                    try
                    {
                        // convert the input text to array of bytes
                        var hashDataSha1 = sha1.ComputeHash(Encoding.Default.GetBytes(toEncrypt));

                        // return hexadecimal string
                        encryptedText = BitConverter.ToString(hashDataSha1).Replace("-", string.Empty);
                    }
                    finally
                    {
                        sha1.Dispose();
                    }

                    break;

                case "SHA2":
                case "SHA256":
                    // create new instance of SHA256
                    var sha2 = SHA256.Create();

                    try
                    {
                        // convert the input text to array of bytes
                        var hashDataSha2 = sha2.ComputeHash(Encoding.Default.GetBytes(toEncrypt));

                        // return hexadecimal string
                        encryptedText = BitConverter.ToString(hashDataSha2).Replace("-", string.Empty);
                    }
                    finally
                    {
                        sha2.Dispose();
                    }

                    break;
                }

                break;
            }

            return(encryptedText);
        }