-
Content Count
112 -
Joined
-
Last visited
-
Days Won
1
Posts posted by Ugochukwu Mmaduekwe
-
-
Hi all.
Does anyone have some sample code on how I can send email from Gmail in my Delphi App using OAuth 2.0 via Indy?
Thanks.
-
3 hours ago, PeterPanettone said:Does anybody know the location for the DELPHI ISO download? (Without C++). I seem to remember that previous versions had this opportunity.
Only if you use the web installer.
The ISO installer has always contained the Delphi and C++ Builder Installers in one.
- 1
-
On 9/22/2019 at 8:12 AM, ertank said:I am looking for a free AES256-CBC FMX compatible solution that I can pass IV and Key values manually.
1 hour ago, Jose Morango said:HI,
Try Tms CryptoGrapy Pack, runs on VCL, FMX, I'm using it on my android and iOS apps adn it work just fine.
Note the key word free in the original poster question.
-
-
8 minutes ago, Thijs van Dien said:If you can get away with its limited functionality (which is sort of the point), just use libsodium.
Correct me if I am wrong but this will require him to port the headers first of all because the ones I see online are not crossplatform?
-
Hi Ivana and welcome to the forum.
To answer your question, CryptoLib4Pascal is the complete package and more.The hashes you requested and more can be found here
sample for generating Key Pairs with Elliptic curves, signing and verifying can be found here and here
AES and Chacha20 sample here
Perks of CryptoLib4Pascal
Constantly developed and improved
Cross Platform and Cross Compiler support
used in the real world on various products
uses the friendly MIT License
Best of all, it's free.
- 3
- 1
-
NumCPULib4Pascal is a Cross Platform Pascal library to query the number of CPUs (Logical (logical processors) and Physical (cores)) on a machine.
Usage
Add
NumCPULib
to uses clause:uses NumCPULib; var lcc, pcc: Int32; begin // count logical cpus (aka logical processors) lcc := TNumCPULib.GetLogicalCPUCount(); // count physical cpus (aka cores) pcc := TNumCPULib.GetPhysicalCPUCount(); end;
What is the difference between the existing
System.CPUCount
andNumCPULib4Pascal
?1.
System
.CPUCount
only reports the LogicalCPU Count (aka logical processors), it has no option to report the PhysicalCPU Count (cores).2.
System
.CPUCount
will not report the correct value on windows systems with more than 64 logical processors. NumCPULib4Pascal
fixes this by queryingGetLogicalProcessorInformationEx
on these OSes.GitHub Repository
- 3
- 1
-
4 hours ago, plastkort said:hi!
I have been playing with the tought on playing with websockets and rest API. i got the documentation on how to connect but encrypion stuff is hard to swallow, is there any tricks on how to solve this little easter egg ?
var
param_str : string;
secret : string;
begin
Secret := 't7T0YlFnYXk0Fx3JswQsDrViLg1Gh3DUU5Mr';
param_str := 'api_key=B2Rou0PLPpGqcU0Vu2&leverage=100&symbol=BTCUSD×tamp=1542434791000';
sign := hex(HMAC_SHA256($secret, $param_str));
end;
result should be
sign = 670e3e4aa32b243f2dedf1dafcec2fd17a440e71b05681550416507de591d908
any solution is OK, but cannot affford anything that costs...
help 🤪🤪
if you use Berlin upwards, you can use the inbuilt version found here else you can try the code below. you will need this library though
program SimpleHMAC; uses SysUtils, HlpHashFactory; var param_str, secret, sign: string; begin try secret := 't7T0YlFnYXk0Fx3JswQsDrViLg1Gh3DUU5Mr'; param_str := 'api_key=B2Rou0PLPpGqcU0Vu2&leverage=100&symbol=BTCUSD×tamp=1542434791000'; sign := THashFactory.THMAC.CreateHMAC(THashFactory.TCrypto.CreateSHA2_256(), TEncoding.UTF8.GetBytes(secret)).ComputeString(param_str, TEncoding.UTF8).ToString(); WriteLn(LowerCase(sign)); ReadLn; except raise; end; end.
-
18 minutes ago, Clément said:For this project I must use Delphi XE. Unfortunately most free implementation are not fast enough and/or depends on DLLs.
Well, have you tried Mormot's implementation?
https://github.com/synopse/SynPDF/blob/master/SynCrypto.pas
You can also try HashLib4Pascal if you want.
https://github.com/Xor-el/HashLib4Pascal/
Also you can try out Wolfgang Ehrhardt aka Gammatester (RIP) excellent Hash libraries which contains HMAC implementations too.
http://www.wolfgang-ehrhardt.de/crchash_en.html
These are guaranteed to work on Delphi 2010 and above and don't require any external DLLs for as long as I remember.
- 1
-
@Clément, To be sincere, I tend to keep pointer constructs to a minimum (to be on the safe side) since the size of integers varies on a various platforms supported by Delphi.
Also any reason why you reimplemented HMAC when it is supported in modern Delphi versions?
-
Just now, Mike Margerum said:I may try it on windows and if it works ok i may try it there. i'd imagine 95% of my target demo would be windows users anyway. I'm really on the fence here whether to uses something native (lazarus, QT, wxWindows) or just go pure web. The web stuff is, at this point, a superior development experience but these frameworks get rewritten every few years and I build software that runs for decades. Maybe thats just not possible anymore
Well I use Lazarus on Windows and Linux and it is quite stable (especially on Linux), I think the issue you are experiencing may be related to just Mac OSX.
Can you try to install the trunk version using fpcdeluxe? Your issue might have been fixed there.
-
5 hours ago, Mike Margerum said:I installed lazarus today out of disgust and found a bug with the second control i dropped on a form on the mac. not a good sign,
32 or 64bit Lazarus?
Trunk or stable release?
-
15 minutes ago, ŁukaszDe said:Yes, this is the solution.
So If I want to use class properties in loops, I need add 'inline' to Get and Set methods?
Inline is a way to hint the compiler to avoid calling a method and instead take the contents of that method and place it at the call site.
-
This might have something to do with newer OpenSSL Dlls switching from using the Legacy CryptoAPI to using BCryptGenRandom for generating OS Random numbers.
-
45 minutes ago, AlekXL said:Whatever it takes to set the record straight.
Lol, at least we now agree on a common fact that for now Delphi doesn't have a PurePascal EdDSA implementation.
- 1
-
9 hours ago, AlekXL said:Because they are thin wrappers around C/C++ FFMpeg or some other C/C++ library or web browser runtime. All dirty work is hidden.. Delphi isn't meant to build thin wrappers, apparently. And many of those who write .NET and Js -- are barely aware what is memory leak, how to prevent it, or investigate .. that's beyond their mindset, thanks to learning managed languages from youth.
Seems you have made up your mind that nothing good and optimal can come out of non native code.
In this case, there is very little I can say to convince you otherwise.
By the way, the current media player I use is written in JavaScript and it runs beautifully for me on both my Windows and Linux boxes.
- 1
-
9 hours ago, AlekXL said:But did edwinyzh just proved that you are partially wrong? I asked you to be factual, and now ask it again -- you named Edwards curves, and here we have some implemented. Now please clarify further, what "Edwards curves" Delphi lacking, and why those lacking are important (where they used)?
Really? Do we have to go down this road again?
ECDSA (Elliptical Curve DSA) <> EdDSA (Edwards Curve DSA).
It has a lot of use cases as ECDSA and it is been used in Monero and Nano to mention but a few.
- 2
-
12 minutes ago, AlekXL said:Surely you wouldn't write a media player on python, would you? Even .Net is bad option? And java? On Android, yes, maybe, but what's the point writing yet another crappy player on Java.
Really?
I have seen highly performant programs including media players written in .NET and even JavaScript.
- 1
-
4 hours ago, edwinyzh said:I'm no expert in the crypto field, how's the SynECC unit?
This implements just ECDSA using only secp256r1 curve.
-
-
9 minutes ago, AlekXL said:https://github.com/Xor-el/CryptoLib4Pascal rings any bells?
isn't it your project?
Yes It is my project and no it doesn't implement Edwards curves.
- 1
-
49 minutes ago, AlekXL said:Which algorithm or hash Delphi is lacking?
Asymmetric Cryptography especially stuffs involving elliptical curves like Edwards curves.
-
5 minutes ago, Alexander Elagin said:I wonder if Sternas Stefanos (CodeTyphon, you know) considered this option. As far as I can see, his CT bundle uses FPC trunk.
Unfortunately, the CodeTyphoon team seems more focused on the IDE than the compiler.
-
6 hours ago, AlekXL said:1. Any company invested in developing a product written in Delphi and confronting some compiler issue would hire skilled developer to fix it.
2. Be factual, and name the libraries Delphi lacking. And also, Delphi can utilize C/C++ libraries.
1. Invest enough to cover the cost of further development and improvements to the compiler? At what gain? It's not like the Delphi ecosystem is really booming.
2. An example of such are Cryptographic Libraries and please don't tell me that Delphi can utilize C/C++ libraries because you and I know how unfriendly that can be (especially finding already compiled libraries for other platforms other than windows) coupled with the problem of distributing the extra binary files.
Using C++ libraries was ok at a time when Delphi was Windows only but please we are in the Cross Platform era now.
And please do note that I am referring to free OpenSource maintained libraries not closed source sharewares.
Sending Email via GMail Using OAuth 2.0 via Indy
in Indy
Posted · Edited by Ugochukwu Mmaduekwe
Any help please? @Remy Lebeau