Enterprise Forever

:UK => Programming => Topic started by: BruceTanner on 2018.July.20. 14:47:40

Title: SHA-1 / HTTPS on a Z80?
Post by: BruceTanner on 2018.July.20. 14:47:40
For a while now I have been wondering how well a 4MHz Z80 would cope with some modern encryption protocols like those used for HTTPS web sites (ie most web sites these days), so I wrote some SHA-1 encryption code and a test program:

[attach=1]

The .html file for the main page of  EnterpriseForever.com (which is also a HTTPS web site) is around 64k once all the secondary files are included. Based on my SHA-1 code it would take around 15s for a Z80 to decode!

There are more modern and more secure SHA algorithms with longer hash values but they operate in a broadly similar way.

Here is the source code for the SHA-1 algorithm in case anyone ever finds it useful (assembled using sjasm 0.42c). I was able to adjust the official algorithm a bit to avoid copying all the data twice!:

[attach=2]


And here is the source code for the test program which includes the above file (sorry, a bit messy as it was hastily hacked together from another program!)

[attach=3]


Bitcoin mining on a Z80? :mrgreen:
Title: Re: SHA-1 / HTTPS on a Z80?
Post by: gflorez on 2018.July.21. 08:41:10
Impressive!

Only 15 seconds to  decode 64KB... Soon it will win Firefox on WINXP....
Title: Re: SHA-1 / HTTPS on a Z80?
Post by: Zozosoft on 2018.July.21. 10:08:54
Amazing! :smt038
Title: Re: SHA-1 / HTTPS on a Z80?
Post by: tofro on 2018.July.21. 11:07:23
Brilliant!

Nice to see how an 80ies CPU would have struggled with tasks we consider "minor background processing" on modern computers.

Thanks!