Shop OBEX P1 Docs P2 Docs Learn Events
Python code/utilities for Propeller 2 signing and encryption — Parallax Forums

Python code/utilities for Propeller 2 signing and encryption

pedwardpedward Posts: 1,642
edited 2014-05-11 17:44 in Propeller 2
Attached are 2 programs I wrote that implement the signing and encryption process for developers. They are the base code that can be used as part of larger programs to manage keys, sign loaders, and encrypt payloads.

I thought I'd toss these out here for fun, they are really part of me learning Python.

Python has a couple of GUI toolkits, Tkinter and Qt. I'm more familiar with Qt and have several examples to work with, so that's what I'll probably base the wizard program around.

Python has good support for cross platform distribution, and I can "freeze" programs to distribute an executable so people don't need to download and install a bunch of stuff.

Comments

  • jazzedjazzed Posts: 11,803
    edited 2013-09-15 20:51
    pedward wrote: »
    Attached are 2 programs I wrote that implement the signing and encryption process for developers. They are the base code that can be used as part of larger programs to manage keys, sign loaders, and encrypt payloads.

    I thought I'd toss these out here for fun, they are really part of me learning Python.

    Python has a couple of GUI toolkits, Tkinter and Qt. I'm more familiar with Qt and have several examples to work with, so that's what I'll probably base the wizard program around.

    Python has good support for cross platform distribution, and I can "freeze" programs to distribute an executable so people don't need to download and install a bunch of stuff.

    I'm learning Python too ;-) Taking a class for "pace".

    I'd like to hear more about cross-platform Python options. Tcl/Tk are cross-platform with interpreters, but fail to work right in terms of a .exe like package on Mac. I hear Perl fails in a similar way. Ya, I have an unabating skeptical streak in my character.

    Anyone with solid "Python to exe"-like experience out there? Requiring a user to install another package is a no-go for me.
  • pedwardpedward Posts: 1,642
    edited 2013-09-15 21:23
    My strategy is to setup a dev environment on Windows that has all of the necessary packages. That's unless I can do it on Linux natively. While there is mingw32 for Linux, I think a Windows native packaging environment would probably be best.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-09-16 08:39
    Thanks for posting the signing code! If Chip is listening is there any chance of a modified version of the DE2-115 ROM that will do a real signature check so we can test downloading signed code? Even just signing with the default all-zeros key would be helpful. I guess this wouldn't be possible on the DE0-Nano board because I believe that the signature checking code runs in a second COG. Is that correct?
  • potatoheadpotatohead Posts: 10,261
    edited 2013-09-19 20:13
    Yes. Booter launches the DES COG.
  • pedwardpedward Posts: 1,642
    edited 2013-09-19 20:31
    Not DES, it implements SHA-256/HMAC for creating a hash that uses a secret key to perturb the hash in a specific way.
  • KyeKye Posts: 2,200
    edited 2013-09-19 20:36
    Coolio,

    Qt Can do SHA256 right out of the box, you need support for HMAC however.
  • potatoheadpotatohead Posts: 10,261
    edited 2013-09-19 21:10
    Yes, SHA COG. Sorry about that.
  • TubularTubular Posts: 4,655
    edited 2014-05-11 17:44
    David Betz wrote: »
    Thanks for posting the signing code! If Chip is listening is there any chance of a modified version of the DE2-115 ROM that will do a real signature check so we can test downloading signed code? Even just signing with the default all-zeros key would be helpful. I guess this wouldn't be possible on the DE0-Nano board because I believe that the signature checking code runs in a second COG. Is that correct?

    Anyone know if this is still accurate, or has something changed in the mean time?

    ie is it possible to load and run encrypted packages on a DE0?
Sign In or Register to comment.