GUI Encryption program (uses wxWidgets)

This is the place to post any code that you want to share with the community. Only completed scripts should be posted here.
Note: posts here are not necessarily endorsed by the community, and may represent amateur or even bad practices.

GUI Encryption program (uses wxWidgets)

Postby wayne » Wed Jun 03, 2015 2:18 am

New user here.
I've been playing around with python for a couple of days, now, and finally figured out some things.... but have a lot more questions than when I started!

At any rate, I used to write in justBasic (Don't laugh. It was actually pretty useful, if you didn't expect too much,) and made a few pretty nice games.
This one was one of my simple utility programs that I used quite a lot, so I figured it would be a good one to use to cut my teeth on python.
It should be pretty self-explanatory.

It only works on common keyboard characters (ASCII) so unicode will probably make it choke. I haven't tried.
I built the GUI with Boa Constructor (easy enough, but if anyone knows a better IDE, I'm open to try anything) so it uses wxWidgets.
I've provided links to the .py and other required files. (~33 KB, total) There's a complete distribution file (2.9 MB) as well. If anyone wants to walk me through making a standalone, you'll have a new friend for life.

Standard Disclaimer: Note that this demo will NOT provide you with secure encryption unless you replace the key file with a new file, filled with truly random characters. Anyone who downloads this demo file will be able to read anything you encrypt.

It uses a single-use random key encryption scheme. If proper procedures are followed for generating the key (using cryptographic-grade random characters (not pseudo-random)) and proper security of the key files is maintained, this encryption cannot be cracked.
Note that re-using the key can allow a cracker to decode BOTH of the messages that were encrypted with the same key (or key fragment) very easily.
The key is stored as one long string in a 10,000 byte file. The program saves the last-used position in a .ini file to avoid reusing any of it. It should be good for hundreds of small messages. The maximum practical size for a key file is about 800 - 840 KB.
I used to use this same program (written in justBasic) to talk to my wife over yahoo chat when I was in Afghanistan. No worries about sensitive information being stolen.
I've tested this with everything from "asdfg" to the text entire Declaration of Independence, (including signers,) and it encrypts and decrypts just fine, with spelling, punctuation, and line breaks in their proper places. The only character you should avoid is the ` (next to the 1 on most keyboards) because it is rarely used, and I needed something printable that could be a marker for carriage returns. All of the other characters are pretty common (thank you SO much, programmers :evil: ) (My old build used the | character. Since I started using linux, that wasn't a good idea, any more.)

I hope you enjoy it, and if you have any suggestions on how to make the code more efficient, I'd welcome the criticism. (Some places I know could be combined, but I kept them separate for clarity.)
The .py file is commented extensively. ... authuser=0 ... authuser=0 ... authuser=0 ... authuser=0

Link to complete distribution: (2.9 MB) ... authuser=0
Last edited by micseydel on Wed Jun 03, 2015 2:44 am, edited 1 time in total.
Reason: First post lock.
Posts: 3
Joined: Tue Jun 02, 2015 9:55 pm

Re: GUI Encryption program (uses wxWidgets)

Postby wayne » Sat Sep 17, 2016 6:42 pm

I just discovered that in newer versions of Python, the GetString command (in the file) is deprecated. Replace GetString(0.-1) with GetValue() and it will work.
Posts: 3
Joined: Tue Jun 02, 2015 9:55 pm

Return to Completed Scripts

Who is online

Users browsing this forum: No registered users and 1 guest