-
Path: news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!new
sfeed.neostrada.pl!atlantis.news.neostrada.pl!news.neostrada.pl!not-for-mail
From: Real Hacker <r...@m...com>
Newsgroups: pl.comp.programming
Subject: Re: Zaszyfrowane CAPICOMem, jak odszyfrować CryptoAPI?
Date: Thu, 10 Sep 2009 22:13:35 +0200
Organization: TP - http://www.tp.pl/
Lines: 86
Message-ID: <h8bmpq$fu4$3@atlantis.news.neostrada.pl>
References: <h85ihs$1tj4$1@news2.ipartners.pl>
NNTP-Posting-Host: 80.50.128.222
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-2; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: atlantis.news.neostrada.pl 1252613754 16324 80.50.128.222 (10 Sep 2009
20:15:54 GMT)
X-Complaints-To: u...@n...neostrada.pl
NNTP-Posting-Date: Thu, 10 Sep 2009 20:15:54 +0000 (UTC)
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
In-Reply-To: <h85ihs$1tj4$1@news2.ipartners.pl>
X-Antivirus: avast! (VPS 090910-0, 2009-09-10), Outbound message
X-Antivirus-Status: Clean
Xref: news-archive.icm.edu.pl pl.comp.programming:183473
[ ukryj nagłówki ]gosmo pisze:
> Witam, mam zaszyfrowane dane poniższym kodem:
> EncryptedData := CreateOleObject('CAPICOM.EncryptedData');
> try
> EncryptedData.Algorithm.KeyLength :=
> CAPICOM_ENCRYPTION_KEY_LENGTH_40_BITS;
> EncryptedData.Algorithm.Name := CAPICOM_ENCRYPTION_ALGORITHM_3DES;
> EncryptedData.Content := AString;
> EncryptedData.SetSecret(ASecret);
> Result := EncryptedData.Encrypt;
> finally
> EncryptedData := Null;
> end;
>
> Aby odszyfrować to za pomocą CryptoAPI wykombinowałem takiego potworka:
>
> function DecodeWC(AString: WideString; ASecret: WideString = ''):
> WideString;
> var
> hProv : Cardinal;
> hHash : Cardinal;
> hKey : Cardinal;
> dwBlobLen : Cardinal;
> pBuffer : PByte;
> begin
> if (not CryptAcquireContext(hProv, Nil, NIL, PROV_RSA_FULL,
> CRYPT_VERIFYCONTEXT)) and (not CryptAcquireContext(hProv, Nil, Nil,
> PROV_RSA_FULL, CRYPT_VERIFYCONTEXT OR CRYPT_NEWKEYSET)) then
> RaiseLastOSError
> else
> try
> if not CryptCreateHash(hProv, CALG_MD5, 0, 0, hHash) then
> RaiseLastOSError
> else
> try
> if not CryptHashData(hHash, PByte(@ASecret[1]), Length(ASecret) * 2,
> 0) then RaiseLastOSError;
> if not CryptDeriveKey(hProv, CALG_3DES, hHash, 0, hKey) then
> RaiseLastOSError
> else
> try
>
> dwBlobLen := Length(AString) * 2;
> pBuffer := PByte(@AString[1]);
> if not CryptDecrypt(hKey, 0, True, 0, pBuffer, dwBlobLen) then
> RaiseLastOSError;
> finally
> CryptDestroyKey(hKey);
> end;
> finally
> CryptDestroyHash(hHash);
> end;
> finally
> CryptReleaseContext(hProv, 0);
> end;
> end;
>
> Ale mimo, że używałem chyba wszystkich możliwych algorytmów hashujących to
> nadal dostaję komunikat złych danych przy CryptDecrypt.
> Jak odszyftować te dane za pomocą CryptoAPI?
>
>
>
>
>
> ---
> avast! antywirus: Przychodzace wiadomosc czysta.
> Baza sygnatur wirusow (VPS): 090910-0, 2009-09-10
> Przetestowano na: 2009-09-10 22:13:16
> avast! - copyright (c) 1988-2009 ALWIL Software.
> http://www.avast.com
>
>
>
Zaszyfruj sobie mózg, AES-em 256.
---
avast! antywirus: Wychodzace wiadomosc czysta.
Baza sygnatur wirusow (VPS): 090910-0, 2009-09-10
Przetestowano na: 2009-09-10 22:13:36
avast! - copyright (c) 1988-2009 ALWIL Software.
http://www.avast.com
Najnowsze wątki z tej grupy
- Do czego nadaje się QDockWidget z bibl. Qt?
- Bibl. Qt jest sztucznie ograniczona - jest nieprzydatna do celów komercyjnych
- Co sciaga kretynow
- AEiC 2024 - Ada-Europe conference - Deadlines Approaching
- Jakie są dobre zasady programowania programów opartych na wtyczkach?
- sprawdzanie słów kluczowych dot. zła
- Re: W czym sie teraz pisze programy??
- Re: (PDF) Surgical Pathology of Non-neoplastic Gastrointestinal Diseases by Lizhi Zhang
- CfC 28th Ada-Europe Int. Conf. Reliable Software Technologies
- Młodzi programiści i tajna policja
- Ada 2022 Language Reference Manual to be Published by Springer
- Press Release - AEiC 2023, Ada-Europe Reliable Softw. Technol.
- Ada-Europe - AEiC 2023 early registration deadline approaching
- Ada-Europe Int.Conf. Reliable Software Technologies, AEiC 2023
- Ile cykli zajmuje mnożenie liczb 64-bitowych?
Najnowsze wątki
- 2024-05-18 Warszawa => Mid PHP Developer (Laravel) <=
- 2024-05-18 Warszawa => Software .Net Developer <=
- 2024-05-18 Warszawa => Mid/Senior QA Engineer <=
- 2024-05-18 Ulm => Solution Architect (sichere Kommunikation und IoT-Loesungen <=
- 2024-05-18 Katowice => Head of Virtualization Platform Management and Operating S
- 2024-05-18 Warszawa => SAP WM Consultant / Execution <=
- 2024-05-18 Wrocław => Consultant/Implementer Comarch ERP XL <=
- 2024-05-18 Gdańsk => Head of International Freight Forwarding Department <=
- 2024-05-18 Warszawa => Account Manager (Recruitment Services) <=
- 2024-05-18 Łódź => Salesperson - CRM Systems <=
- 2024-05-18 Łódź => Handlowiec - Systemy CRM <=
- 2024-05-17 ZŁOMNIK o pracy w TVN TURBO, nowych przepisach i współczesnej motoryzacji. Turbo Taryfa!
- 2024-05-17 Białystok => DevOps Engineer Conexa First (Contractor) <=
- 2024-05-17 Warszawa => Starszy inżynier oprogramowania (Rust) <=
- 2024-05-17 Zabrze => Junior HelpDesk <=