jvds Posted November 12, 2015 Share Posted November 12, 2015 i'm working on a simple chat client so i can chat direcly ip <--> ip but i want to log my chats and encrypt them, I don't want to create a log and encrypt every msg separately (creating a patern in the logs)i was trying to understand the _Crypt_EncryptData func with the false flag but fail to understand it, here is encryption test $vCryptKey = "CryptPassword" $iAlgID = $CALG_AES_128 _Crypt_Startup() $vCryptKey = _Crypt_DeriveKey($vCryptKey, $iAlgID) $EncryptData = "" for $x=1 to 3 $data = random(100,999,1)&"-" ;some random data to simulate a stream of data $EncryptData &= _Crypt_EncryptData($data, $vCryptKey, $CALG_USERKEY, False) if @error then ConsoleWrite('@error='&@error&" @extended"&@extended &@lf) Sleep(1000) Next ConsoleWrite('$EncryptData='&$EncryptData&@lf) ;decrypt $sOutput $DecryptData = _Crypt_DecryptData($EncryptData, $vCryptKey, $CALG_USERKEY) ConsoleWrite('$DecryptData='&$DecryptData&@lf) _Crypt_DestroyKey($vCryptKey) _Crypt_Shutdown() Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now