Visit site The Programming Works

February 2017

0
votes
Vote UpVote

Yet another surprise from Delphi compiler

The Programming Works – Build and run the following console app: program ItWorks; {$APPTYPE CONSOLE} uses SysUtils; type TTest = record FData: Integer; end; procedure DoTest(const S: string); begin Writeln(TTest(S).FData); end; begin try DoTest('123'); except on E: Exception do ...
Details Favorite? Off-Topic? Serg @ 2017-02-17 10:05

October 2016

0
votes
Vote UpVote

CHSH game in detail

The Programming Works – CHSH (John Clauser, Michael Horne, Abner Shimony, and Richard Holt) game is another view on the Bell’s inequalities, showing that under the hood our world is not classical. The game is played by Alice and Bob, and proceeds as follows: a referee generates two independent uniformly chosen ...
Details Favorite? Off-Topic? Serg @ 2016-10-26 12:04

September 2016

2
votes
Vote UpVote

TStreamCipher

The Programming Works – TForge 0.76 is released. The release introduces a new class TStreamCipher. The name TStreamCipher does not mean that the class supports stream cipher algorithms only, such as Salsa20 or RC4 – it supports all cipher algorithms currently implemented in TForge, like TCipher class does; block ...
Details Favorite? Off-Topic? Serg @ 2016-09-23 09:21

May 2016

0
votes
Vote UpVote

Hensel’s lifting

The Programming Works – Number theory is full of gems that turn into effective algorithms demanded in cryptography. Consider the congruence where N is odd, and R > N is a power of 2. Probably the most effective algorithm to solve it is based on the Hensel’s lemma; the corollary that applies for our congruence is: ...
Details Favorite? Off-Topic? Serg @ 2016-05-02 14:15

April 2016

7
votes
Vote UpVote

TForge 0.75

The Programming Works – TForge 0.75 is released. Starting from ver. 0.75 TForge consists of a single package; that means simplified installation. Among other features: cryptographically secure pseudo-random generator TRandom a lot of minor improvements on BigInteger
Details Favorite? Off-Topic? Serg @ 2016-04-10 07:30
0
votes
Vote UpVote

On the “out” parameter specifier in Delphi

The Programming Works – I’ve posted before what the “out” parameter specifier is actually doing in a Delphi code. Now let us consider when the “out” keyword should be used instead of “var”. There is only one case when the “out” keyword should be used. It is closely ...
Details Favorite? Off-Topic? Serg @ 2016-04-07 12:44
1
vote
Vote UpVote

Class Methods vs Instance Methods

The Programming Works – C# implements BigInteger.Parse as a static class method, and there is obvious reason for it: you can call a static class methods in a variable’s declaration: BigInteger N = BigInteger.Parse(stringToParse); Delphi/Pascal does not support the above syntax, so the equivalent code is var N: ...
Details Favorite? Off-Topic? Serg @ 2016-04-06 08:44

February 2016

0
votes
Vote UpVote

Integer division by constant

The Programming Works – If divisor is fixed, the division operation can be replaced by multiplication by a reciprocal; the idea is very simple: x / d = x * (1/d); since d is fixed we can precompute 1/d and use faster multiplication operation. This trick works for integer division, with some additional complications. For ...
Details Favorite? Off-Topic? Serg @ 2016-02-01 20:45

January 2016

1
vote
Vote UpVote

Serial Number System Challenge

The Programming Works – I stumbled across an interesting link that made me think about a solid serial number system based on strong cryptography. Cryptography discourages systems based on secret algorithms, and relies on open algorithms and secret keys. So let us develop a serial number generation/verification system with ...
Details Favorite? Off-Topic? Serg @ 2016-01-01 10:58

November 2015

2
votes
Vote UpVote

Any CRC algorithm

The Programming Works – TForge 0.73 is released. The theme of the release is implementing any CRC algorithm of size up to 64 bits. New TCRC class implements Rocksoft™ Model of CRC algorithms using one-bit-at-a-time CRC calculation; the details will be published on the related project’s wiki page.
Details Favorite? Off-Topic? Serg @ 2015-11-24 15:01
3
votes
Vote UpVote

Notes on bitwise CRC32

The Programming Works – CRC algorithms calculate remainder from division of a message polynomial by a generator polynomial over GF(2) field. There are many explanations how it works (see wikipedia for example), but there are also practical details omitted that you should care about if you want to obtain an implementation ...
Details Favorite? Off-Topic? Serg @ 2015-11-18 07:42

September 2015

0
votes
Vote UpVote

BigInteger redux

The Programming Works – TForge 0.72 is released. What’s new: Big integer arithmetic is included in TForge package; that is BigCardinal and BigInteger classes are now available after installing TForge package, without dll. Old dll implementation (Numerics 0.58) is still available but is not developed for now. More ...
Details Favorite? Off-Topic? Serg @ 2015-09-10 08:36

August 2015

3
votes
Vote UpVote

More Ciphers

The Programming Works – TForge 0.71 is released. What’s new: TCipher.Salsa20.SetNonce bug fixed added 3DES block cipher algorithm added ChaCha20 stream cipher algorithm Examples of creating new cipher instances: var Cipher: TCipher; begin Cipher:= TCipher.TripleDES; // 3DES Cipher:= TCipher.ChaCha20; ...
Details Favorite? Off-Topic? Serg @ 2015-08-24 07:00
1
vote
Vote UpVote

Salsa20 support explained

The Programming Works – Salsa20 is a stream cipher; like any stream cipher Salsa20 encrypts/decrypts data by xor‘ing a plaintext/ciphertext with a pseudorandom keystream. Salsa20 generates keystream by hashing a 64-byte (512-bit) blocks; the block consists of 4 parts: fixed “magic words” – 16 bytes ...
Details Favorite? Off-Topic? Serg @ 2015-08-08 12:02

July 2015

4
votes
Vote UpVote

TCiphers – Multithreading Support.

The Programming Works – TCiphers supports encryption/decryption in multiple threads for stream ciphers and block ciphers in CTR mode of operation. The idea is simple – to encrypt N bytes of data in m threads you split the data into m parts, each part approximately of N/m bytes size, then create m TCipher instances ...
Details Favorite? Off-Topic? Serg @ 2015-07-30 11:29
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)