Welcome, Guest. Please login or register.


Author Topic: SHA-1 / HTTPS on a Z80? (Read 803 times)

Offline BruceTanner

  • EP user
  • *
  • Posts: 448
  • Country: gb
  • OS:
  • Linux Linux
  • Browser:
  • Chrome 67.0.3396.99 Chrome 67.0.3396.99
    • View Profile
SHA-1 / HTTPS on a Z80?
« 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:

21590-0

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!:

* sha1.asm (49.56 kB - downloaded 15 times.)


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!)

* sha1test.asm (15.19 kB - downloaded 12 times.)


Bitcoin mining on a Z80? :mrgreen:

Offline gflorez

  • EP addict
  • *
  • Posts: 2330
  • Country: es
  • OS:
  • Windows XP Windows XP
  • Browser:
  • Firefox 52.0 Firefox 52.0
    • View Profile
Re: SHA-1 / HTTPS on a Z80?
« Reply #1 on: 2018.July.21. 08:41:10 »
Impressive!

Only 15 seconds to  decode 64KB... Soon it will win Firefox on WINXP....
« Last Edit: 2018.July.21. 10:34:23 by gflorez »

Offline Zozosoft

  • EP addict
  • *
  • Posts: 12985
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 61.0 Firefox 61.0
    • View Profile
    • http://enterprise.iko.hu/
Re: SHA-1 / HTTPS on a Z80?
« Reply #2 on: 2018.July.21. 10:08:54 »
Amazing! :smt038

Online tofro

  • Newbie
  • Posts: 9
  • Country: de
  • OS:
  • Mac OS X 10.13.6 Mac OS X 10.13.6
  • Browser:
  • Safari 11.1.2 Safari 11.1.2
    • View Profile
Re: SHA-1 / HTTPS on a Z80?
« Reply #3 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!