diff --git a/encrypt.cpp b/encrypt.cpp
index e6c7ccf..cc5a64f 100755
--- a/encrypt.cpp
+++ b/encrypt.cpp
@@ -37,6 +37,8 @@ auth_mode_t auth_mode=auth_md5;
 cipher_mode_t cipher_mode=cipher_aes128cbc;
 int is_hmac_used=0;
 
+int aes128cfb_old=0;
+
 //TODO key negotiation and forward secrecy
 
 int my_init_keys(const char * user_passwd,int is_client)
@@ -361,7 +363,10 @@ int cipher_aes128cfb_encrypt(const char *data,char *output,int &len,char * key)
 		if(first_time==0) key=0;
 		else first_time=0;
 	}
-	aes_ecb_encrypt(data,buf); //encrypt the first block
+	if(!aes128cfb_old)
+	{
+	    aes_ecb_encrypt(data,buf); //encrypt the first block
+	}
 
 	AES_CFB_encrypt_buffer((unsigned char *)output,(unsigned char *)buf,len,(unsigned char *)key,(unsigned char *)zero_iv);
 	return 0;
@@ -416,9 +421,8 @@ int cipher_aes128cfb_decrypt(const char *data,char *output,int &len,char * key)
 	
 	AES_CFB_decrypt_buffer((unsigned char *)output,(unsigned char *)data,len,(unsigned char *)key,(unsigned char *)zero_iv);
 	
-	char buf[16];
-	memcpy(buf,output,16);
-	aes_ecb_decrypt(buf,output); //decrypt the first block
+	if(!aes128cfb_old)
+	    aes_ecb_decrypt1(output); //decrypt the first block
 	//if(de_padding(output,len,16)<0) return -1;
 	return 0;
 }
diff --git a/encrypt.h b/encrypt.h
index 090d7ff..079fc07 100755
--- a/encrypt.h
+++ b/encrypt.h
@@ -12,6 +12,7 @@
 //extern char key[16];
 
 const int aes_key_optimize=1; //if enabled,once you used a key for aes,you cant change it anymore
+extern int aes128cfb_old;
 
 int my_init_keys(const char *,int);
 
diff --git a/misc.cpp b/misc.cpp
index 9a82977..33ba7e2 100644
--- a/misc.cpp
+++ b/misc.cpp
@@ -563,6 +563,13 @@ void process_arg(int argc, char *argv[])  //process all options
 			}
 			else if(strcmp(long_options[option_index].name,"cipher-mode")==0)
 			{
+				string s=optarg;
+				if(s=="aes128cfb_0")
+				{
+					s="aes128cfb";
+					aes128cfb_old=1;
+					mylog(log_warn,"aes128cfb_0 is used\n");
+				}
 				for(i=0;i<cipher_end;i++)
 				{
 					if(strcmp(optarg,cipher_mode_tostring[i])==0)