encrypting messages on 42s
#1

Does anyone know if there are any simulations for encrypting messages on the 42s similar but on a much smaller scale that are available for computers vs the enigma machine. Howard

#2

There is an implementation of the Advanced Encryption Standard (AES) for the HP-42S at http://mathstat.carleton.ca/~brett/Research/Code/index.html#hpaes.

- Thomas

#3

Excellent !, thanks for your help, Howard

#4

My goodness, how fast does Rijndael run on a Saturn? Have you tried that code on Free42, Thomas?

Regards,
Howard

#5

Quote:
My goodness, how fast does Rijndael run on a Saturn? Have you tried that code on Free42, Thomas?

No, I haven't tried it myself. The author, Brett Stevens, submitted his code for the programs page on my web site, and I linked back to his page, that's all.


According to the author's documentation, he wrote the program as a proof of concept, to show that an advanced algorithm like AES could be implemented on a limited architecture like the 42S.


The author does not provide performance measurements, either, but of course you could run a few tests of your own... In case you'd rather not type in all that code by hand, there are *.raw files on my programs page. :-)

- Thomas

#6

Quote:
According to the author's documentation, he wrote the program as a proof of concept, to show that an advanced algorithm like AES could be implemented on a limited architecture like the 42S.

Is he trying to prove Church's Thesis? :-)

It basically says that "any calculation that is possible can be performed by an algorithm running on a computer, provided that sufficient time and storage space are available"

#7

One of the requirements for AES was that it be easy to implement in hardware. That means several things, but in particular that the algorithm needed to have small memory requirements and a relatively low demand for CPU cycles. "Relatively" in this case probably meant with respect to low to medium speed embedded CPUs. I'm sure that speeds like those offered on the 42s (a Saturn at, what, 640 KHz?) weren't considered in scope. But in scope or not, the referenced program would seem to prove that rijndael algorithm, the eventual winner of the AES competition, truly has a tiny memory footprint.

It would be interesting to see how fast the algorithm runs on a real 42s. However that would require typing in a lot of numbers and program lines. If I get a free afternoon or so, I might attempt it. My 42s can be accelerated, so I could compare the two modes on something really computationally intensive relative to the machine. A comparison with Free42 would also be interesting, and wouldn't demand nearly so many keystrokes. 8)

Regards,
Howard

#8

Quote:
It would be interesting to see how fast the algorithm runs on a real 42s. However that would require typing in a lot of numbers and program lines.

You could also use Emu42 in "original speed" mode. I don't think it has an "original accelerated speed" mode, though. <g>

- Thomas

#9

Quote:

I don't think it has an "original accelerated speed" mode, though. <g>


It depends on how the acceleration is implemented on the real calculator, and if that/those feature(s) are emulated in emu42. I agree it's less likely to be there.

That's a good suggestion, though. I'm leaning toward keying the program in, but I have a development project (basically, an airline time filler) underway. I don't know if the AES code would fit alongside my current stuff. If not, I'd have to move the programming up my priority list, or else just accept re-keying the program after doing the AES stuff. In the meantime, emu42 might serve as a stand-in for the real machine, at least for now.

Regards
Howard

#10

Quote:
It depends on how the acceleration is implemented on the real calculator, and if that/those feature(s) are emulated in emu42.

As far as I know, accelerated HP calcs simply have a modified master clock, which makes *everything* run faster, i.e. all the hardware -- not like speeding up a PC by overclocking the CPU, where only the CPU runs faster, while memory and peripherals still run at the same speed as before. So, theoretically, an HP-42S whose clock has been cranked up by a factor x from the normal 1 MHz, should do *everything* faster by a factor x. I don't know about the HP-42S' "Fast Mode", though -- that may well be different. Christoph, if you're listening, could you shed some light as to how that may work in Emu42?

Quote:
I don't know if the AES code would fit alongside my current stuff.

aes.raw and aesprep.raw are 3357 bytes together -- that's almost half the HP-42S' total user memory. Pretty darn big by HP-42S standards, but you should still be able to do a great deal even with those things loaded.


It should be possible to shave off some bytes by using a matrix to hold the constants from aesprep.raw, and writing a small program to load the required registers from that; in a matrix, each number takes up 8 bytes, while in a program, it can be significantly more (and the numbers in aesprep.raw are definitely more than 8 bytes each -- count 1 byte each for each digit, minus sign, decimal point, and exponent sign, plus one extra byte for the "null" byte that is automatically inserted in front of each number).

- Thomas

#11

Quote:
I don't know about the HP-42S' "Fast Mode", though

That's the speedup I have available on my machine. I'm pretty sure it's a clock doubling hack because BEEP tones go up an octave.The mode is enabled in software, however.

Quote:
aes.raw and aesprep.raw are 3357 bytes together -- that's almost half the HP-42S' total user memory. Pretty darn big by HP-42S standards, but you should still be able to do a great deal even with those things loaded.

Yes, indeed. I should have plenty of room for both projects.

Regards,
Howard



Possibly Related Threads…
Thread Author Replies Views Last Post
  Where are older messages hiding? Harald 2 1,270 03-09-2013, 05:33 PM
Last Post: Harald
  HP 42S Error Messages Han 7 2,319 07-28-2012, 11:48 PM
Last Post: Matt Agajanian
  42s questions and 42s vs 35s snaggs 13 5,189 09-19-2011, 02:44 AM
Last Post: snaggs
  Scrolling Messages On HP41C? jyl 3 1,087 06-06-2006, 07:17 PM
Last Post: Hans Brueggemann [GER]
  Has anyone lost any messages? Dave Hicks 2 869 04-08-2004, 08:16 PM
Last Post: Wayne Stephens

Forum Jump: