Sunday, May 31, 2015

A Sweet

Excerpt from Cynthia the Invincible.

Cynthia, stranded on Earth, has met Lord Wroxham, his sister, and a friend. She encounters her first real food in years of time in space.

Dinner itself went surprisingly well. The AR conditioning taught Cynthia manners, and she handled the maze of glasses, forks, and other items of cutlery as if she had been using them all of her life. The food itself could have been a problem, but for one who prided herself on eating Xylub delicacies without anti-nausea pills, regency cuisine held few fears. Indeed, it was excellent. That is until she asked, “This dish, what is it?”
“It is a ragout, of veal I believe.”
“Baby cows.”
Cynthia swallowed and felt ill. She was eating real animals, real animals that were cooked in a sauce to enhance their flavor, and not synthetic textured microbial protein that was also cooked in a sauce but to hide its flavor. It would take some mental adjustment to this state of affairs.
“Are you well, Miss Morris?”
She smiled. She'd eaten worse, only this was a shock because it was unexpected. At least it was already dead and well-cooked. “Yes, I'm fine. Could I have some more of the frites, please?”
“You should save some room for the trifle.”
“Sweet, pudding, dessert?”
After dinner, Alice took Cynthia to the withdrawing room for a comfortable coze. “We should leave Freddy and James to the port and snuff.”
“If you say so. What will we have?”
“Is tea suitable?”
“Yes, tea.”
Cynthia looked away from her, as though she were listening to a distant voice, then replied, “Of course, tea. What was I thinking of?”

A couple of Regency, indeed classic, English Desserts. 

Cynthia, fresh from eating spacer food, would find these strange indeed. The closest thing I could think of to what she'd been used to as a sweet would be sweetened Tofu with anise extract. The Tofu would be similar to the microbial protein extracted from the recycling system. You are welcome to try it if you like, but my palate quailed at the thought. Tempeh, pickled Tofu, and stinky Tofu would be similar to the sort of food she'd have eaten as a main course.

So imagine how she'd feel when confronted with a bread pudding. 
3 cups milk
2 tablespoons sugar
3 eggs
Big handful of raisins (OK ½ cup or so)
4 slices white bread without the crusts.
Nutmeg, cinnamon, or whatever.
Tablespoon brandy.

Butter a dish and then put the bread, in rather largish chunks in it. Throw the raisins in and mix thoroughly. Beat the eggs, add the milk, sugar and brandy (optional). I'd add the spices at this stage, but it's traditional to sprinkle them on top. Pour the egg mixture over the bread. Let it soak for a bit. Since “a slice” of bread is an uncertain measure, if it's really swimming you may need to add more bread. Sprinkle with the spices if you want, and maybe put a little brown sugar on top. Bake at 325F (150C) for about 45 minutes until it is mostly set and the top is brown.

Even a baked apple would be a surprise. 
Wash and core as many apples as people. Mix some raisins, cinnamon, maybe some ginger, with some fresh bread crumbs (NOT THE STORE BOUGHT DRY ONES). Add a little milk to moisten the mix. Stuff the cored apples with it. Bake in a hot oven (400F, 190C) until soft. Modern recipes say to wrap them in foil, but that wasn't an option. So I'd use a covered, buttered baking dish. It will take something between 45 minutes and an hour to finish. Serve with custard (I cheat and use Bird's) or ice cream (which is even easier).

My goto book for these sort of recipes is Jane Garmey's “Great British Cooking, a well kept secret.”
a Rafflecopter giveaway

Friday, May 29, 2015

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.

Friday, May 22, 2015

Toughening up Jefferson's disks.

Cryptanalysis plays a pivotal role in the latest regency romance/proto steampunk story I'm putting together. There's nothing like enough room to put the background in the book, and unless you're interested in it, it would be dull reading.

I wanted to create a historically plausible cryptosystem that was tough enough to require a concerted effort by the British. Jefferson's disks, Bazeries disks or strip-ciphers are variations on a theme. A theme that was known at the time and would have been dashed difficult for a cryptanalyst of the day to solve.

Every non-perfect cryptosystem leaks information. The aim of the cryptanalyst is to use that leaked information and plausible assumptions about the message to recover the key and thus the message. For example, with mono-alphabetic substitution in a cryptogram the string 'xyz' must be a three letter word. The trouble is, it could be 'the', 'are', 'she',  'our', and about ten more. There is not enough information to go any further. If we can add more information, say 'xyz xqrz' then we can limit the choices. It's still not quite enough for a unique answer, but it's getting close.

The primary key in Jefferson's disks is the set of disks. Each disk has a permuted alphabet on it and that permuted alphabet is very rarely changed. The session key, a key that can be varied with each message, is the order and number of the disks. (The device shown above always used the same number of disks but let you shuffle them around.)  The session key is critical, because someone could steal the device and know the primary key, or at least the current primary key. The session key keeps the unauthorized user from reading the message, or so we hope.

The cipher machine is set up with the disks in a specified order (session key). The disks are turned until the message is on one row, and then some other row (the readout row) is sent as the cipher.

If you know a likely message or 'crib' and have the disks, then you can use the distance along the disk between the message and its encryption to find the disk order. (Wikipedia is clear here so I will defer to that site.)

If you don't know the disks and the messages, then things are tougher. Given enough messages, an attack in depth can be constructed. One uses the incidence of coincidence to find pieces of message that have used the same disks in the same order and same readout row. Then a frequency analysis can be used to guess the permuted alphabets. It's a lot of work, but the German Pers-40 in WW2
managed that against the American M-138 strip ciphers. Since these were only low-level tactical ciphers for things like "bomb the next hill," it didn't help them very much.

There are two composition methods that can greatly increase the security of the system.
  1. Simple crib-based can be prevented by first mono-alphabetically enciphering the message. Then the session key is the disk order, the mono-alphabetic cipher, and the specific readout row. It's basically the same as having a bigger basket of disks to choose from. This is a bit illusory, something like the 'stecker board' on enigma. It makes the attack harder, but doesn't in the end defeat it. Given enough messages in the same mono-alphabetic cipher, the attack in depth will solve it. More importantly, it can make attack in depth easier, since every line in the cipher will come from the same readout row.
  2. Reorder the wheels every time you use them. When you get to the end of the first line of the message, take the disks off and put them on in some other order. The session key is now much longer. This makes it harder to build up enough depth of messages to mount an attack.
The French, in the book, will use both variations. In the story, the hero meets the heroine when he's forced to take leave and rest so that he can continue to work on the ciphers.

Fortunately, I might add, the French didn't use these approaches. They had a sophisticated two-part code that "should" have been secure. Instead they would only encode parts of a message, which let Major Scovall decode them.

Wednesday, May 20, 2015

Science fiction Summer Cafe

I'll be participating in the first week of this with something derived from Cynthia the Invincible.

My next SFR work being in agent limbo for the moment. (If they'd just make up their minds, I'd know what to do with it.)

Saturday, May 16, 2015

On Steam Power in the Very Early 19th Century

One of the books I'm writing is set about 1805-1810. The Heroine is besotted with the idea of using steam power.  I thought I'd put down a few notes on the background. Just to set the record wrong on a few critical points.

Watt's patents were still in force at the time. His big improvement was the use of an external condenser. The previous state of the art machines (Newcomen steam engines) used a jet of cold water as part of the engine cycle to cool the steam in the piston. Watt's external condenser doubled the efficiency to all of 4% or so.

Watt engines worked backwards from the way we'd think. The steam pressure was barely above atmospheric pressure, and it was the vacuum produced by the condensing steam that made the piston move. This meant the engines were big and "static"
The amount of work you could get from the engine was proportionate to the size of the piston, since the pressure doing the work was nearly constant. Low pressure also meant that the piston seals and boiler construction weren't exactly critical components.

Trevithick and other innovators were forced to go to "Live steam" or high pressure because of Watt's patent on the external condenser. High pressure in those days was several atmospheres. This mean you could have smaller, mobile engines. Trevithick took advantage of that to make both rail engines and things that vaguely resembled cars.  One of his inventions, after a boiler explosion, was a safety valve. Smaller pistons and higher pressures meant the engines worked the way we'd imagine, with the steam pressure pushing the piston. (Once Watt's patents expired they added an external condenser.)

The materials available for construction were basically wrought iron and brass or copper. Cast iron is unreliable under tension due to having microscopic cracks formed during cooling. The iron could be hammered to approximately the correct shape and size, but would have to be machined for a precision fit. Even then it would take careful hand fitting to make things work. (Hence the phrase a "steam fitter".) Modern precision, modern materials, and controlled manufacturing are more than a century away. For example at the start of WW1 about 1/2 the steel receivers of 1906 Springfield rifles were rejected as too brittle due to "eyeballing" the quality of the steel and temperatures during manufacturing. This meant that "high tech" could sometimes, and did quite often, involve high risk.

Sunday, May 10, 2015

French cipher systems in the Napoleonic War.

One of the books I'm writing will have the heroine and the hero for that matter, working on breaking a difficult French cipher. I'll have them work on something based on Jefferson's disks

(Image from wikipedia)

Given the technology of the day, this would have been very difficult to break, and even today if used correctly would give the NSA fits. (They'd still break it, but it could be made harder if it were used as a superenciphering step.)

That said, I'd like to set the record straight. According to "The Man Who Broke Napoleon's Codes, the story of George Scovell" by Mark Urban, the French weren't that sophisticated. They actually had in their "Le Grand Chiffre" a sophisticated two-part code of 1400 or more groups. It possessed redundancy for common phrases and a number of similar good features. It was certainly better than the "Playfair" ciphers the British would adopt in the 1830's.

The trouble is the French clerks were lazy, and laziness, while a virtue in computer science, it is a disaster in security. They would only encipher parts of the message and the context would give Major Scovell all sorts of clues to what the rest of the message meant. Things like "after the battle at 872 last week general 8.5.6...." Needless to say, they would have been much better off either encrypting the whole thing or sending it just in plain.

Then that's why I'm blogging in English and not Francais.

Thursday, May 7, 2015

Another writing community.

I've been taking a look at tablo ( It's an interesting and possibly much better online writing tool than wattpad or writeon. A small startup in Australia, it has a witty banter in the header, a reliable conversion for *.docx files (even those from Libreoffice!) and works well.

The killer app for it is it's ability to analyze reading statistics. There's a free trial, which I haven't used yet, as I'm waiting for a statistically significant number of reads. It looks to be extremely powerful as an analytic tool.

Good points:
  • Clean interface
  • Reliable and easy conversion from word processor files. Word format is the most reliable.
  • Friendly chipper attitude. It is a pleasure to use.
  • There is a user community similar to that on writeon.
  • It is an aggregator like smashwords, but supports only Ios and Amazon
  • It is probably unable to take advantage of Kindle unlimited. This is a major drawback for me as about half my "sales" are made that way. It's a safe way for a reader to explore a relatively unknown author.

Saturday, May 2, 2015

Another try at steampunk

“Amanda Jane Elizabeth Grace, what have you done to yourself?” Lady Caterham wailed at her daughter. “You're covered in grease, and we must leave for the assembly in an hour.” They were together in Lady Caterham's room, where Lady Caterham sat at her dressing table. Amanda stood in the doorway, awaiting instructions. Lady Caterham's maid was waiting to put the finishing touches on her mistresses' gown and hair while Lady Caterham dressed down her slovenly daughter.
“I was just repacking the bearings. We don't want the wheels to fall off our carriage, do we? The roller bearings Sam and I put together turn so much easier than the old wooden axle, and I think you'll like the way we've sprung the box. It-.”
“And that's another thing young lady. Playing around with machines. Why, look at those hands. Even if Mary can clean the grime from under your nails, what man would look twice at you with those hands?”
“There's more to life than men, mother. There's steam and machines and engines.” Amanda's enthusiasm grew as she spoke.
“No there isn't, at least not for a young lady of refinement like yourself. Do you want to die an old maid, alone and forgotten?”
“No, not as such. It's just. Well. Oh dash it Mother, the man for me won't be upset with a little grease.”
“One more thing young lady, watch your language. Where did you ever pick up such an expression? Keeping company with that blacksmith?”
“Oh no Mother. Sam is very polite. At least when I'm present. Ask Mary about him if you want confirmation. It's Freddy and his friends, when they come in from the hunt, who use such expressions. I thought.”
Lady Caterham spat out, “You don't think. That's the problem.”
“I do. If my brother can say it, and far worse, then it's suitable language.”
“Suitable for a man that is. Now go, get cleaned up. We must not be too late for the assembly. Not if you want a dance.”
“Yes, Mother.”
Lady Caterham ignored the tone of that last remark and watched as her eldest daughter, a striking, tall, auburn-haired young woman walked off to change into the dress of a refined and cultured young lady.
“My Lady,” Millicent, her maid, pointed out, “Miss Amanda will have no trouble attracting male attention. She's a fine looking young woman. As you were at her age.”
“That's true, but she'd look so much better without that black grease streak covering her forehead and staining her hair, or that house-dress. It's just so torn and patched, stained with who knows what, and covered in grease. How can she stand to wear it?”
“I don't know Ma'am, but she'll be presentable. Mary will see to it.”
“I'm sure she will, but I so wish Amanda would focus on the important things in life. Like marriage, men and children. Get her head out of the clouds.”
“Or the steam, Ma'am. I've heard that the xxth regiment is stationed nearby. There should be plenty of fine young men, officers in their red-coats. That should catch her eye and turn her thoughts in the right direction.”
Lady Caterham thought for a few moments and then replied, “I hope so. Although last time, she ended up talking all night to an engineering officer from the artillery. A nobody, who was a captain just because he'd been to school at the Royal Military Academy in Woolwich and knew how to move guns and build fortifications. It would have been better to leave her home.”

Much to Lady Caterham's relief, and fully justifying the expense of hiring her, Mary turned Amanda out dressed in the proper mode of a young lady. The grease was gone from her face and her hair was immaculate, as were her muslins. She wore a simple string of pearls, suitable for a young woman venturing into the wilds of society. While no amount of cleaning could restore her hands and nails to the pristine state that was so important in a fashionable young woman, she would be wearing gloves anyway. One did not hold hands without something between you and the young man.
Amanda did nothing that spoiled Lady Caterham's trip. While she may have cast an eye over the bearings, axles and springs, she didn't stop to play with them. Indeed, without the squeaks, the jarring and the shaking normal in a carriage, Lady Caterham arrived at the assembly in a remarkably refreshed state. When they arrived at the assembly, Amanda was swept away by one of the officers, a captain, onto the dance floor. All in all, it made for an outstanding start to the evening.
The vicar's wife, Mrs. Peabody, addressed Lady Caterham, while she and the other mothers watched their daughters perform the figures on the floor. “Lady Caterham, I know you suffer in the carriage rides and I was planning to offer to chaperone your daughter, but it looks like you're well. Did you find a cure for the travel sickness? I only ask because I suffer too.”
Despite her misgivings about Amanda's mechanical interests, Lady Caterham's bosom swelled with pride as she said, “It was Amanda's doing. She redid the springs and the axles on our carriage. It was such a smooth and quiet ride that I barely noticed we were moving.”
“She did? I must say, she is a clever girl.”
“And see, she's dancing with.” Lady Caterham stopped, “Who is that?”
“Oh, that's Captain James' cousin. He's studying divinity, at Oxford.”
“A suitable connection?”
“Absolutely, quite nearly related to the Fairfax's. They say he will inherit a sizable income. With his family connections, he's bound to become a bishop.”
Lady Caterham smiled at Mrs. Peabody. “In other words, a connection to be encouraged. I do so hope Amanda will find something other than machines to tinker with.”
“I agree, a husband and children will soon put her head straight. Settle her down.”
Their happy optimism about Amanda's prospects would have been tempered had they been able to hear her conversation with the young man. While good looking with blue eyes, dark hair and a firm visage, able to dance the figures with a natural athletic grace, polite, educated and well mannered, he was also a disappointment.
“Mr. James, you're studying divinity?”
“A suitable study for a gentleman, honorable and in the service of both man and God.”
“If you say so, but with a chance to meet Dalton or Henry or,” and here Amanda gave a frisson of excitement, “Even Faraday. You have the chance to study natural philosophy with such masters, and you choose divinity.”
“What's wrong with divinity?”
“Nothing, except.”
“Except what?”
“It's so commonplace. I'd cut off my right arm to study with any one of those men and you're just wasting the opportunity.”
Mr. James was nonplussed. Unable to think of anything witty, eventually he replied, “Please don't do that. You have a pretty, indeed beautiful right arm. It wouldn't look right, replaced with a hook.”
Amanda smiled back and laughed as she said, “I didn't mean it literally, but I'd kill someone for the chance you have and are throwing away.”
“Please don't do that either. I suppose I could try law.”
Amanda's grimace suggested that option was, if anything, even less appealing than divinity.
Still, Amanda couldn't help feeling disappointed when the dance drew to a close and it was time for the supper break. Mr. James bowed and returned to his cousin's company, while she found her mother.
Lady Caterham's interests and hopes were peaked, and she asked, “So, Amanda, what did you think of him? He has real prospects.”
“About Mr. James?”
“Who else?”
“He seems a nice enough man. Although I wish he were doing something with his education. Something worthwhile.”
“Damning me with faint praise?” It was Mr. James. He had walked up behind them and was carrying a second cup of punch. “Miss Caterham, I thought you could use this, after your exertions on the dance floor, and with the crush.”
Amanda blushed at his attention, then curtsied, accepted the punch from him and said “Thank you. I didn't mean to disparage you.” Her mother beamed at Mr. James, but fortunately remained silent.
He replied, “You didn't say anything that you hadn't told me to my face. It is true, divinity is dull work, but I never had any aptitude for philosophy or engines.”
Lady Caterham loudly whispered, cautioning her daughter, “Amanda, behave. Watch that tongue of yours.” Mr. James did not fail to notice Amanda rolling her eyes at the admonishment, nor that she kept smiling at him.
He added, “It may be a liberty, but could I ask for a third dance? That is if you are free.”
“She accepts,” Lady Caterham injected.
“Mother, please. That is so fast, to dance three dances with the same man. What about my reputation?”
“What harm can there be when the man is so obviously moral. When do you take orders, Mr. James?”
“Early next year, when I finish my studies at Oxford. Miss Caterham, if you would rather not dance with me, I'd be disappointed but willing to release my claim.”
“No, no, I didn't mean that. Yes, I'd love to dance with you again. Please. Even two more times.”
“That is excessive,” Lady Caterham added.
When the next dance started, another country dance that would let the participants converse between the figures, Mr. James asked, “So Amanda, tell me about these engines of yours.”
“I don't have any engines, right now. Sam and I are building another one. It will be a corker.”
“My maid's husband, a blacksmith.”
“So not a rival.”
Amanda laughed, “Good Lord, no.”
“Good. So if you don't have an engine, what else are you interested in?”
Amanda paused until the next chance to talk, and then replied, “Bearings, bearings and springs.”
“I want to go fast, very fast, so quickly that the axles would smoke and the wheels fall off with a regular carriage. Sam and I can build the engine and the gears, but need a carriage that will handle the power.”
“I suppose your family approves?”
“What they don't know won't hurt them.”
“If you say so, Miss Caterham, but I've found keeping secrets leads one into sticky situations.”

The evening ended well, at least the dancing did. Partway back to Caterham hall, when the carriage went over a steep bump, there was snap. It was followed by a gentle hiss and the box leaned to the right.
Lady Caterham was startled, “What was that?”
“One of the seals broke. Blast.”
“Amanda! What did I tell you about your language.”
“I'm sorry. It's just Sam and I put such a lot of effort into building the springs. To have one fail so quickly. It's highly annoying.”
'”I just wish, Amanda, that you would pay attention to the important things in life, marriage and men.”

Friday, May 1, 2015

book sale

My latest two are on 0.99 sale for the week.
 the Berkshire Lady
The Curious Profession of Dr. Craven


LOLcat in the 18th/19th century?

I was just cleaning up details from my last book and looked at the page for William 1st Earl of Craven. He should be distinguished from his father William the 6th Baron and his son William the 2nd Earl. I noticed something odd in his miniature, the eyes were too big.
He looks to have been a handsome enough man,though possibly painted as an "Idealized representation and not a true portrait of the idiosyncratic features of the individual" (S. Baldric). The artist used the same trick of making the eyes bigger to make him more appealing that is used for velvet paintings of cats, puppies and children. Not to mention Elvis.