I'm trying to write a sha256 implementation in pure pascal like sha1 and md5 units.
With negative results.
Someone can helpme with this?

Mailing lists / fpc-devel / 2016-03
11 messages · 5 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
I'm trying to write a sha256 implementation in pure pascal like sha1 and md5 units.
With negative results.
Someone can helpme with this?
Check out dcpcrypt2 (http://wiki.lazarus.freepascal.org/DCPcrypt)
The latest stable release can be found on the Lazarus-CCR Files <http://sourceforge.net/projects/lazarus-ccr/files/DCPcrypt/> page.
I'm trying to write a sha256 implementation in pure pascal like sha1 and md5 units. With…
I'm trying to write a sha256 implementation in pure pascal like sha1 and md5 units. With negative results. Someone can helpme with this?
I recently ported the implementation from LibTimCrypt / wpa_supplicant (which are both from public domain implementations), you can find the unit here:
https://github.com/ultibohub/Core/blob/master/source/rtl/ultibo/core/crypto.pas
This is for our Ultibo embedded project but the code is pure pascal and should compile for any platform if you adjust the uses clause.
This has been validated against a number of test vectors available from different sources and seems correct although I can’t test on big endian unit also includes ports of AES, DES, DES3 and RC4 ciphers as well as MD5 and SHA1.
Cheers,
Garry.
Would it be OK to extract some of the routines and include them in Free Pascal using the usual license ? We have several of these routines, but not all, it would be nice to have a more complete set available by default.
Michael.
Yes, no problem. The original sources are credited to public domain implementation and the Ultibo license is identical to the FPC RTL.
Cheers,
Garry.
I recently ported the implementation from LibTimCrypt / wpa_supplicant (which are both…
Are you planning to support TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 embedded in Ultibo which looks to be the most common cipher requested by browser, would this allow to embed TLSv1.2 in order to implement https server in Ultibo?
I also see in your unit that you are supporting RC4 cipher, but as stated in
https://www.chromium.org/Home/chromium-security/education/tls#TOC-RC4 it looks like Chrome deprecated this cipher, probably other web browsers will follow,
any opinion ?
Yes, the intent is to support https with TLS 1.0/1.1/1.2 so AES_128_GCM_SHA256 will be included in the cipher suite.
Garry.
RC4 is included to support WEP and WPA (for 802.11). Even though both of those are also officially deprecated they are still widely used.
Garry.
Yes, the intent is to support https with TLS 1.0/1.1/1.2 so AES_128_GCM_SHA256 will be…
Garry Wood wroteYes, the intent is to support https with TLS 1.0/1.1/1.2 so AES_128_GCM_SHA256 will be included in the cipher suite.
Pure FreePascal code only ? no dependency with OpenSSL (or third party libraries) ?
-> this would be absolute great news !
Work is in progress to get the ciphers in the FPC SVN.
Michael.