ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Andrey Rahmatullin <wrar-alt@mail.ru>
To: devel@lists.altlinux.org
Subject: Re: [devel] Как восстановить пароль на jabber?
Date: Fri, 29 Sep 2006 23:34:06 +0600
Message-ID: <20060929173406.GF11060@wrars-comp.wrarsdomain> (raw)
In-Reply-To: <451D554A.5050402@ngs.ru>


[-- Attachment #1.1: Type: text/plain, Size: 523 bytes --]

On Sat, Sep 30, 2006 at 12:18:02AM +0700, Slava Semushin wrote:
> Как это сделать на шелле? Впрочем исходник на Сях я тоже пойму :)
Исходник на сях является частью сорцов пси :)

В аттаче, короче. Компилять с -I/usr/lib/qt3/include -L/usr/lib/qt3/lib -lqt-mt

-- 
WBR, wRAR (ALT Linux Team)
Powered by the ALT Linux fortune(8):

Я, конечно, осознаю, что моя точка зрения нынче не в моде,
но что общего между наглядными столбиковыми диаграммами
и полным контролем за состоянием батарей?
		-- ldv in community@

[-- Attachment #1.2: psidec.cpp --]
[-- Type: text/plain, Size: 1204 bytes --]

#include <qstring.h>
#include <iostream>

int hexChar2int(char c)
{
        if(c >= 'A' && c <= 'F')
                return c - 'A' + 10;
        else if(c >= 'a' && c <= 'f')
                return c - 'a' + 10;
        else if(c >= '0' && c <= '9')
                return c - '0';

        return 0;
}

QString decodePassword(const QString &pass, const QString &key)
{
        QString result;
        unsigned int n1, n2;

        if(key.length() == 0)
                return pass;

        for(n1 = 0, n2 = 0; n1 < pass.length(); n1 += 4) {
                ushort x = 0;
                if(n1 + 4 > pass.length())
                        break;
                x += hexChar2int(pass.at(n1))*4096;
                x += hexChar2int(pass.at(n1+1))*256;
                x += hexChar2int(pass.at(n1+2))*16;
                x += hexChar2int(pass.at(n1+3));
                QChar c(x ^ key.at(n2++).unicode());
                result += c;
                if(n2 >= key.length())
                        n2 = 0;
        }
        return result;
}

int main()
{
    QString q = decodePassword("хэш из конфига", "JID");
    std::cout << q.local8Bit() << std::endl;
}

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 191 bytes --]

  reply	other threads:[~2006-09-29 17:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-29 16:57 Slava Semushin
2006-09-29 17:15 ` Andrey Rahmatullin
2006-09-29 17:18   ` Slava Semushin
2006-09-29 17:34     ` Andrey Rahmatullin [this message]
2006-09-29 18:44       ` Slava Semushin
2006-09-29 18:55         ` Slava Semushin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060929173406.GF11060@wrars-comp.wrarsdomain \
    --to=wrar-alt@mail.ru \
    --cc=devel@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git