[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kmail-devel
Subject:    Re: kmail password character encoding
From:       Ingo =?iso-8859-1?q?Kl=F6cker?= <kloecker () kde ! org>
Date:       2005-10-27 21:18:57
Message-ID: 200510272318.58150 () erwin ! ingo-kloecker ! de
[Download RAW message or body]

[Attachment #2 (multipart/signed)]

[Attachment #4 (multipart/mixed)]


On Thursday 27 October 2005 10:57, Juraj Holtak wrote:
> I`m trying to crypt/decrypt kmail passwords, so I can configure kmail
> for all *many many* users at once (using a password list)
>
> I know the algorithm for de/encryption
>
> X = 287 - C
>
>  but kmail seams to use some kind of character encoding right after
> the encryption. Encrypted string are about 3-times longer and every
> encrypted character has two preceeding characters, which are almost
> everytime the same.
>
> What encoding is it? I tried with UTF8 but without success or I did
> something wrong.
> Can somebody point me to the right place in the sourcecode so I can
> figure out for myselves?

See attachment. (encryptStr() can also be used for decryption.) It 
shouldn't be difficult to write a tiny application which reads the 
password from stdin and writes the encoded password to stdout. The 
config file contains the utf-8 encoded version of the result of 
encryptStr().

Regards,
Ingo

["decryptkmailpasswd.cpp" (text/x-c++src)]

#include <stdio.h>
#include <qstring.h>

QString encryptStr(const QString &aStr)
{
  QString result;
  for (uint i = 0; i < aStr.length(); i++)
    result += (aStr[i].unicode() < 0x20) ? aStr[i] :
      QChar(0x1001F - aStr[i].unicode());
  return result;
}

int main() {
  QString passwd = QString::fromUtf8( "PASSWORT" );
  printf( "Das Passwort lautet (in local encoding): %s\n", encryptStr( passwd ).local8Bit().data() );
  printf( "Das Passwort lautet (in utf-8): %s\n", encryptStr( passwd ).utf8().data() );
  printf( "Das Passwort lautet (in latin1): %s\n", encryptStr( passwd ).latin1() );

  return 0;
}

[Attachment #8 (application/pgp-signature)]

_______________________________________________
KMail developers mailing list
KMail-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmail-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic