legacydecrypt.cpp

00001 /*
00002     Copyright (c) 2007 Volker Krause <vkrause@kde.org>
00003 
00004     KNode code:
00005     Copyright (c) 1999-2005 the KNode authors. // krazy:exclude=copyright
00006 
00007     This library is free software; you can redistribute it and/or modify it
00008     under the terms of the GNU Library General Public License as published by
00009     the Free Software Foundation; either version 2 of the License, or (at your
00010     option) any later version.
00011 
00012     This library is distributed in the hope that it will be useful, but WITHOUT
00013     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00015     License for more details.
00016 
00017     You should have received a copy of the GNU Library General Public License
00018     along with this library; see the file COPYING.LIB.  If not, write to the
00019     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00020     02110-1301, USA.
00021 */
00022 
00023 #include "legacydecrypt.h"
00024 
00025 #include <KStringHandler>
00026 
00027 using namespace MailTransport;
00028 
00029 QString Legacy::decryptKMail( const QString &data )
00030 {
00031   return KStringHandler::obscure( data );
00032 }
00033 
00034 QString Legacy::decryptKNode( const QString &data )
00035 {
00036   uint i, val, len = data.length();
00037   QString result;
00038 
00039   for ( i = 0; i < len; ++i ) {
00040     val = data[i].toLatin1();
00041     val -= ' ';
00042     val = ( 255 - ' ' ) - val;
00043     result += QLatin1Char( (char)( val + ' ' ) );
00044   }
00045 
00046   return result;
00047 }
KDE Home | KDE Accessibility Home | Description of Access Keys