Index: src/moduls/special/FLibSYS/statfunc.cpp
===================================================================
--- src/moduls/special/FLibSYS/statfunc.cpp	(revision 3078)
+++ src/moduls/special/FLibSYS/statfunc.cpp	(working copy)
@@ -122,6 +122,10 @@
     reg(new CRC());
 #if HAVE_OPENSSL_SSL_H
     reg(new MD5());
+# if OPENSSL_VERSION_NUMBER >= 0x10100000L
+    reg(new dgst());
+    reg(new enc());
+# endif
 #endif
 
     // Time functions
Index: src/moduls/special/FLibSYS/sysfnc.h
===================================================================
--- src/moduls/special/FLibSYS/sysfnc.h	(revision 3078)
+++ src/moduls/special/FLibSYS/sysfnc.h	(working copy)
@@ -605,17 +605,19 @@
 
 	void calc( TValFunc *val ) {
 	    string data = val->getS(1);
+	    unsigned int result_len;
 
 # if OPENSSL_VERSION_NUMBER >= 0x10100000L
 	    EVP_MD_CTX *mdctx = EVP_MD_CTX_new();
 	    EVP_DigestInit_ex(mdctx, EVP_md5(), NULL);
 	    EVP_DigestUpdate(mdctx, (unsigned char*)data.data(), data.size());
-	    unsigned int result_len = EVP_MD_size(EVP_md5());
-	    unsigned char *result = (unsigned char *)OPENSSL_malloc(result_len);
+	    result_len = EVP_MD_size(EVP_md5());
+	    unsigned char result[result_len];
+	    //unsigned char *result = (unsigned char *)OPENSSL_malloc(result_len);
 	    EVP_DigestFinal_ex(mdctx, result, &result_len);
 	    EVP_MD_CTX_free(mdctx);
 # else
-	    unsigned int result_len = MD5_DIGEST_LENGTH;
+	    result_len = MD5_DIGEST_LENGTH;
 	    unsigned char result[result_len];
 	    ::MD5((unsigned char*)data.data(), data.size(), result);
 # endif
@@ -622,6 +624,127 @@
 	    val->setS(0, string((char*)result, result_len));
 	}
 };
+
+# if OPENSSL_VERSION_NUMBER >= 0x10100000L
+//*************************************************
+//* Message Digests                               *
+//*************************************************
+class dgst : public TFunction
+{
+    public:
+	dgst( ) : TFunction("dgst", SSPC_ID) {
+	    ioAdd(new IO("rez",trS("Result"),IO::String,IO::Return));
+	    ioAdd(new IO("data",trS("Data"),IO::String,IO::Default));
+	    ioAdd(new IO("type",trS("Type"),IO::String,IO::Default,"md5"));
+	}
+
+	string name( )	{ return _("Message Digests"); }
+	string descr( )	{ return _("Calculating for the Message Digests of the <data> for <type>."); }
+
+	void calc( TValFunc *val ) {
+	    string data = val->getS(1),
+		   type = val->getS(2);
+	    unsigned int result_len;
+
+	    EVP_MD_CTX *mdctx = EVP_MD_CTX_new();
+	    if(strcasecmp(type.c_str(),"blake2b512") == 0) {
+		EVP_DigestInit_ex(mdctx, EVP_blake2b512(), NULL);
+		result_len = EVP_MD_size(EVP_blake2b512());
+	    }
+	    else if(strcasecmp(type.c_str(),"blake2s256") == 0) {
+		EVP_DigestInit_ex(mdctx, EVP_blake2s256(), NULL);
+		result_len = EVP_MD_size(EVP_blake2s256());
+	    }
+	    else if(strcasecmp(type.c_str(),"md4") == 0) {
+		EVP_DigestInit_ex(mdctx, EVP_md4(), NULL);
+		result_len = EVP_MD_size(EVP_md4());
+	    }
+	    else if(strcasecmp(type.c_str(),"rmd160") == 0) {
+		EVP_DigestInit_ex(mdctx, EVP_ripemd160(), NULL);
+		result_len = EVP_MD_size(EVP_ripemd160());
+	    }
+	    else if(strcasecmp(type.c_str(),"sha1") == 0) {
+		EVP_DigestInit_ex(mdctx, EVP_sha1(), NULL);
+		result_len = EVP_MD_size(EVP_sha1());
+	    }
+	    else if(strcasecmp(type.c_str(),"sha224") == 0) {
+		EVP_DigestInit_ex(mdctx, EVP_sha224(), NULL);
+		result_len = EVP_MD_size(EVP_sha224());
+	    }
+	    else if(strcasecmp(type.c_str(),"sha256") == 0) {
+		EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL);
+		result_len = EVP_MD_size(EVP_sha256());
+	    }
+	    //???? ...
+	    else {
+		EVP_DigestInit_ex(mdctx, EVP_md5(), NULL);
+		result_len = EVP_MD_size(EVP_md5());
+	    }
+
+	    EVP_DigestUpdate(mdctx, (unsigned char*)data.data(), data.size());
+	    unsigned char result[result_len];
+	    EVP_DigestFinal_ex(mdctx, result, &result_len);
+	    EVP_MD_CTX_free(mdctx);
+
+	    val->setS(0, string((char*)result, result_len));
+	}
+};
+
+//*************************************************
+//* Cipher encoding/decoding                      *
+//*************************************************
+class enc : public TFunction
+{
+    public:
+	enc( ) : TFunction("enc", SSPC_ID) {
+	    ioAdd(new IO("rez",trS("Result"),IO::String,IO::Return));
+	    ioAdd(new IO("data",trS("Data"),IO::String,IO::Default));
+	    ioAdd(new IO("type",trS("Type"),IO::String,IO::Default,"??"));
+	    ioAdd(new IO("key",trS("Key"),IO::String,IO::Default));
+	    ioAdd(new IO("decrypt",trS("Decrypt"),IO::Boolean,IO::Default,"0"));
+	    ioAdd(new IO("opts",trS("Options"),IO::String,IO::Default));
+	}
+
+	string name( )	{ return _("Cipher encoding/decoding"); }
+	string descr( )	{ return _("Cipher encoding/decoding of the <data> for <type>."); }
+
+	void calc( TValFunc *val ) {
+	    string mess = val->getS(1),
+		   type = val->getS(2),
+		   key = val->getS(3),
+		   opts = val->getS(5);
+	    bool decrypt = val->getB(4);
+
+	    if(mess.empty()) { val->setS(0, ""); return; }
+
+	    unsigned char obuf[mess.size()], *ivecb = NULL;//, ivecb[keySize];
+
+	    int obufl = 0;
+	    EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();
+	    if(strcasecmp(type.c_str(),"aes-128-cbc") == 0)
+		EVP_CipherInit(ctx, EVP_aes_128_cbc(), (const unsigned char*)key.c_str(), ivecb, !decrypt);
+	    else if(strcasecmp(type.c_str(),"aes-128-ecb") == 0)
+		EVP_CipherInit(ctx, EVP_aes_128_ecb(), (const unsigned char*)key.c_str(), ivecb, !decrypt);
+	    else if(strcasecmp(type.c_str(),"aes-192-cbc") == 0)
+		EVP_CipherInit(ctx, EVP_aes_192_cbc(), (const unsigned char*)key.c_str(), ivecb, !decrypt);
+	    else if(strcasecmp(type.c_str(),"aes-192-ecb") == 0)
+		EVP_CipherInit(ctx, EVP_aes_192_ecb(), (const unsigned char*)key.c_str(), ivecb, !decrypt);
+	    else if(strcasecmp(type.c_str(),"aes-256-cbc") == 0)
+		EVP_CipherInit(ctx, EVP_aes_256_cbc(), (const unsigned char*)key.c_str(), ivecb, !decrypt);
+	    else if(strcasecmp(type.c_str(),"aes-256-ecb") == 0)
+		EVP_CipherInit(ctx, EVP_aes_256_ecb(), (const unsigned char*)key.c_str(), ivecb, !decrypt);
+	    else { EVP_CIPHER_CTX_free(ctx); val->setS(0, ""); return; }
+
+	    EVP_CIPHER_CTX_set_padding(ctx, false);
+	    EVP_CipherUpdate(ctx, obuf, &obufl, (const unsigned char*)mess.data(), mess.size());
+	    EVP_CIPHER_CTX_free(ctx);
+
+	    val->setS(0, string((char*)obuf, mess.size()));
+	}
+};
+
+# endif
+
 #endif
 
 }
Index: src/moduls/transport/SSL/modssl.cpp
===================================================================
--- src/moduls/transport/SSL/modssl.cpp	(revision 3078)
+++ src/moduls/transport/SSL/modssl.cpp	(working copy)
@@ -429,16 +429,19 @@
     if(close(hd) != 0)
 	mess_warning(nodePath().c_str(), _("Closing the file %d error '%s (%d)'!"), hd, strerror(errno), errno);
 
+    unsigned int result_len;
+
 #if OPENSSL_VERSION_NUMBER >= 0x10100000L
     EVP_MD_CTX *mdctx = EVP_MD_CTX_new();
     EVP_DigestInit_ex(mdctx, EVP_md5(), NULL);
     EVP_DigestUpdate(mdctx, (unsigned char*)data.data(), data.size());
-    unsigned int result_len = EVP_MD_size(EVP_md5());
-    unsigned char *result = (unsigned char *)OPENSSL_malloc(result_len);
+    result_len = EVP_MD_size(EVP_md5());
+    //unsigned char *result = (unsigned char *)OPENSSL_malloc(result_len);
+    unsigned char result[result_len];
     EVP_DigestFinal_ex(mdctx, result, &result_len);
     EVP_MD_CTX_free(mdctx);
 #else
-    unsigned int result_len = MD5_DIGEST_LENGTH;
+    result_len = MD5_DIGEST_LENGTH;
     unsigned char result[result_len];
     ::MD5((unsigned char*)data.data(), data.size(), result);
 #endif
