Continue reading »]]>

The pots were big, holding probably between 10 and 15 normal cups-sizes worth of coffee. Unsurprisingly, I had to make coffee about once every 10-15 days.

More recently, there was a change to the coffee room. Now there are six urns – two for each of the three flavors (Dark roast, regular, decaf).

Now, I make coffee almost every day. Because when I come in, one of the two dark-roast urns is empty, and the other is half empty. And I feel obliged to make more, since one is empty.

Basically, the coffee room has turned into a big conscientiousness test.. I think I’m passing.

]]>Continue reading »]]>

There were several other languages out there, that were used for various projects – FORTRAN, C, Pascal, Ada , to name a few big ones.

But it didn’t matter for “enterprise” software.

In the mid 90s, two things “exploded” – the Internet (because of the World Wide Web) and Java. Over the next decade or so, Java essentially took over as the “enterprise” software leader. Other languages had tried and failed. Java succeeded almost despite itself – the EJB constructs were incredibly clumsy and overly-complicated, it wasn’t super fast, and the language was (and is) often clunky.

But Java came with the Internet in its DNA – and as the Internet exploded, COBOL was simply not equipped to keep up.

Java succeeded because it rode the coattails of the “next big thing” all the way to glory. COBOL simply wasn’t the safe choice anymore, because it was clearly obsolete.

Over time, Java became the safe choice, the one with the libraries that everyone knew.

When you talk about a language displacing Java as the dominant “enterprise” language, you have to have the second part – you need a major upheaval that makes the world realize that Java isn’t the safe choice anymore.

So the key isn’t the features of your language. It’s finding the things that the language can do that Java can’t, and in such a way that it’s obvious Java won’t be able to do it for a long time.

I know Java, I make a living knowing Java, but I also know that it won’t last forever. But you’re probably not going to replace it anytime soon.

]]>Continue reading »]]>

The concept here is verification – was this message sent by someone with access to a specific private key. For example, consider Paul Revere, waiting for a message from Robert Newman. What if somehow a British spy knew that Paul was expecting an email from Robert, and wanted to fool Paul by pretending to be Robert. For Paul to be sure the message is legitimately from Robert, it doesn’t matter whether the message was *encrypted *with Paul’s public key – after all, anyone could have the public key. To be verified, the message must be *signed* by Robert’s private key. Remember, this isn’t about encryption – the signature is “in the clear” – anyone can see it.

So we need a new public/private key pair for Robert Newman. Since I’ve already gone through the effort of explaining how to calculate them last time, I’ll just provide you with the numbers themselves this time:

*n*is**221***e*is**191***d*is**383**

To sign text, you use the private key to create a cryptographic signature. Robert is following up from the previous email, he wants to tell Paul how many boats the British are rowing across the river. So he wants to send the message: “5”.

so:

*m*is 5

The signature s is calculated by the formula: *m^d % n*

Remember, *d* is part of the data that Paul has kept private. Only he knows what d is.

*m^d* is 5^383 which is:

5075883674631298446548049111661087093647237699402191163212120642478953395778598947864814858111568572459329182115501791693204142684887253405561412715352359556877432999471390133765317641336487613681905654361561422102765594427495506046899009788830881007015705108642578125 That number modulon(i.e. 221) is: 177

so:

*s*is**177**

So when we send this communication to someone, we send both the message itself “5” and the signature: “177”

To verify the signature, we want to see that* s^e mod n* == the message. Remember, *e* is part of the public key.

s ^ e is 177 ^ 191 or:

2306183577149085201596305325596159226547118569300925189229389857203796357207862044982857315199283790476827017647730527617852804108867519414430432193245871218986251822073578619863609881193149770246390198636414790783766688663380790017386360674016112360841035988551564172980501137196833264766988401289008585444215905916895724644294397505093631160639335548542153668065643942589783649622290133120663019258868021033347931734637973384273 And that number modulon(i.e. 221) is:

5

And that’s how Paul can know that this message was sent by Robert Newman.

In the original scenario, Robert Newman wants to tell Paul that the British are coming by sea. So he encrypted the code number: “3” with Paul’s public key, knowing that only Paul can decrypt it. As you saw from the encryption demonstration walkthrough, the actual message that Robert sent was the value “70”.

And realistically, we’d want Robert to sign that message “70” with his private key. This provides the best of both worlds – only Paul can decrypt the message, and it could only have been sent by Robert.

So what is the value of the signature for a message with the value 70? I leave that as an exercise for you.

]]>

Continue reading »]]>

But I’ve struggled with understanding how you get from that fact to encrypted text. So, using some resources, I finally sat down and tried to walk through a simple example, just so I could get the concept. This is my story.

Here are two links that describe the basic algorithm:

- http://crypto.stackexchange.com/a/398
- http://www.ee.ic.ac.uk/pcheung/teaching/ee4_network_security/L06RSA.pdf

I used Google Sheets to do my work, and I ran into a problem right away – Google Sheets (and also Excel) can’t handle the ridiculously large numbers that get produced during the algorithm. So I found a website that provides an arbitrarily large number calculator:

Armed with these four resources, I was able to walk through a toy problem:

It is April 14th, 1775. Paul Revere is waiting for an encrypted message from Robert Newman, the sexton of the North Church. Robert will email him a message using Paul’s public key. Because ‘1’ is boring, the encrypted contents will either be ‘2’ if the British are coming by land, or ‘3’ if the British are coming by sea.

So first, Paul needs to calculate his public and private key pair. This being the 18th century, his mathematics are limited. So he uses very small prime numbers for *p* and *q:*

*p*=**11***q*=**19**

Using p and q, he can calculate n -> p x q = *n* == 209

so:

*n*=**209**

Now, per the algorithm, he needs to calculate “Theta N” or Theta PQ” depending on who you ask. I’ll use Theta N

Theta N is (p-1) x (q – 1) == 180

so:

*Theta N*=**180**

Now he has to find a number* e* such that *e* is relatively prime to* Theta N*. Relatively Prime, in this case, means a number x that doesn’t share any common factors with y. The simplest version of this is y – 1. In this case, y is *Theta N* which is 180. Which means that e is 180 – 1

so:

*e*=**179**

Lastly, he needs to determine *d*. * d* is a number such that *d* x *e* modulo *Theta N* is 1 . There are a lot of numbers that fulfill this, but a relatively small one is 359 (179 * 359 == 64261) and then that number modulo *Theta N* is 1: (64261 % 180 == 1)

so:

*d*=**359**

Paul keeps *p*, *q* and *d* a secret. He gives *e* and *n* to Robert Newman (the sexton of North Church, remember)?

It is now the evening of April 18th, 1775. Robert Newman is watching from his church steeple, and he sees the British rowing across the Charles river. “Two if by land, Three if by sea!” Robert Newman cries out. He quickly gets out his abacus and starts calculating.

The encrypted message is the number 3 . The algorithm says to raise the message to the power of *e*, and then modulo n . Remember, Paul gave Robert *e* and *n* on the 14th.

so:

*M*=**3**

First step, he raises *M* to the power of *e : 3 ^ 179*

which is:

25392449348622130779763242573538520583474933800798398908000521914985712447677679339867

And then he uses modulo to calculate the remainder of division by *n *(or 209)

766247770432944429179173513575154591809369561091801088 % 209 == 70

so the Ciphertext (*C*) is 70

This value “70” is what Robert Newman emails to Paul Revere.

Minutes later, Paul Revere receives the encrypted Ciphertext “70”. He quickly rushes to his abacus. To decrypt this message, he needs to raise the value *C* to the value of *d*, and then modulo* n *:

C ^ *d* is 70 ^ 359 which is the very large number:

`245581905687899006065404520776172863944611519146732083123975951780500286553118568921879462320859251758278449748144668631352431481302377928250788881312035116052180416047855183260490937481296130089706428877993897824080669097996701622103603111415606168055270717070910946272013501845364843417445259008414514300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000`

(The poor abacus is melting down)

Now he just needs to divide this incredibly large number by n to get the answer. n is 209, and that incredibly large number modulo 209 is:

*Drumroll….*

Now, the question for you, dear reader, is to determine what the ciphertext would be if the British had been coming by land. I’ll give you a hint, C ^ d is 726 digits long, the first two digits are 40 and the last two digits are 25.

]]>

Systems Thinking: http://www.samihonkonen.com/14-habits-of-a-systems-thinker/

]]>Continue reading »]]>

But I think he misses the key thing that paralyzes me on a regular basis, and keeps me from being more vocal about my opinions and philosophies (of software development, etc).

And that is that I don’t want to waste your time. You only have so many hours on this Earth, and if I write something that doesn’t make sense or doesn’t resonate, I feel bad, because I’ve wasted your time.

Now, obviously, this doesn’t matter to most people who post stuff – they are happy to post/write whatever, without a particular care about how it’s received. And I respect that, from a courage-of-willingness-to-share perspective. But I also think about the other side – the minutes that the reader is not getting back.

Obviously, if everyone felt this way, almost nothing would get written, except by sociopaths and narcissists. And I think that everyone can agree that a world in which only narcissists and sociopaths shared their opinions would be bad.

So there’s a balance. I just have to figure out where it is.

]]>

Continue reading »]]>

- Listening & Seeking to understand (highly related)
- Admitting what you don’t know
- Treating complexity like a hand grenade
- Thinking about the long term purpose/destiny of your code
- Knowing where the future changes are likely to be

I’ll try to flesh each of these out in separate posts.

]]>

Authors improve with age

?

*Some do. For example, in many years time, Stephenie Meyer will be dead.*

Golf clap

]]>This post caught my eye on Reddit: “We don’t need more programmers, we need better tools” And I felt compelled to respond, because I disagree vehemently with almost everything this author has written.

I’m of a similar age to him, and I had some of the same initial experiences – programming in BASIC on TRS-80s, TI-99/4a, and then Windows PCs. So I feel like I can knowledgeably comment on his article.

He writes:

Every now and then someone will say that we need more programmers. That every child should learn to program in school. That programming is the new writing.

…

If you try to cram more people into any profession, then the only additional people you will get are those who are average or even subaverage. If you do that, you will end up lowering the skill-average of that profession.

Ok. One can theorize about a world in which every single person who is “above average” in programming ability is already a programmer. If you add one more person, who must therefore be below average, you will be reducing the overall skill level.

But there is absolutely no reason to believe that is the actual world we live in. Programming is a skill without a lot of “sex appeal”, with known issues with misogyny and ageism. Lots of people who might have incredible talent never even start programming, because they don’t fit the standard “white / asian / indian guy” profile. The benefit of teaching everyone to code is that they will find that they enjoy and are good at it. That’s only part of the solution to the “we need more/better programmers”, but IMO, it’s a vital one.

Almost everyone will probably think that tools have become a lot better over time. But have they really?

…

Give a 14 year-old, one who has never even used a computer before, a computer in its original box and see how long it will take him or her to write their first program. My guess is that it will either take weeks or not be accomplished at all.

Well, let’s see. In order to write a simple tic-tac-toe game, you need to install javascript, a browser, and a text editor (and a tutorial to show you how to get started). Yes, that’s complicated.

Oh wait. all of those are already installed on your PC when you get it. Or on your Mac, or on your Linux box.

And in a lot of ways, Javascript is far superior to BASIC. You get a lot more graphical expressiveness for free, when you interact with HTML… but you don’t have to use that…. You have the source code for thousands of other Javascript programs just a right-click away (view source). It’s a simple introduction to programming, and if the 14yo enjoys it, he can then start to branch out towards compiled languages and editors and databases and registering for tools, etc, etc.

And that’s just to start. Consider this challenge: “Create an easily-installable audiovisual application for an embedded device which interacts with the touch sensors and delivers compressed sound data to the device’s audio drivers”

I decided I wanted to learn how to program on Android a few years ago. So I connected my phone to the USB of my computer, downloded the SDK, looked at some example code, and had a viable prototype soundboard app working on my phone in about 4 hours. The tools these days are often fantastic, especially considering how much complexity they abstract away.

If we ever actually get to a world where everyone who has a talent for programming is programming, that’s a good problem to have. Let’s get there first, before we start trying to fix other things.

]]>