Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  35     // psi-0.12/src/common.cpp:113:QString encodePassword(const QString &pass, const QString &key)
  2.  36     QString encodePassword(const QString &pass, const QString &key)
  3.  37     {
  4.  38             QString result;
  5.  39             int n1, n2;
  6.  40
  7.  41             if(key.length() == 0)
  8.  42                     return pass;
  9.  43
  10.  44             for(n1 = 0, n2 = 0; n1 < pass.length(); ++n1) {
  11.  45                     ushort x = pass.at(n1).unicode() ^ key.at(n2++).unicode();
  12.  46                     QString hex;
  13.  47                     hex.sprintf("%04x", x);
  14.  48                     result += hex;
  15.  49                     if(n2 >= key.length())
  16.  50                             n2 = 0;
  17.  51             }
  18.  52             return result;
  19.  53     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement