TurboMagic
Members-
Content Count
242 -
Joined
-
Last visited
-
Days Won
9
Everything posted by TurboMagic
-
Hello, thanks for this implementation and your effort doing it! I have saved the stuff locally so I will include, this as soon as time permits, into the development branch in some form. I need to look at this HMAC stuff myself first (today I've got lack of time) and then decide where to put it. Your test will have to be changed into a DUnit test. And I would put your name Kas Ob. into the list of contributors contained in the project if you don't object. Thanks TurboMagic
- 35 replies
-
- encryption
- decryption
-
(and 2 more)
Tagged with:
-
Not sure, but the hash classes support KDF2. After fixing bugs even KDF1 and 3.
- 35 replies
-
- encryption
- decryption
-
(and 2 more)
Tagged with:
-
Another solution would be DEC: Delphi Encryption Compendium. Freely available in GitHub. https://github.com/MHumm/DelphiEncryptionCompendium Two FMX based demos are even in Google Play: DEC Cipher Demo and DEC Hash Demo. A Lite version containing the hashes only is in GetIt now as well. EMBT doesn't want Crypto there due to export rules...
-
Hello, here's a small Christmas present for you: There is a new release 6.0 of DEC - Delphi Encryption Compendium available, or put otherwise: DEC is back on track! 😉 The release can be found here: https://github.com/MHumm/DelphiEncry...eases/tag/V6.0 What is DEC? DEC is the Delphi Encryption Compendium open source library, a library containing cryptographic algorithms of the following categories: hash algorithms encryption algorithms key deviation functions CRC cryptographic pseudo random number generator format conversion classes What's new in V6.0 compared with the 5 year old V5.2 release? A complete list can be found in the last chapter of the included documentation. Supports D2009 - 10.4.1 Sydney Cross platform compatible if you turn off use of ASM in DECOptions.inc the hard to understand test program got reworked into unit tests test coverage got increased some bugfixes, like fixing the XTEA encryption algorithm or the included KDF2 turned out to be KDF1 instead implementation of the newest Whirlpool hash algorithm version implementation of KDF1, KDF2 and KDF3 key deviation algorithms changed unit structure to be more modular and better maintainable added some demo applications. The two FMX based ones are even available from Google Play (stemming from an earlier commit) added a 40+ A4 sized pages documentation most methods contain XMLDOC comments now So is it all over now, or are there plans for the future? Of course I know that this release didn't bring much new algorithms. But as far as my time allowes development shall continue (further project members are welcome!) I do have some plans for V6.1: Add the SHA224 hash, this is still missing Add SHA3 Add GCM block chaining mode for ciphers Add a first pasword hash algorithm, most likely bcrypt So much for today 😉 Cheers TurboMagic
-
Small Christmas present: DEC V6.0 released
TurboMagic replied to TurboMagic's topic in Delphi Third-Party
By the way: a lite version of it is available via GetIt meanwhile. What's lite? The ciphers had to be removed due to export control regulations EMBT didn't want to mess around with... It contains all the rest: the hashes, CRCs, formattings and the random number generator -
Small Christmas present: DEC V6.0 released
TurboMagic replied to TurboMagic's topic in Delphi Third-Party
Sorry, no CPU acceleration yet. On x86 and at least in parts on x64 you can enable use of ASM for some of those which is notably faster than a Delphi only implementation. -
Generic circular buffer library released
TurboMagic replied to TurboMagic's topic in Algorithms, Data Structures and Class Design
So have you looked at my newest commit? Did you find any failure in it? I'm asking because I'm tempted to "do a release"... -
Generic circular buffer library released
TurboMagic replied to TurboMagic's topic in Algorithms, Data Structures and Class Design
I added unit tests for usage with objects now, testing the OwnsObjects semantics. After fixing a bug in destructor, where I tried to free one object too much (which even got the IDE into trouble) it seems to work as it should. But: I have a memory leak problem with two of the unit tests which I don't know how to fix. These are unit tests testing exceptions and the program flow doesn't seem to get to the point in the test method after the exception has been raised. So the code I put there for cleaning up seems not to be run. The circular buffer doesn't free the objects in such an exception case either. I thought that the user wouldn't expect me to do this. Or would a user expect me freeing objects the user tried to add but couldn't because the buffer is full and my implementation has no "overwrite the oldest items in such a case" semantics? (if I would be thinking about adding this I'd make it configurable) -
Hello, in my project I ue ICS V8.62 in Delphi 10.3.3 to detect some devices on the network per UDP. Sometimes my routine works as expected and sometimes it crashes. When it crashes it happens on a call to Socket.MessagePump and inside that one on the call to Application.ProcessMessages. My code is inside an Button click handler and it immediately crashes when pressing F7 in the debugger on Application.ProcessMessages. Since it's a VCL app unit forms is used. Application is assigned. My socket is a plain TWSocket, Proto is 'UDP' and local IP is set to one of the interfaces the computer has to search on that one and LocalPort is 0. I call Socket.Connect and then immediately Socket.MessagePump where it crashes in. Anybody any clue?
-
Ok, now I better understand. Have to find the time to properly refactor this code. Thanks so far.
-
Is there really such an OnSessionConnected event on a connection less UDP socket? Remember: I'm using UDP here.
-
I know that it would be better to not use it. It often works, but just not always. In my case the routine running this shall already return the list of the search so after the code fragment shown in my post above, which is in a loop going through all interfaces determined as plausible ones, I have a waiting loop so received answers which are noted in some list have time to arrive. It's just to find out if a device answers to this request so it is present and to get it's IP.
-
In order to obtain the list of interfaces I loop through I use IcsGetInterfaceList. This returns 3 interfaces to me: 127.0.0.1 (loopback), which I skip, 10.149.x.y (x and y have valid numbers) which is the IP of that VM I'm running in and the last one is 0.0.0.0. This is my code: Socket := TWSocket.Create(nil); Socket.Proto := 'UDP'; Socket.Addr := '255.255.255.255'; Socket.Port := '1234'; Socket.LineMode := false; Socket.OnDataAvailable := OnUDPDataAvailable; Addr.S_addr := IfList[i]^.iiAddress.AddressIn.sin_addr.S_addr; Socket.LocalAddr := string(WSocket_inet_ntoa(Addr)); Socket.LocalPort := '0'; Socket.Connect; Socket.MessagePump; Socket.SendLine('Hallo?'); OnUDPDataAvailable is declared as method like this: procedure TMyClass.OnUDPDataAvailable(Sender: TObject; ErrCode: Word);
-
I do set the interface because it is a broadcast to 255.255.255.255 and I want it to go out to all interfaces. But: would that be really connected to the MessagePump crash in Application.ProcessMessages?
-
One issue with this is, that there didn't ask enough people about this yet. That's at least what SmartBear the company behind TestComplete told me. Why don't all users liking to have such a thing ask all these vendors about it to show there's demand? I'd start with TestComplete and with Ranorex, which even belongs to Idera but can only do VCL so far, as far as I know.
-
DEC (Delphi Encryption Compendium) has a new home
TurboMagic replied to TurboMagic's topic in Delphi Third-Party
Oh and to help your decision what to do: participate in this nice project! Look at missing algorithms and how to implement them so they fit to the architecture or create some more unit tests and turn them in... There's a lot you can do to help! 😉 -
DEC (Delphi Encryption Compendium) has a new home
TurboMagic replied to TurboMagic's topic in Delphi Third-Party
Confident now? Remember: this is an open source project so could have implemented the proposed addition of readme.md yourself and either turned it in as issue or created a pull request. Another possible answer would have been: look at the source Luke! 😉 -
Hello, ICS is now moving to those SSL named classes, which is fine. The question now is: in order to have a FTP client not using SSL is it enough to set the SSLType of the client component to "none"? Best regards TurboMagic
-
Best type for data buffer: TBytes, RawByteString, String, AnsiString, ...
TurboMagic replied to Rollo62's topic in Algorithms, Data Structures and Class Design
You know that arrays can be concatenated with + since XE7? And delete etc. is available for them as well! -
One thing which has helped at least some persons is to have a look at where units are put in uses. It often helped to put them into interface section rather than implementation section. And somewhere else I read reports which compared 10.3.3 and 10.4.x both without fix pack and 10.4.x was measurably faster. It might not be as fast yet as everybody wishes, but at least noticeably faster. Oh and somebody lately suspected it might have to do with unit scope like sometimes using SysUtils and sometimes System.SysUtils. But that's a guess only.
-
Generic circular buffer library released
TurboMagic replied to TurboMagic's topic in Algorithms, Data Structures and Class Design
Small status update: it looks I have fixed all non object related issues. At least the unit tests for those do run and the same unit tests as implemented for unmanaged types have ben implemented for strings as well and they do run. What's left now is the OwnsObjects semantics and tests for interfaces and regular classes. That's the state of the development branch. -
Generic circular buffer library released
TurboMagic replied to TurboMagic's topic in Algorithms, Data Structures and Class Design
I fixed the Add(Items:TRingbufferArray) now, it might need further test coverage for managed types, but that at least fixed some of the failed string test cases now. Peek no longer crashes and while working on that I had see that Peek had already a value in Result at the beginning of the method. Trying to set that to Default(T) there crashed immediately. So fixing add was the right thing. One thing which still puzzles me and maybe is not even possible: I can have such a generic ringbuffer class which works for non managed types and for reference counted types at the same time. But I don't seem to be able to make it work with objects and OwnsObject semantics, as I cannot call free. I can only call free if I introduce a class constraint. Is this assumption correct and my initial attempt with a class for objects inheriting from the first one is the right one? I already tried to find out how TObjectList<T> from Generics.Collections does it, but I failed to find the free of the items in it... -
Hello, given I wanted to distribute a shared object file with map Android app which I need to load dynamically in order to use it. Where would/should I place this on the device? Is .\assets\internal the right path to use when adding this file to deployment manager? If not which is the correct path? When loading it I'd use LoadLibrary like for a DLL, right? And if so, would I use this call for that, give the file name would be test.so? LoadLibrary(TPath.Combine(TPath.Combine('assets', 'internal'), 'test.so'))
-
Yes, I resolved it by upgrading the student to 10.3.3 and then using the permission request solution provided there. It works now and if you check the github repo you'll see it's in there as well 😉 So if you need to create a video on Android you can use that solution right away 😉 The only thing missing there is an iOS implementation as I don't have any iPhone and Mac.
-
Generic circular buffer library released
TurboMagic replied to TurboMagic's topic in Algorithms, Data Structures and Class Design
Access violation, but I don't know why. Ok, I started to write some further unit tests now as a start to fix the issues this implementation has in order to learn some things. I copied the integer unit tests which run fine and reworked those into string ones. so <T> is string now. One of the tests calls this method: function TRingbuffer<T>.Peek(Index: UInt32): T; var reminder : UInt32; begin if (Index < Count) then begin // Puffer läuft derzeit nicht über seine obere Grenze hinaus if ((FStart+Index) < Size) then result := FItems[FStart+Index] else begin // um wieviel geht es über die obere Grenze hinaus? reminder := (FStart+Index)-Size; result := FItems[reminder]; end; end else raise EArgumentOutOfRangeException.Create('Invalid Index: '+Index.ToString+ ' Max. Index: '+Count.ToString); end; FItems at that point contains 5 items, FStart is 1 and Index is 1 as well. It crashes with EInvalidPointer at this line: result := FItems[FStart+Index] When debugging the asm I see some call to freemem. I would have expected that Peek would simply return a string with the contents of FItems[FStart+Index] and that it would increase the reference counter of the string stored in FItems[FStart+Index]. This Peek method is called in a loop over the complete ringbuffer to check if its contents is the expected one. For Index = 0 it doesn't crash. What is wrong on my assumption? And the other question would be: should peek increase reference counter of reference counted types (string, interface...) or return a copy which is not reference counted and thus completely detached from the buffer inside the ring buffer class? And if "detached" should be preferred, how to do the copying properly?