Print Page | Close Window

ECC Key Generation Linux

Printed From: TMS Software
Category: VCL Components
Forum Name: VCL / FMX Cryptography Pack
Forum Discription:
URL: http://www.tmssoftware.com/site/forum/forum_posts.asp?TID=12898
Printed Date: 24 Aug 2019 at 3:54pm


Topic: ECC Key Generation Linux
Posted By: Schumann Michael
Subject: ECC Key Generation Linux
Date Posted: 20 Jan 2019 at 11:11pm
Hello,

This code beglow works in OSX and WIndows perfectly, it hangs infinitively when run in Linux. Can you help, please? Thanks in advance!

Michael

var
  ecc: TEccEncSign;
begin
  ecc := TEccEncSign.create(nil);
  try
    ecc.eccType := cc25519;
    ecc.outputFormat := base64;
    ecc.GenerateKeys;
    pubkey := ecc.PublicKey;
    privkey := ecc.privatekey;
  finally
    ecc.Free;
  end;





Replies:
Posted By: Marion Candau
Date Posted: 21 Jan 2019 at 2:54pm
Hi,
The problem is that RandomBuffer in Linux is waiting for entropy to run because it calls /dev/random. I will change that to /dev/urandom to not being blocked. I will release a new version in the next days.
Best regards,
Marion


Posted By: Schumann Michael
Date Posted: 21 Jan 2019 at 4:03pm
Thanks, you guys are awsome!


Posted By: Schumann Michael
Date Posted: 31 Jan 2019 at 8:32pm
Hi, I installed the latest version (as of 24.1.) but unfortunately key generation still hangs run on the latest ubuntu server 64bit. Would you mind looking into it once more?


Posted By: Marion Candau
Date Posted: 01 Feb 2019 at 9:21am
Hi,
I have just tested on Ubuntu 64-bit server 16.04 and it works on it. In the latest version, I have just changed the libTMSCPlib.a file in libLinux folder. Maybe there was an issue with the update of this file!?
I will check that.
Best regards,
Marion


Posted By: Marion Candau
Date Posted: 01 Feb 2019 at 10:03am
Do you have the 3.3.2.1 version of TMS Cryptography Pack?
Marion


Posted By: Schumann Michael
Date Posted: 01 Feb 2019 at 2:11pm
Hello Marion, 
yes, I use 3.3.2.1. 
Best regards
Michael


Posted By: Schumann Michael
Date Posted: 02 Feb 2019 at 6:13pm
Hello Marion,

ECC may not be the problem any more but the update introduced a new problem. I have a big bunch of unit tests running on my foundation classes and they ran fine in Linux in the last version when I commented out the ECC stuff, WIndows and OSX are fine with everything. 

With Version 3.3.2.1 AES decryption has a Problem. I encrypt "Penner17" and get "enner17#0#0#0...." as a result using the same routines like before and only in Linux. 

Would you mind looking into that once more?

Best regards,

Michael



Posted By: Marion Candau
Date Posted: 04 Feb 2019 at 11:32am
Hello,
Linux is a particular platform for us, because we cannot use PAnsiChar on it (as in Windows or MacOS) but it is a desktop platform so string index begins to 1 and not 0. That is why there could be more bugs than on other platforms.
I have fixed the bug, I will release a new version soon.
Best regards,
Marion


Posted By: Schumann Michael
Date Posted: 04 Feb 2019 at 12:11pm
Thanks a lot. I love the TMS cryptography pack! Linux indeed involves a lot more effort in Delphi, I also experienced that in my development.

Best regards
Michael


Posted By: Schumann Michael
Date Posted: 04 Feb 2019 at 1:41pm
If I can help by testing at least the ECC and AES parts, I just have to include it in my automated Unit Tests going across Ubuntu Server, Windows and OSX Mojave Machines on my Servers.


Posted By: Schumann Michael
Date Posted: 05 Feb 2019 at 9:12pm
Thanks for fixing everything this fast. 



Print Page | Close Window