Finals

Grading 55 or so 11 question finals this weekend. The students who actually did the work do pretty well. The rest, ah well, how many should I fail?

So no literature this weekend.

My assignments have made the big time, posted to Chegg.com (a big cheating website where you can hire a “tutor” to do your homework for only $14.95 a month.)

One of my favorites, a very easy python problem, “On Julius’ secret service” was there. Bugger all.

More here, here, here and here.

My students are nothing if not persistent.

Decoding Amanda, Symmetry

wewriwa
Welcome to weekend writing warriors. Many fine authors, and me, contribute short snippets for your delectation.

Since it seems that our Regency spy romance is much more popular than our science fiction, this post introduces the sequel to The Art of Deception. Amanda’s reading was interrupted by a summons to attend on her mother. Amanda’s mother made it clear that she must attend the assembly. After a short carriage journey, it only being six or so miles between Coalpit Heath and Chipping Sodbury, they have arrived. Mr Jameson just asked Amanda to dance, despite her interest in a mathematics problem. The set over, Amanda wants to return to her usual pursuits when her mother stops her. Amanda has just said a biting remark about the mysterious Mr Jameson, and her friend Louisa wonders why she is so sour. After the break for refreshments, the story resumes on the dance floor, where Amanda has agreed to another dance with Mr Jameson.


“Tell me, Miss Bentley about those figures; are you a devotee of the cossack art?”
“Until Mother took my copy of Hutton, I was,” Amanda paused, swept away by the figure; shen she returned to speaking distance, she continued, “I was working on symmetric polynomials, not that I’d expect a divinity student to … “
“Interesting area, I feel there is some deep structure there, but…”
“You know about them?”
“Surprised; I wasn’t always … studying for orders; before I received my calling.”
“You were a mathematician?”
“The way to perdition is paved … with equations, determinants and integrals.”
Amanda guffawed; then she blushed as heads turned to her, “No it isn’t and you know it.”
“That’s true, and I retain some interest in the field.”


My sincere apologies for abusing semi-colons. (The cossack art was the study of ‘x’s’ and ‘y’s’ i.e. Algebra.)

There are a couple of non-obvious links to my day job in this snippet. The most interesting is the idea of “Symmetric Polynomials.” The study of these led a certain Evariste Galois to develop group theory of polynomials in the late 1820’s. He wrote a formidable exposition on the theory the night of May 30th 1832 and promptly was shot in a duel in the morning of the 31st.

Galois theory forms the basis for much of modern communications and cryptography. The error correcting codes that allow us to pump gigabits of information through grotty fibre lines or watch DVDs come from his work. As does the mixing step in Rijndael or AES.

The idea itself is strikingly simple, albeit rather tricky to construct in practice. Prime numbers form simple rings or groups that are closed under multiplication and addition in modular (clock arithmetic). For example, if we keep multiplying by 3 mod 7 we have 1,3, 2 (9 mod 7), 6, 4 (18 mod 7), 5 (12 mod 7), and 1 (15 mod 7). It repeats forever after that and every number from 1 to 6 is a power of three mod 7. Therefor 3 is a generator in the ring mod 7. Cool (at least I think it’s cool). Most of the ways we exchange secret keys on the internet use this math, but with rather larger prime rings (where the primes requires 2000 bits or so).

Galois asked the rather simple question, “what happens if we use polynomials instead of numbers?”

This leads to the idea of irreducible polynomials and polynomial rings. Unfortunately the theory is too large to fit in the margins of this post.

The featured image shows a working modern reconstruction of a Turing “bombe” from Bletchley Park.

This snippet continues formal connection to the previous book in the series (the art of deception). Mrs Hudson’s academy doesn’t just teach deportment and other social skills.


I’ve put up a couple of things on instafreebie. The first is a short story, To Court a Dragon.

The second is the start of a science fiction story in the same universe as Cynthia the Invincible, but set in 1893 Dartmoor, The Curious Case of Miss James. It’s available on Amazon.

The Art of Deception, first in a series of late Georgian/early Regency spy novels is now up.. You can get the first part here.

You can find my, well our, works here.

Birth of a new business.

Very preliminary, but we’re announcing Treadco – bespoke machine learning and datamining for the discriminating user.

The name and form might change, but we specialize in highly efficient and highly accurate machine learning and data analysis.

  • Generative models such at the Restricted Boltzmann Machine. Our algorithm is 14 or more times faster than the standard approach. This makes it fast enough to implement in javascript or other interpreted languages and still get results in near real time. Web-based data analysis anyone?
  • Fuzzy and probabilistic/possibilistic modeling. Correct handling of uncertainty in both the independent and dependent data improves the robustness of the models.
  • Big supervised or unsupervised data problems.
  • Model development. Not sure what’s best? Ask us.

A Little Wizardry, A Lot of Security.

fsck_itMy close collaborator wears one of these (in a men’s size and cut). Usually it means he’s a bit PO’ed, but he claims it’s to show his unix wizardry. Still, at least he looks the part – which I don’t. (At least he doesn’t smell the part.)

That said, I’m going to earn my right to wear this shirt with today’s post.

The problem:

Too many people want to look at your laptop and it may become difficult to stop them. Especially in those bulwarks of personal liberty – the USA and the UK. Not to mention other places which don’t even give lip service to the idea of freedom.

A solution:

You need to be able to show the spooks a machine that is clean. Even better, a machine that has links to the collected wisdom of Ms May or Mr Trump and a background set to an appropriate image. However, you want to use your machine to do other things and you don’t want traces left on it. Even more important the media that stores the data should be disposable.

You can get a cheap, solid-state, laptop such as a lenovo ns-10 for $100-$200 on Amazon. These have long battery lifetimes, but limited storage. They’re bullet-proof (figuratively speaking).

It turns out windows 10 will easily boot from a usb stick. There may be an event in the log files, but it’s not hard to do and it does not leave a tell-tale boot sequence.

It does mean, however, that you need to construct a persistent linux boot image on a device.

  • micro-sdhc cards can be put in a usb adapter and work like normal usb memory.
  • micro-sdhc cards are easy to destroy. A few seconds with a cigarette lighter and they’re toast. NSA-grade toast as far as recovery is concerned.
  • micro-sdhc cards are not terribly expensive, and can be sent by second channels such as regular mail, or inside of a camera or phone.

patriot_sdhc

So in many ways they’re a spy’s dream.

Making a persistent boot device.

  1. Acquire the software. Download your favorite linux distribution and make sure that gparted and unetbootin are installed.  (sudo apt-get install will usually do the trick. There are windows versions of these, but if you are installing a linux operating system bite the bullet and learn to use it.)
  2. Repartition the media.  I used gparted because it’s graphical and cute. parted will work too, but you have to be a little more careful about typos.  Windows will only boot from a fat32 partition (fat 16 is ok, but NTFS is right out). This will cause some complications, but nothing too hard to deal with.  I set up a 7 gig  fat 32 primary partition and labeled it bootable. (Two steps with gparted, make the partition (execute the commands), and then after it’s made set the bootable flag.) The rest of my disk (which will be invisible under windows anyway) was made into an ext3 partition. I could have used NTFS too. By the way, you’ll need to be root or sudoer to do this.
  3. Use unetbootin to install the software. It can read from an disk image (ISO) that you’ve downloaded. You’ll need enough space to install the software (about 3gig for linux mint 18) and 4 more gig.  At the bottom of the unetbootin menu is a line about creating a persistence file.  I made it 4 gig, which is as large as fat32 can take, by entering 4000.  Don’t accept unetbootin’s offer to reboot.
  4. So far these instructions have been more or less standard, and you have a bootable disk. But only 4 gig. WTF!  It used to be that you could have a casper-rw partition and it would mount that, but that actually took advantage of a security hole. So now for the magic.  With your disk mounted, cd to the other partition and create a whopping big file.   dd if=/dev/zero of=casper-rw bs=1M count=23300 will create a 24G file. It will take about an hour. Make a cup of tea. There’s probably a faster way to do this with the QEMU suite, but that’s another post.  The next step is to make that file into a filesystem itself.  mkfs.ext3 -F casper-rw will do the trick.
  5. Now you can boot the disk. But we’re not done. Casper files are mounted as loop-back files which means we have to mount them to proceed. The easiest way to do this is to just use the device. In windows 10, use the settings icon (that gear shaped thing), go to update & security and click on the recovery menu. Under advanced startup there is a restart now button. Click on it. Tell the machine to reboot from a device and then select the appropriate usb device. A grub menu should appear.

And it didn’t work. Well it did, sort of, booting without persistence. ARRGH! Now for the wizardry.

It turns out that the kernel needs to be passed a parameter to boot in a persistent mode.  This is literally the word ‘persistent’ and it’s appended after the ‘- -‘ in the configuration.  (i.e. it looks like stuff – – persistent with a space).  The configuration file was right. It just wasn’t the right configuration file.

So back on unix, we mount the drive and look at the boot/grub.cfg file. There’s no persistent passed to the kernel. So we add it. (Actually we copy the 5 lines and add it so we have both options.)  Now it works.

On with the show.

The casper-rw file is a virtual file system. It’s mounted as a loopback file system (mount casper-rw /other -o loop).  So we create a directory /other and a short script to mount the other casper file as a loop back.

#!/bin/sh
mount /media/mint/<a big funny string>/casper-rw /other -o loop

The <big funny string> is a UUID for the disk. One of those security things. I’m still working on how to get it to run automagically, but it works.

Why did I have to do this?

This is actually a feature. Most OS’s won’t let you run programs from a USB device because you could very easily make a virus that ran from disk to disk. The partitions on the disk are recognized as USB partitions, but once mounted in loopback mode are not and so files run. There were a set of instructions which involved making a casper-rw partition and which seemed to magically stop working. I suspect, and one of these days will check, that was an error in the grub configuration.

By the way, you’re the system user on this installation – so installing a useful utility like nmap might be an idea.

Under Construction.

We’re building a new website as I type. Well, sort of.

I’ve reorganized the books page to display by category rather than which of us took the blame for it.

The other thing we’ve done is to write a landing page. Eventually there will be one for each book, coupled to newsletter signups and instafreebie, but for now you can see the one for Cynthia the Invincible.

They’re built using twitter bootstrap – so they will scale on multiple devices and be somewhat robust. Like the house on the header image, it is a modular approach to building a web page.

I am available for consultations.

A heads up for #computer #privacy.

I’ve  been using the EFF’s excellent “Privacy badger” to block third party cookies. Firefox quietly de-installed it.

Naughty naughty.

I’ve reinstalled it and suggest you do likewise.

https://www.eff.org/privacybadger

First party cookies, such as google uses, are a fee for service. You search for data, they know you searched.

Third party cookies are more like vampires or parasites. “Lamprey cookies?” They get the benefit but give you very little.

Failing the Turing test.

I’ve been slowly working my way up in twitter followers and other aspects of social media. The day job injected itself, once again, with one of the last “followers.” She or perhaps better “it” was a robot. The English was a tiny bit stilted, and the cover image recognizable from a stock photo, but that wasn’t the give away. It was posting a circular list of quotations, one or two with characteristic grammar errors. Every ten to fifteen posts was a different one with a link to something. Usually diet pills or some such insalubrious product. If you didn’t go through the machine’s list of tweets you’d miss that. So it almost passed the Turing test. Clever idea though. Create a lot of small, human-looking accounts. Set up some sort of reasonable-looking feed and then put in the occasional spam. Since there are many of the accounts, even if twitter catches a few, the message will still get out. Just glad it wasn’t porn.