Friday, November 25, 2016

The Election and Hacking the Vote

In recent days, there have been calls by several groups and by at least a couple of computer security experts (including Dr. Alex Halderman of the University of Michigan) for a recount and a forensic audit in three battleground states, Wisconsin, Michigan, and Pennsylvania. Halderman, in particular, has pointed to possible discrepancies in the vote totals in Wisconsin and Pennsylvania where Mr. Trump received a larger percentage of votes in several counties than Secretary Clinton than polls and expectations would have suggested.

A very good analysis of Halderman's arguments and a rebuttal by Nate Silver (of fivethirtyeight.com) is at  http://heavy.com/news/2016/11/wisconsin-michigan-pennsylvania-election-results-rigged-hacked-hack-2016-recount-russian-hillary-clinton-j-alex-halderman-professor-john-bonifaz-electronic-ballots-machines-voting-votes-trump-presiden/   Silver argues that demographics, not hacking, can easily account for the vote discrepancies.

Halderman is not alleging that voting machine were hacked, although there  are concerns about direct recording electronic (DRE) voting machines. See this video of a group of Princeton University researchers hacking a DRE machine in 2006. https://www.youtube.com/watch?v=aZws98jw67g

Halderman himself was involved in a hack of the District of Columbia internet voting system in 2010. In this trial,  the DC board of elections invited anyone to attempt to hack into the internet voting system they were going to use in a local election. Halderman and three of his graduate students hacked into the system and took complete control of the election server in 36 hours. They were able to change votes, download the entire voter registration database, including voter passwords, and they even inserted the Michigan fight song so that it played 15 seconds after a voter cast a ballot. https://www.youtube.com/watch?v=MgZewQYZK7w (Note that these were not the DRE machines mentioned
above.)

I tell my students that (1) these DRE machines aren't attached to the internet, and (2) it would take a vast conspiracy to switch enough votes by hacking each DRE machine one at a time. But I'm reconsidering this position. Consider that if the election were very close, and if one could hack a relatively small number of DRE machines in certain counties in such a way that a certain candidate received only a small increase in their percentage of the votes - just enough to win the county or increase their margin, then I think one could "hack the vote" and change the results of the election.

Note that Trump beat Clinton in Pennsylvania by only 65,000 votes, in Wisconsin by only about 15,000, and leads in Michigan by less than 10,000 votes. Now, both Wisconsin and Michigan use election systems with a voter verified paper audit trail (VVPAT) - in both cases paper ballots that are counted by optical scan readers,  so the likelihood of hacking in those cases is very small. But in Pennsylvania, many counties still use DRE voting machines that DO NOT have any paper trail, so (look at the Princeton video above) the probability of an
undetectable hack is larger, although I still think it's small. However, I think that given the tiny differences in votes that a recount AND a forensic audit at least in the counties Halderman mentions would be prudent. For a list of the types of voting systems used in each state go to https://ballotpedia.org/Voting_methods_and_equipment_by_state 

Sunday, August 14, 2016

100th anniversary of The Black Tom Island Explosion

I missed posting this on the 100th anniversary of the Black Tom Island explosion on 30 July 2016. Black Tom was the most successful German sabotage effort on the then neutral United States during World War I. Here's the story...

In June 1916 Kurt Jahnke and Lothar Witzke, two former German military officers turned spies, made their way east from San Francisco to New York. They spent at least some time at Martha Held’s safe house for German spies at 123 West 15th Street in New York and they met with two other plotters, Friedrich Hinsch and Michael Kristoff. Martha Held was a former opera singer whose townhouse in Manhattan was a favorite meeting place for interned German ship officers and the intelligence agents. While at Martha Held’s several meetings were held to plan out the details of how to blow up the munitions depot at Black Tom. Black Tom Island was, by 1916, a peninsula. Originally an island, the Lehigh Valley Railroad had built a causeway out to the island and laid railroad tracks and built piers where barges would dock. There was no gate at the base of the peninsula, just a guard shack that could easily be bypassed. Black Tom also had seven large brick warehouses on it for storing munitions. By Jersey City ordinance, no barge or railroad car containing explosives was allowed to stay at Black Tom overnight; a law that was routinely flouted. There were guards stationed at the base of the peninsula who regularly made rounds of the depot, but the Germans had bribed at least some of these guards to look the other way. On the night of July 29 – 30, 1916, there were approximately 2 million pounds of explosives of various types on Black Tom Island, much of it in the warehouses, but some in railroad boxcars, and about 100,000 pounds on the Johnson Barge No. 17 which was tied up to a dock near the middle of the island. One hundred years later, there is still controversy over who blew up the facilities at Black Tom Island and how they did it. The author Jules Witcover has what is probably the best and most plausible description:

"Witzke and Jahnke came in to the Black Tom terminal over water around midnight in a small boat laden with explosives, time fuses and incendiary devices. Kristoff meanwhile infiltrated the depot from the land side. They then set small fires in one or more of the boxcars containing TNT and gunpowder, and placed explosives with time fuses there. They also planted time bombs and incendiary devices on a barge – the Johnson 17 – that was loaded with more explosives and tied up to a pier at another point off the yard. Then Witzke and Jahnke retreated onto the darkened river to await the outcome of their work and Kristoff fled by land."

About 12:30AM one of the guards discovered a small fire in a boxcar and put it out. Shortly thereafter several other fires were discovered and the Jersey City fire department was called. The fires quickly got out of control and both the guards and the firefighters fled in fear of the possibility of explosions. At 2:08AM the first titanic explosion occurred as the boxcars and then the warehouses started to go. The explosion blew out windows all across Manhattan and Brooklyn on the New York side and through Jersey City, Bayonne and Hoboken in New Jersey. The explosion was heard and felt as far away as Philadelphia. Everyone was awake. About twenty minutes after the first blast the Johnson 17 barge went up in a second gigantic explosion sending shrapnel across New York Harbor, including dotting the Statue of Liberty, nearly a mile away and leaving a 300-foot wide crater on one side of the Terminal. For hours ammunition and charges went off, raining casings and shrapnel down all over the harbor. Miraculously only four people were killed, including the captain of the Johnson 17 who had made the mistake of sleeping on board that night. Black Tom Island and the depot were a complete wreck; it was estimated that the damage caused by the explosions was in the neighborhood of $20,000,000 in 1916 dollars. Here's a picture of the aftermath:

Saturday, August 13, 2016

IBM PC is 35 years old!

On August 12, 1981 IBM introduced the IBM 5150, their first PC model. It ran an initial version of DOS acquired from a small company named Microsoft. And the world has never been the same. See http://www.pcworld.com/article/3106730/hardware/inside-the-ibm-pc-5150-the-first-ever-ibm-pc.html for a nice description. Happy Birthday, PC!

Friday, August 5, 2016

Using Amazon CreateSpace to make a paperback book

In a previous post I described my experiences with creating an ebook using Kindle Direct Publishing (KDP). Once I finished my ebook, I decided that I also wanted the book available in paperback. Sticking with the Amazon tools and marketplace I thought would be cool, and I figured Amazon would just have a single entry for my book and allow shoppers to pick either the Kindle or paperback edition.

Ahem.

Turns out, as far as I can figure out, I've done things backwards by creating my Kindle ebook first. While KDP is fine for creating an ebook, there's no tools available (or that I can find) to convert your ebook manuscript into something that will work for a paperback. However, if you create a paperback using the CreateSpace tools, in the very last step you can convert your book into a Kindle ebook with not a lot of work. The advantage here is that you only need one copy of your manuscript, formatted for CreateSpace (coming to that) and the CreateSpace tools will (I hope; haven't done this part yet) do the conversion for you. So, having done things backwards, I had to have two copies of my book. Sigh.

Since the content of the two books would be the same, the only changes I'd need to make would be to the layout. How hard could that be? Ahem #2. A couple of weeks on, I have a newfound respect for everyone who has ever done book layout. It is a royal pain in the ass. Lets start with the easy things. First I read the CreateSpace guidelines for book layout (yes, to do this right you really do have to read the instructions). Then I picked a trim size - the overall size of the book. I measured my previously published books and decided to match them and picked 6" x 9". I made a copy of my ebook file in MS Word. I changed the page format to 6" x 9" from 8.5" x 11" (which immediately added about 50% to the page count. I then added back in the page numbers and changed the Table of Contents to include page numbers on the ToC page. Not a problem. Then I started in on the margins.

It turns out that if you lay out a book, that the margins on the left and right pages are different. Why, you ask, are the margins different? I lean over and whisper in your ear - "binding!" Think about it. A paperback book is bound and the thicker the book (the more pages it has) the wider the inside margin where the binding is must be so you can open the book and read it comfortably. Who knew? That inner margin - called the gutter margin - is on the right side for left pages and on the left side for right pages. So when you're doing your page setup, the right margins of left pages and the left margin of right pages must be the same. Same for the outer margins. They must be narrower. Oh, and you need to have even-justified lines (not left justified as you normally might).

The CreateSpace guidelines also recommend that all your chapters start on right-hand pages. This isn't universal. I looked at a bunch of paperback books and the left-hand, right-hand thing for chapter beginning was all over the place. I decided to follow the guidelines because my book was an anthology and that meant that each of my stories would start on a right-hand page and that sounded better. But if a story ends on a left-hand page, then logically the next story would begin on the next page. If the story ends on a right-hand page, there would be a blank page before the next story. Ahem #3.

So I needed to count all the pages and figure out left and right pages so I could insert blank pages when necessary. I also need to make sure that the page numbers ended up correctly. Several days later (and after becoming a master of the MS Word Section Break) I had a book that looked pretty good (but remember, I haven't submitted it yet).

The final piece of work was fonts. Remember from the previous post that I couldn't get monospaced fonts to work using the Kindle Direct creation tools. I figured that since this was a paperback book I could get them to work. And I probably could. But I then remembered the days of tedious work I'd put in converting every cryptogram in my book back to variable-spaced font and creating the tables to make everything line up. And I thought about having to undo all of that just to use Courier. And I said screw it; the tables looked pretty good and I was getting sick of layout errors.

So I submitted my manuscript to CreateSpace and an amazingly short time later I got an email telling me that my proof was ready for review. I decided to review it online the first few times (it was free) before I get CreateSpace to send me a hard-copy (which they charge for). Once again, their tools are very good. I did a quick review online, then downloaded the PDF file and did a more detailed review with the PDF and my original MS Word file side-by-side. I found a number of mistakes and found things that just didn't look good. So I made some edits and re-submitted (you can re-submit and review the proofs as many times as you like). I did this like half-a-dozen times before I was happy enough to buy the hard-copy proof.  While I was waiting for the hard-copy to arrive I re-reviewed the last proof a few more times, finding more errors (I really need a good editor). By the time the hard-copy finally arrived I thought I'd found everything, only, of course, to find several more things that neither spell-check or the MS Word grammar checker can find. Finally I felt good enough about things that I hit the "Publish" button! So now the paperback and the ebook are both available (and I've only had to re-submit each of them once! ;^). If you're interested, they are at my Amazon author page at https://www.amazon.com/John-F.-Dooley/e/B0187W2XVQ Enjoy!

Using Amazon CreateSpace to make a paperback book

In a previous post I described my experiences with creating an ebook using Kindle Direct Publishing (KDP). Once I finished my ebook, I decided that I also wanted the book available in paperback. Sticking with the Amazon tools and marketplace I thought would be cool, and I figured Amazon would just have a single entry for my book and allow shoppers to pick either the Kindle or paperback edition.

Ahem.

Turns out, as far as I can figure out, I've done things backwards by creating my Kindle ebook first. While KDP is fine for creating an ebook, there's no tools available (or that I can find) to convert your ebook manuscript into something that will work for a paperback. However, if you create a paperback using the CreateSpace tools, in the very last step you can convert your book into a Kindle ebook with not a lot of work. The advantage here is that you only need one copy of your manuscript, formatted for CreateSpace (coming to that) and the CreateSpace tools will (I hope; haven't done this part yet) do the conversion for you. So, having done things backwards, I had to have two copies of my book. Sigh.

Since the content of the two books would be the same, the only changes I'd need to make would be to the layout. How hard could that be? Ahem #2. A couple of weeks on, I have a newfound respect for everyone who has ever done book layout. It is a royal pain in the ass. Lets start with the easy things. First I read the CreateSpace guidelines for book layout (yes, to do this right you really do have to read the instructions). Then I picked a trim size - the overall size of the book. I measured my previously published books and decided to match them and picked 6" x 9". I made a copy of my ebook file in MS Word. I changed the page format to 6" x 9" from 8.5" x 11" (which immediately added about 50% to the page count. I then added back in the page numbers and changed the Table of Contents to include page numbers on the ToC page. Not a problem. Then I started in on the margins.

It turns out that if you lay out a book, that the margins on the left and right pages are different. Why, you ask, are the margins different? I lean over and whisper in your ear - "binding!" Think about it. A paperback book is bound and the thicker the book (the more pages it has) the wider the inside margin where the binding is must be so you can open the book and read it comfortably. Who knew? That inner margin - called the gutter margin - is on the right side for left pages and on the left side for right pages. So when you're doing your page setup, the right margins of left pages and the left margin of right pages must be the same. Same for the outer margins. They must be narrower. Oh, and you need to have even-justified lines (not left justified as you normally might).

The CreateSpace guidelines also recommend that all your chapters start on right-hand pages. This isn't universal. I looked at a bunch of paperback books and the left-hand, right-hand thing for chapter beginning was all over the place. I decided to follow the guidelines because my book was an anthology and that meant that each of my stories would start on a right-hand page and that sounded better. But if a story ends on a left-hand page, then logically the next story would begin on the next page. If the story ends on a right-hand page, there would be a blank page before the next story. Ahem #3.

So I needed to count all the pages and figure out left and right pages so I could insert blank pages when necessary. I also need to make sure that the page numbers ended up correctly. Several days later (and after becoming a master of the MS Word Section Break) I had a book that looked pretty good (but remember, I haven't submitted it yet).

The final piece of work was fonts. Remember from the previous post that I couldn't get monospaced fonts to work using the Kindle Direct creation tools. I figured that since this was a paperback book I could get them to work. And I probably could. But I then remembered the days of tedious work I'd put in converting every cryptogram in my book back to variable-spaced font and creating the tables to make everything line up. And I thought about having to undo all of that just to use Courier. And I said screw it; the tables looked pretty good and I was getting sick of layout errors.

So I submitted my manuscript to CreateSpace and an amazingly short time later I got an email telling me that my proof was ready for review. I decided to review it online the first few times (it was free) before I get CreateSpace to send me a hard-copy (which they charge for). Once again, their tools are very good. I did a quick review online, then downloaded the PDF file and did a more detailed review with the PDF and my original MS Word file side-by-side. I found a number of mistakes and found things that just didn't look good. So I made some edits and re-submitted (you can re-submit and review the proofs as many times as you like). I did this like half-a-dozen times before I was happy enough to buy the hard-copy proof.  While I was waiting for the hard-copy to arrive I re-reviewed the last proof a few more times, finding more errors (I really need a good editor). By the time the hard-copy finally arrived I thought I'd found everything, only, of course, to find several more things that neither spell-check or the MS Word grammar checker can find. Finally I felt good enough about things that I hit the "Publish" button! So now the paperback and the ebook are both available (and I've only had to re-submit each of them once! ;^). If you're interested, they are at my Amazon author page at https://www.amazon.com/John-F.-Dooley/e/B0187W2XVQ Enjoy!

Monday, August 1, 2016

Writing Kindle eBooks and self-publishing

I've written three books for traditional publishers and that process was pretty straight-forward, although one loses a lot of control once the manuscript is submitted.  So I decided I wanted to learn how to write and publish an ebook. I thought that would give me the control over not only content, but also look and feel. I picked Amazon because it's the largest retailer out there and because their system seemed pretty simple to understand.

It turns out that writing a Kindle book is pretty easy. Basically you write your book in Microsoft Word (or one of the clones) and then upload it to the Kindle Direct Publishing (KDP) system where it is formatted for e-readers. You get to review your book and make as many changes (and new uploads) as you like before you hit the "Publish" button. But - and there's always a but - it's not quite that loosey-goosey.

First you have to create a KDP account, including giving Amazon your bank information so they can deposit your royalties. You also need to decide on which royalty type (35% or 70%) you are going to use. While 70% sounds attractive, there are a number of restrictions that will push most people (including me) to the 35% level.

Once you've created your KDP account you can write your book. Beware of the Amazon support pages. It appears that they've not been updated for several years. For example, several of the pages assume the only type of file you can upload is "edited HTML", which is now incorrect. You can directly upload an MS Word file. Before you begin writing you should create a template for your book in MS Word. Amazon has guidelines for that and it's really important that you follow their guidelines and format your book properly. The template is essential for margins, paragraph formats, fonts, and the table of contents. Also make sure that you use sections to separate the front matter from the body of the text.

One problem I had was with monospaced fonts. The documentation leads you to believe that you should limit the number of different fonts you use and that you should use "common" fonts, but that multiple fonts are allowable in your manuscript. That was not my experience. My book had a number of cryptograms in it that required that the letters on different lines to line up. This is, of course, problematic in a variable-spaced font like Times New Roman. So, believing the Amazon support pages, I used Courier for my cryptograms. Did. not. work. The first time I uploaded my manuscript and received back the review file the entire book was in a single variable-spaced font; all my cryptograms were wrong.

Several hours in the Amazon KDP community forums convinced my that there was no way for me to include the monospaced font in my manuscript. So my solution (and it's not great) was to embed all my cryptograms in tables and make the tables as narrow as possible (also not an easy task). That made things look pretty good and the cryptograms lined up properly.

Other miscellaneous weirdnesses cropped up. All your chapter titles should be Heading 1 types so the Table of Contents works correctly. Despite what the Amazon guidelines said, I never got my table of contents entries to be live links to the proper pages within the ebook. There is some Kindle magic I'm missing here. Also, don't do page numbers and make sure that you turn off including page numbers in your Table of Contents. Ebooks will get re-formatted and ebook readers don't do page numbers so they're useless and confusing to the user.

The cover was another area of confusion. You must create a cover for a Kindle ebook and the cover must be an image of some kind. Thankfully, Amazon has a Cover Creator app that you can use and has a dozen or so themes you can work around. You can also upload your own cover image. Beware, though and don't include the author and title there because the Cover Creator will also include them. I am not a designer, so using Cover Creator was very helpful for me, although the next time I may find a graphic designer to work with instead.

Other than that, the rest of the process was pretty simple. When you're ready you upload your manuscript, Amazon converts it into a Kindle ebook, you review the converted file, make any changes you need to (and re-submit and re-review), and when you're happy hit Save and Publish and you're done. Amazon's conversion program will check for spelling and formatting errors it can't fix and let you know. For my book I kept finding minor typographic and syntactic errors so I ended up submitting the book half a dozen times. Once you decide to publish though, Amazon will have your book up for sale within a day (I never waited more than a few hours).

Overall, creating an ebook was a pretty easy and pleasurable experience. Enjoy!

Monday, July 30, 2012

Your Vote Doesn't Count

That's right, in the U.S. presidential election your vote doesn't count.

Say you live in Illinois and you're a Republican; your vote doesn't count. Illinois is a reliably "blue" state and will go for Obama this year. That isn't why your vote doesn't count, though. It's because under the electoral system as implemented, Illinois is a winner-take-all state for electors. So as long as one more Democrat votes for Obama than all the Republicans, ALL of Illinois' electors go for Obama. Same thing if you're a Republican in California, New York, or Massachusetts - your vote doesn't count.

Similarly, if you're a Democrat in Oklahoma (there are some, right?) your vote doesn't count. Oklahoma is the reddest state in the nation so it's even better; if you're a Democrat in Oklahoma your vote will NEVER count. At least not as long as Oklahoma continues with its winner-take-all-the-electors system. Same thing in Kansas, Alabama, Utah, and Mississippi, to name a few.

So where would your vote count? Well, hardly anywhere. Only two states - Nebraska and Maine - have systems that allocate electors based on Congressional districts. So in those states, you only have to be in a congressional district that goes Democratic for your vote for Obama to count. Easy, and fair, right? Nope. It turns out that about 80%+ of all congressional seats are "safe" seats and their representatives get re-elected time after time. So if you are a Democrat in a safe Republican district, your vote doesn't count. Of the other 20% about half (10% of total) are really contested elections (that's 44 seats every two years) and the last 10% is seats of retiring members that are really safe anyway. You're screwed.

It doesn't have to be this way. While the electoral system is in the U.S. Constitution, HOW it's implemented and how the electors are selected is left up to the states. So they could change. But the flaw isn't only in the implementation, it's in the electoral system itself. The electoral system was set up because, frankly, the Founding Fathers didn't trust us to elect the President. They wanted a buffer between the masses and those more suited to government, so that the folks in power would choose the President. It's time to change.

The President and the Vice-President are the only two Constitutionally defined officers who are supposed to represent the ENTIRE country. They don't represent districts and they don't represent states, they represent the COUNTRY. So they should be elected by the ENTIRE COUNTRY by having the election for President and Vice-President be a direct election. Everybody votes, every vote is counted. The candidate pair with the plurality of votes are elected. Done. Simple to implement, simple to run, simple to count.

Now those of you in states with small populations will start to shriek that you're being left out. And you're right. But that's because you're populations are small, you should have less say than the larger states. Suck it up. You already have a disproportionate share of power by having two U.S. Senators. You don't get any more power. The Republicans of California want their say and the Democrats in Oklahoma want their say.

Repeal the electoral system and implement direct election of the President - NOW!