Welcome, Guest. Please login or register.

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

Offline BruceTanner

  • EP lover
  • *
  • Posts: 595
  • Country: gb
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:

[ Guests cannot view attachments ]

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

[ Guests cannot view attachments ]

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

[ Guests cannot view attachments ]

Bitcoin mining on a Z80? :mrgreen:

Offline gflorez

  • EP addict
  • *
  • Posts: 3522
  • Country: es
    • Támogató Támogató
Re: SHA-1 / HTTPS on a Z80?
« Reply #1 on: 2018.July.21. 08:41:10 »

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

  • Global Moderator
  • EP addict
  • *
  • Posts: 14534
  • Country: hu
    • http://enterprise.iko.hu/
Re: SHA-1 / HTTPS on a Z80?
« Reply #2 on: 2018.July.21. 10:08:54 »
Amazing! :smt038

Offline tofro

  • Beginner
  • *
  • Posts: 30
  • Country: de
Re: SHA-1 / HTTPS on a Z80?
« Reply #3 on: 2018.July.21. 11:07:23 »

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