The folly of Passwords
If you’ve been following the news at all, you’re sure to have heard of all the various breaches at major companies and even government agencies. Nearly all of these breaches revealed an absolutely horrible password culture. You could search Google for tons of analysis of these leaked passwords, you could read my short analysis in the GNY Webzine, or you could examine them yourself.
Long story short, people are not computers. We suck at remembering long lists of secure passwords of varying case which are alphanumeric in nature. We can be intimidated into revealing our passwords. The human element tends to be what undermines the current system moreso than any other factor. Removing the human element solves lots of problems. Basically, if we use public key cryptography along with some safe-guards, we can create USB-sticks which can act as passwords. In scenarios where they can be easily replaced (A school/workplace), they can severely improve the state of security that is offered by a normal password system. If anyone is interested, I wrote up a short paper on my idea, why I think it has merit, and a short python code sample which demonstrates the ease with which such a USB-Stick can be formatted and then authenticated (albeit, the script itself isn’t exactly a hallmark of security, it’s a POC
)
NOTE: Running the script will very likely destroy data on your USB stick. Since it writes to the first bytes, it will at the very least damage its partition table, making it unrecognizable to the OS.
Do not insert your USB stick until prompted by the script if you wish to try it out. Run it as root.
E-mail archiver – Python
I’m taking a summer course at a community college this year, basically to brush up on physics, since I’m about to take Advanced Physics in the Fall, and haven’t looked at anything related to physics (except mathematics I suppose) since the ninth grade. They require me to have an email-address. Problem being, the school-issued one conflicts with my private G-mail account, so logging off and in and off and in is annoying. So, I wrote this short script, which logs into my school account, checks for any new emails, and downloads each new email into a file called “mail[number].html”. I have it running as a Cron job, and was going to have it send me notifications about new emails, but since I’m running a pretty hacked up LXDE over Openbox, python-notify doesn’t work :/.
Anyway, I tried to keep it short,sweet, and well commented. If you’re going to use this on a machine that isn’t secure (IE, your personal laptop), I’d suggest writing a function that retrieves your password and keeps it from sitting there in plaintext, like it is in my script.
Python Frequency Analysis
It’s pretty common knowledge that frequency analysis is one of the most important tools that can be employed against an encoded message. I’ve recently been reading “The Code Book” by Simon Singh (A great read), and decided I will attempt to create computer programs which implement some of the algorithms he describes. This is a pretty simple script, its also pretty short. You drop whatever text you want into ./input and run the script. It will print (to the terminal) the frequency with which each character appears.
Maybe this will be useful to somebody? If it is, I encourage you to modify/distribute/ and most importantly improve!!
Written on Python 2.7.1. Should work with 2.6.x with little or no modification. I’ve had it handle files of ~50mb, for files this large, RAM usage spikes, but it works
.