|
|
|
@ -31,34 +31,34 @@ const TQString Encryption::crypt( const KURL& url )
|
|
|
|
|
|
|
|
|
|
memset (result, 0, 50);
|
|
|
|
|
memset (scramble2, 0, 50);
|
|
|
|
|
int pos = url.pass().length () + 1;
|
|
|
|
|
int pos = url.pass().utf8().length() + 1;
|
|
|
|
|
unsigned int free = 50 - pos;
|
|
|
|
|
|
|
|
|
|
if( url.user().length() <= free )
|
|
|
|
|
if( url.user().utf8().length() <= free )
|
|
|
|
|
{
|
|
|
|
|
strcpy( &scramble2[pos], url.user() );
|
|
|
|
|
pos += url.user().length();
|
|
|
|
|
free -= url.user().length();
|
|
|
|
|
strcpy( &scramble2[pos], url.user().utf8() );
|
|
|
|
|
pos += url.user().utf8().length();
|
|
|
|
|
free -= url.user().utf8().length();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
memcpy( &scramble2[pos], url.user().latin1(), free );
|
|
|
|
|
memcpy( &scramble2[pos], url.user().utf8(), free );
|
|
|
|
|
free = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( url.host().length() <= free )
|
|
|
|
|
if( url.host().utf8().length() <= free )
|
|
|
|
|
{
|
|
|
|
|
strcpy( &scramble2[pos], url.host() );
|
|
|
|
|
pos += url.host().length();
|
|
|
|
|
free -= url.host().length();
|
|
|
|
|
strcpy( &scramble2[pos], url.host().utf8() );
|
|
|
|
|
pos += url.host().utf8().length();
|
|
|
|
|
free -= url.host().utf8().length();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
memcpy( &scramble2[pos], url.host().latin1(), free );
|
|
|
|
|
memcpy( &scramble2[pos], url.host().utf8(), free );
|
|
|
|
|
free = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
memcpy( result, url.pass().latin1(), url.pass().length() );
|
|
|
|
|
memcpy( result, url.pass().utf8(), url.pass().utf8().length() );
|
|
|
|
|
for (int i = 0; i <= 31; i++)
|
|
|
|
|
{
|
|
|
|
|
result[i] = (char)( result[i] ^ ( scramble1[i] ^ scramble2[i] ) );
|
|
|
|
@ -81,5 +81,5 @@ const TQString Encryption::decrypt( const TQString& pass )
|
|
|
|
|
result[i] = (char)( result[i] ^ scramble1[i] );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
return TQString::fromUtf8(result);
|
|
|
|
|
}
|
|
|
|
|