- DelphiTools - https://www.delphitools.info -

Cryptographic Library for DWScript

padlockThere is now an embryo of standard cryptography support for DWScript through the dwsCryptoLib module. The implementations are currently based on mORMot [1]‘s SynCrypto unit, which is fast and solid.

Script-side it’s exposed as a System.Crypto unit, and offers the following classes:

The classes are currently meant for static usage and rely on virtual class methods, ie. you don’t have to instantiate them, but can use them in code like

PrintLn( 'Here is the MD5: ' + HashMD5.HashData( whatever ) );

var myHash := HashSHA256;
PrintLn( 'and the SHA256: ' + myHash.HashData( whatever ) );

They will probably become “instantiatable” in the future for the purpose of hashing and performing data encryption incrementally.