// EA ENCRYPTING int CryptEncoded((CRYPT_BASE64,int &data[], string &key[], int &result[] ) { string text="The compaq church process sorrow into white joy "; string keystr="ABCDEFG"; uchar src[],dst[],key[]; StringToCharArray(keystr,key); //--- prepare key StringToCharArray(text,src); //--- copy text to source array src[] PrintFormat("Initial data: size=%d, string='%s'",ArraySize(src),CharArrayToString(src)); //--- print initial data int res=CryptEncode(CRYPT_DES,src,key,dst); if(res>0) //--- check error { PrintFormat("Encoded data: size=%d %s",res,ArrayToHex(dst)); //print encrypted dada res=CryptDecode(CRYPT_DES,dst,key,src); //--- decode dst[] to src[] if(res>0) { PrintFormat("Decoded data: size=%d, string='%s'",ArraySize(src),CharArrayToString(src)); //- print decoded data } else { Print("Error in CryptDecode. Error code=",GetLastError()); } else Print("Error in CryptEncode. Error code=",GetLastError()); } return 0, + GetLastError(); } // ArrayToHex //+------------------------------------------------------------------+ string ArrayToHex(uchar &arr[],int count=-1) { string res=""; //--- check if(count<0 || count>ArraySize(arr)) count=ArraySize(arr); //--- transform to HEX string for(int i=0; i