Re: Encrypted Glib::ustring(s)



El 23 de novembre de 2011 10:03, Povietkin Kostiantyn
<povetkin k gmail com> ha escrit:
> В Вто, 22/11/2011 в 21:55 +0100, Glus Xof пишет:
>> Hi guys,
>>
>>
>> In the past, I already wrote you about this subjet... but it's not
>> really solved at all.
>>
>> The question is that sometimes, when I try to send encrypted messages
>> throw socket connections using the low-level gio socket objects, the
>> received messages are broken, uncomplete.
>>
>> I wonder if it's due to any specifical bit sequence... but, I haven't
>> enough knowledge to test and find the ultimate solution.
>>
>> So, with respect and very consideration of your work, I'd like to
>> propose for the community to implement the following...
>>
>> enum METHOD
>> {
>>       Glib::ENCRYPT_AES256
>>       Glib::ENCRYPT_AES128
>>       [...]
>> };
>>
>> Glib::ustring::encrypt (ENCRYPT_METHOD method, Glib::ustring passphrase);
>> Glib::ustring::decrypt (ENCRYPT_METHOD method, Glib::ustring passphrase);
>>
>> gsize Gio::Socket->send (Glib::ustring);
>> Glib::ustring Gio::Socket->receive(gsize size);
>>
>> What do you think about it? Is it possible ?
>>
> It`s possible, but it`s a wrong way. In my opinion:
> 1. If there are any problems with data transfer, you should double -
> check your code. May be you should you TCP instead of UDP.

I create the sockets using the Gio::SOCKET_TYPE_STREAM value for
Gio::SocketType... Is it good ?


> 2. There is no consistent way to make this possible:
>        Glib::ustring Gio::Socket->receive(gsize size)
> Data transferring over media( network ) is a bit stream, so a developer
> have to control what type of data is this stream( network protocol );

I understand the logic of the bit stream network transferring... but
what I don't understand here is why the stream values are stored in
byte oriented vars (pointer to char) instead of a bit (for example, a
pointer to bool...). Maybe, the problem of my broken strings could be
due of this.

(If the content of messages goes away from the subject of this list,
we can speak in private)

Glus


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]