Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi uses JwaWinCrypt für RDC / wo finde ich das (https://www.delphipraxis.net/94044-uses-jwawincrypt-fuer-rdc-wo-finde-ich-das.html)

Jerry 15. Jun 2007 07:29


uses JwaWinCrypt für RDC / wo finde ich das
 
Ich möchte aus Delphi den Remote Desktop Client (RDC) aufrufen. Zu diesem Aufruf möchte ich das Passwort hinterlegen können. Dazu habe ich bereits folgenden Eintrag gefunden, siehe unten, aber dieses JwaWinCrypt finde ich einfach nicht... :-(. Kann mir jemand helfen wo das zu finden ist (habe bereits über google gesucht). Vielen Dank für Eure Hilfe.

Delphi-Quellcode:
uses JwaWinCrypt;

function CryptRDPPassword(sPassword: string): string;
var DataIn: DATA_BLOB;
    DataOut: DATA_BLOB;
    pwDescription: PWideChar;
    P: PByte;
    I: Integer;
    PwdHash: string;
begin
  PwdHash := '';

  DataOut.cbData := 0;
  DataOut.pbData := nil;

  // RDP uses UniCode
  DataIn.pbData := Pointer(WideString(sPassword));
  DataIn.cbData := Length(sPassword) * SizeOf(WChar);

  // RDP always sets description to psw
  pwDescription := WideString('psw');

  if CryptProtectData(@DataIn,
                      pwDescription,
                      nil,
                      nil,
                      nil,
                      CRYPTPROTECT_UI_FORBIDDEN, // Never show interface
                      @DataOut) then
  begin
    // Convert the DataBlob to Hex String
    P := DataOut.pbData;
    I := DataOut.cbData;

    PwdHash := '';
    while (I > 0) do begin
      Dec(I);
      PwdHash := PwdHash + IntToHex(P^, 2);
      Inc(P);
    end;
  end;

  Result := PwdHash;

  // Cleanup
  pwDescription := nil;
  LocalFree(Cardinal(DataOut.pbData));
  LocalFree(Cardinal(DataIn.pbData));

end;
[edit=Matze][delphi]-Tags repariert. MfG, Matze[/edit]

MagicAndre1981 15. Jun 2007 07:40

Re: uses JwaWinCrypt für RDC / wo finde ich das
 
Die Unit ist Teil der JEDI API Library. Diese bekommst du hier:

http://jedi-apilib.sourceforge.net/

Jerry 15. Jun 2007 07:43

Re: uses JwaWinCrypt für RDC / wo finde ich das
 
danke für den Tipp. War auf der Seite, welche Datei muss ich jetzt genau herunterladen, wie wird diese implementiert.
Sorry check das nicht ganz.

Danke!!

Jerry 15. Jun 2007 07:46

Re: uses JwaWinCrypt für RDC / wo finde ich das
 
habs gefunden!

vielen Dank!

Remko 17. Jun 2007 08:02

Re: uses JwaWinCrypt für RDC / wo finde ich das
 
It always amazes me that the Jedi Apilib project is unknown for many people. Perhaps we can a sticky post of what is and where to find it (Can one of the Mods take care of this)?

Thank you!


Alle Zeitangaben in WEZ +1. Es ist jetzt 15:44 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz