Jump to content

ertank

Members
  • Content Count

    81
  • Joined

  • Last visited

Community Reputation

3 Neutral

Technical Information

  • Delphi-Version
    Delphi 10.3 Rio

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. ertank

    AES Encryption - FMX

    I could use CryptoLib4Pascal cross-platform successfully with help from @Ugochukwu Mmaduekwe My test code looks like following: uses System.NetEncoding, ClpIBufferedCipher, ClpCipherUtilities, ClpIParametersWithIV, ClpParametersWithIV, ClpParameterUtilities; procedure TForm2.Button1Click(Sender: TObject); var Cipher: IBufferedCipher; KeyParametersWithIV: IParametersWithIV; KeyBytes: TBytes; IVBytes: TBytes; Buf: TBytes; PlainText: TBytes; begin KeyBytes := [31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32]; IVBytes := [31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36]; PlainText := TEncoding.UTF8.GetBytes(Edit1.Text); Cipher := TCipherUtilities.GetCipher('AES/CBC/PKCS7PADDING'); KeyParametersWithIV := TParametersWithIV.Create(TParameterUtilities.CreateKeyParameter('AES', KeyBytes), IVBytes); Cipher.Init(True, KeyParametersWithIV); // init encryption cipher Buf := Cipher.DoFinal(PlainText); Edit2.Text := TNetEncoding.Base64.EncodeBytesToString(Buf); end; One who wants to use framework needs to put all directories & sub directories in Library Path, or use provided run-time packages. I did the former.
  2. ertank

    AES Encryption - FMX

    It is just there are internal references and functions using that type. Moreover, it includes about 65kb big commonly used unit that needs a lot more modifications than converting AnsiString that I don't want to dig into.
  3. ertank

    AES Encryption - FMX

    I heard about it. Did not give it a try yet.
  4. ertank

    AES Encryption - FMX

    I mostly use mORMot for my AES handling. Even it compiles on Linux FPC and Raspberry Pi, it doesn't compile for FMX. First compiler complaint is about AnsiString type. I tried pure Pascal Wolfgang Ehrhardt library and compiler is not happy with internal used type declarations in BType.pas file like type Str255 = string[255]; So I'm asking for help from anyone who used an AES encryption under FMX.
  5. ertank

    AES Encryption - FMX

    Hello, There seems to be a lot of VCL based free solutions. I could not find one for FMX platform. I am looking for a free AES256-CBC FMX compatible solution that I can pass IV and Key values manually. I installed "LockBox VCL and FMX 2.3" from GetIt package manager. It seems to take string value as Key for TLbRijndael component and does everything internally. Any help is appreciated. Thanks & regards, Ertan
  6. ertank

    Communicating RFID with APDU commands

    Unfortunately not a big help. I have read that article before posting my question in here. I do not know java language. I might use some small app running in the background just to communicate with RFID and send back my Delphi app replies for these commands though. Just not sure if that is possible. I would like Delphi to use IsoDep.transceive() in a way. Thanks for the help.
  7. Hello, I am using Delphi 10.3.2 and I have that project I need to use APDU commands communicating a Mifare card. I do not know java language. However, Android seems to have support for APDU commands for a very long time (like old versions such as 4.4 has that support). I have found following document: https://developer.android.com/reference/android/nfc/tech/IsoDep My problem is, I do not know APDU command use is possible with Delphi 10.3.2 on Android. I have found only one blog about RFID with Delphi FMX and that is for communicating smart tags. Unfortunately not providing help on APDU usage. http://blong.com/articles/delphixe7nfc/nfc.htm I can't find any other information about Delphi FMX and APDU. I appreciate any help. Thanks & regards, Ertan
  8. ertank

    Dark theme

    That's a nice one.
  9. ertank

    Dark theme

    Wondering if it is possible to have an option to choose dark theme for forum browsing. I failed to find such an option.
  10. ertank

    TIdTCPClient - gpsd communication

    That code did work. Though, it block my main thread. I just need to modify my logic slightly and put it in a thread and call a procedure once some json is in. I will definitely use some json parser. I simply failed to get data from server to start parsing it. Thank you.
  11. ertank

    TIdTCPClient - gpsd communication

    Hello, I am using Delphi 10.3.2, Indy version: 10.6.2.5366 (default coming with Delphi). There is a gpsd daemon running on a Raspberry Pi. It is broadcasting some json strings over TCP:2947 - I can successfully establish a connection using TIdTCPClient. There is no data incoming after connection. - Send command to stream my client these json strings after connection. There is no data incoming after sending command. Memo output: Memo1 Connecting to 192.168.1.90. Connected. On the other hand; - Using Putty, I instantly get initial greeting json string right after connection without sending anything. - if I send command to stream I instantly get json string replies. Putty terminal output: {"class":"VERSION","release":"3.17","rev":"3.17","proto_major":3,"proto_minor":12} ?WATCH={"enable":true,"json":true} {"class":"DEVICES","devices":[{"class":"DEVICE","path":"/dev/ttyS0","activated":"2019-08-31T15:56:43.607Z","native":0,"bps":9600,"parity":"N","stopbits":1,"cycle":1.00}]} {"class":"WATCH","enable":true,"json":true,"nmea":false,"raw":0,"scaled":false,"timing":false,"split24":false,"pps":false} My current test code: unit uMain; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, Vcl.ExtCtrls, Vcl.StdCtrls; type TForm2 = class(TForm) IdTCPClient1: TIdTCPClient; Memo1: TMemo; Timer1: TTimer; Button1: TButton; procedure IdTCPClient1Connected(Sender: TObject); procedure IdTCPClient1Disconnected(Sender: TObject); procedure IdTCPClient1Status(ASender: TObject; const AStatus: TIdStatus; const AStatusText: string); procedure Timer1Timer(Sender: TObject); procedure Button1Click(Sender: TObject); procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); private { Private declarations } SentStreamCommand: Boolean; public { Public declarations } end; var Form2: TForm2; implementation {$R *.dfm} procedure TForm2.Button1Click(Sender: TObject); begin if Button1.Tag <> 0 then begin IdTCPClient1.Disconnect(); Button1.Caption := 'Connect'; Button1.Tag := 0; end else begin IdTCPClient1.Connect('192.168.1.90', 2947); Button1.Caption := 'Disconnect'; Button1.Tag := 1; end; end; procedure TForm2.FormCreate(Sender: TObject); begin Timer1.Enabled := False; SentStreamCommand := False; end; procedure TForm2.FormDestroy(Sender: TObject); begin if IdTCPClient1.Connected then IdTCPClient1.Disconnect(False); end; procedure TForm2.IdTCPClient1Connected(Sender: TObject); begin Timer1.Enabled := True; end; procedure TForm2.IdTCPClient1Disconnected(Sender: TObject); begin Timer1.Enabled := False; end; procedure TForm2.IdTCPClient1Status(ASender: TObject; const AStatus: TIdStatus; const AStatusText: string); begin Memo1.Lines.Add(AStatusText); end; procedure TForm2.Timer1Timer(Sender: TObject); var ReceivedText: string; begin Timer1.Enabled := False; try with IdTCPClient1 do begin if not Connected then Exit(); // read any data in if IOHandler.InputBufferIsEmpty then begin IOHandler.CheckForDataOnSource(0); IOHandler.CheckForDisconnect; if IOHandler.InputBufferIsEmpty then Exit(); ReceivedText := IOHandler.AllData(); if ReceivedText <> EmptyStr then Memo1.Lines.Add(ReceivedText); end; // if not already, send streaming command if not SentStreamCommand then begin IdTCPClient1.IOHandler.WriteLn('?WATCH={"enable":true,"json":true}'); SentStreamCommand := True; Exit(); end; end; finally if IdTCPClient1.Connected then Timer1.Enabled := True; end; end; end. I would like to understand what I am doing wrong. My main purpose is to read each json string separately as they are incoming one per line. I appreciate any help, please. Thanks & regards, Ertan
  12. ertank

    IDE changes monitor when debug run

    I also vote for that. As that will also keep the monitor IDE runs.
  13. ertank

    IDE changes monitor when debug run

    Monitor where you save layout is stored now. My part, I do not want it to store that.
  14. Hello, Everybody has own needs. Working on a multi-monitor system. I do not want to have IDE jump from one monitor to other when I start debugging. I failed to find a report about that and add one myself. https://quality.embarcadero.com/browse/RSP-25646 It is indicated to be under consideration. I would like if you choose to vote for it. I do strongly believe that will help people working using Delphi on a multi-monitor systems. Thanks & regards, Ertan
  15. I finally got a regular HDD (spin drive) and when using it compilation works. It also gives errors like above, but so rare that you can ignore them. All SMART checks on all drives are good. Now, I wonder if it is Windows 10 thing appeared with its latest update or something. I still cannot find a reason why creating files on disk fails or why it cannot find existing files.
×