Hi,
Hallo liebes Forum.
Ich habe ein kleines One Time Pad Programm programmiert, zusätzlich zum Encodieren mit einer Schlüsseldatei wird die Ausgabe bitinvertiert. Nun stellt sich mir die Frage ob die Geschwindigkeit des Programms so okay ist.
Es dauert 1,4 Mbit/s (10,5 MB/ min) auf meinem Computer.
Vielen Dank für Hinweise.
Are we talking about this one-time pad encryption
https://en.wikipedia.org/wiki/One-time_pad
1.4Mbit/s is so slow that makes encrypting with AES then compressing with
ZLib then convert it using Base64 faster at least 10 times.
Again, if we are talking about one-time pad encryption/cipher which is merely an XOR operation limited by IO, in this case it is memory
access.
Here a nice paper on ResearchGate
https://www.researchgate.net/publica..._Pad_Algorithm
and here some result of little optimized approach , on Page 19
Zitat:
Table 8. Speed test results with different plaintext lengths.
Length of Plaintext Verification Time
128 bits 0.203495 ms
256 bits 0.241399 ms
512 bits 0.258441 ms
1024 bits 0.287604 ms
2048 bits 0.345361 ms
4096 bits 0.421147 ms
8192 bits 0.643735 ms
So 1KB is less than 1ms making 1MB less than 1second, but judging by that table it is non-linear thus we can safely assume it will be slower than 2ms for triple/quadruple of the biggest which means 4kb it will be slower than 1ms, yet here we should not forget the L1 cache and when you hit it the performance might sliced by half at least.
I would suggest to fine benchmark it for small sizes because it make little sense to use it on huge data, then compare with that paper, if you can get half the speed then with Delphi compiler then it is great.
PS: the paper about utilizing sign-on using OTP so there is more extra work that doesn't concern your implementation, yet OTP is simple XOR based, so i think (and hope i am not wrong) you can hit tens if not hundreds of megabytes
per second.