October 31, 2018

Michigan Gerrymandering Proposal

In the upcoming election, in Michigan there is a proposal to change the way that districts for congressional elections are created (Proposal 2).

Currently, the map of districts is drawn by the state legislature. In 2010 there was a backlash from the Obama administration and the Republicans took complete control of the Michigan legislature. They then proceeded to draw some questionable districts which favor the Republican incumbents, and so even though the State elects Democratic senators the Republicans control a large majority of Michigan's delegation to the House of Representatives.

The proposal on the ballot would change this so that an "independent committee" would instead draw the district lines.

I thought it would interesting to see how different the map would look if made in a way that was not so partisan. First, let's take a look at the current district map.


Some things to note:
  • Districts 2 and 3 meet in the Grand Rapids area, the way that the line is drawn makes both districts lean strongly Republican, since the Democrat leaning areas are split. If the line was straight then district 3 would be more of a toss-up.
  • Districts 4 and 10 lean Republican, all of the Democrat-leaning areas of Flint, Saginaw, and Bay City were combined into one district to make the other two strongly Republican, rather than having 3 toss-up districts.
  • District 8 includes most of the very left-leaning Lansing, but conveniently stretches around the top of the Detroit suburbs to reach the right-leaning Rochester Hills, making a consistently Republican district.
  • The way districts 9, 11, and 14 spiral around each other just screams Gerrymandering.
So I made my own map. First I tried to follow county lines as much as possible, grouping adjacent counties together to get close to the population of a representative district, and only splitting up counties that contained a higher population than allowed in a district (Macomb, Oakland, and Wayne counties). This worked nicely, getting each district pretty close to the right population. The result is shown below.

The lines around the Detroit area within counties I left rather vague, for the actual map a similar approach would be taken, trying to follow city and township lines to make the district as compact as possible. For example, Macomb county has its population concentrated at the south end, so the actual line would be much farther south.

My initial guess would be that Democrats would control districts 8, 12, and 13, Republicans would control districts 1, 2, and 9, and that there would be more of a toss-up in the other eight districts.

Update: The redistricting will take place after the next census. Estimates are showing that Michigan will lose one congressional district. So I decided to make a second map using only 13 districts.



September 11, 2018

Security Theater

The other day I was at the hardware store with my wife. She has been thinking of installing cameras around her business to keep an eye on things, and so we were looking at the store's section of security cameras. I noticed on the shelf they had a couple boxes that were pretty cheap, only ten bucks, and so I picked one up to look at it. To my dismay, I found out that this is not an actual camera, it is a decoy. It even comes with a little blinking red led so that it looks like it is on. Not only did they have decoy cameras, but these are offered by multiple brands.

This is just silly security theater. These decoy cameras project a sad facade of security with no actual security behind them.

July 30, 2018

Fasting Prayer of a Young Boy

My Sunday school teacher said to me
That fasting is good for the soul.
And though I'm a lad of tender years,
I thought I'd give it a go.

My stomach rumbles, my head is faint;
Oh, this is how I'm brought low.
I perish! Unless I break this fast
I started ten minutes ago.

-

July 11, 2018

vdiff_sha_define_swap.vpatch

Recently I tried building vtools on a windows system running cygwin. I found that there was one function it barfed on, SWAP_BE64. I did some digging, and I found the code was taken from busybox. I dug around a bit there, and I found where the thing is defined, so I copied that definition into my copy of the program, and it worked.

Keep in mind, this function seems to depend on the endianness of the machine, so in the busybox code there are a bunch of #IFDEFs surrounding this definition. If you are using a big-endian machine then you would want to apply a different definition for this function.

This is a patch using sha hashing. There seems to be some movement leaning towards using the Keccak hash for vpatches (see this discussion and that following it), so I might have to get a Keccak hasher and regrind this later.

File vdiff_sha_define_swap.vpatch :

diff -uNr vdiff_a/vtools/manifest vdiff_b/vtools/manifest
--- vdiff_a/vtools/manifest cece6cf281356c63d1f0a935d8f772345b51f63bc77ada2b70646b395036a22a88962e06661dee77977e1d434290adec5d76e540597bbd2213a36cb5890a8cf8
+++ vdiff_b/vtools/manifest 2e651c3ae3f563a3ee7f6a0cfbd3f18e76bf57f81615643e6df3c60f6d6a2d868a5ff9809de76184ee9779091d621ef088d5f695c2c7d9d5b0fd040d7173ab8f
@@ -6,3 +6,5 @@
Fixes C99 compatibity for __attribute__((noreturn)), vdiff support for "No newline at end of file" directive.
2018-04-07 phf
Fixes for xalloc's use of static inline courtesy of spyked.
+2018-06-28 PeterL
+Added definition for SWAP_BE64 in sha.c (valid for littleendian system).
\ No newline at end of file
diff -uNr vdiff_a/vtools/src/sha.c vdiff_b/vtools/src/sha.c
--- vdiff_a/vtools/src/sha.c 8ef7baea0ae21e44b34318a0202e3a7c4ca1fe4df6c1a8a29d8a5eeee930926968ea9bd062c514460208bf89e2fa4ec958950c3776b47513cd5979961e4182c6
+++ vdiff_b/vtools/src/sha.c 3eac373f23f903ef55354750cf8921a705aefa2cb61a1e8acc0fc091fc357b434fd0598822f90beaa1d1c4ecf4ede4d2184eb12764f806d304fc70575967a4a5
@@ -3,6 +3,9 @@
#include
#include

+/* SWAP_BEnn means "convert CPU<->big_endian by swapping bytes" */
+# define SWAP_BE64(x) __bswap64(x)
+
/* \url{https://git.busybox.net/busybox/tree/libbb/hash_md5_sha.c} */

static inline uint64_t rotr64(uint64_t x, unsigned n) {


And here is the signature for the file, vdiff_sha_define_swap.vpatch.PeterL.sig :

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAABAgAGBQJbRsWTAAoJELTi4Nystj0ltSUP/A9V+5pjBVYr6qOZLOYCOF6c
/pU4YvdVW9sMc6EZ/p0Vdq6bWGr/RIhkgMiPsHhnxsdHS6xSpEFGWOMj+mzOBjRd
7sJl3GEZ14kKbweP+Z/Uwky/yYG5MAKORLBGb24HF+aBdShq3GqQFcd2B9Rb/F3g
YgIwLY4gVBsFFgjTBR47/9rXJAgpJKb3S/dPQ3sdWoLXb1ZO4ayZfzcjeCmEpuyq
DbjSbPiiHvfoTSJ4/N8UdNSAccV1UKofnpnnhQ4A43mEQ3T00Q7tnI7NzW3wLD3K
3PPEQOduAffdrPbliigVLQhDOzHiIyuQhENVI7N8IQwUxvjF6RJ3A+YWHeMAvLf9
yTOf7DSIUWMee4YX02ZhPvclomrG9+PRJUkDsk7LqwoNxVEo5ZeXlPFIE4zBYQZg
F+my5bNl4OqJzJT/0voMMza6oDNXIigX/kSqJuCEuQ+dMX0XgbiejX94GmAWO+qB
DuyQuYCdslH8dVmEd1UBKQKL/6or6HFxTOSDDUUdfcRBbrWLFdToyaWMxIz3Ea5z
m8hcDi+olE5yTKz6DAvy0SDrOwlOk0cCXoeo1XuiVVwfdzRiYPFKWkWFqFleZghm
FIZif8TuRJl6LunzV2L9P2RZn2sNuN59cuwC0e7+7XW1XroP1VPmLNP+/yaeK/gR
kdTB76aB/ebzaUXqV+U4
=rxQr
-----END PGP SIGNATURE-----

-

Chicken Potato Soup

This is a yummy soup with lots of flavors. I made this soup in an InstaPot (electronic pressure cooker), but you could also make it more traditionally in a pot on the stove.

Ingredients

  • 1 Tab butter
  • 1 Tab cooking oil
  • 3 cloves garlic, chopped finely
  • About a pound of chicken breast, cubed into about 1 inch pieces
  • About a pound of potatoes, cubed into about 1 inch pieces 
  • 1 yellow squash, cubed into about 1 inch pieces
  • 2 cups chicken broth
  • 1 tsp pepper
  • 1 tsp thyme
  • 1 tsp Garam Masala
  • 1 lemon

Procedure - InstaPot

  1. Turn the InstaPot on with "Saute" mode. Add butter, oil, and garlic, stirring frequently. Once the oil is hot, let the garlic cook a minute until it gets soft.
  2. Add the chicken. Stir frequently, cook until the chicken is slightly browned on the outside.
  3. Add the potatoes, squash, broth, pepper, thyme, and Garam Masala. Stir everything together.
  4. Cut the lemon in half, squeeze the juice out of both sides into the pot.
  5. Close the InstaPot, cook on the poultry setting for 12 minutes.

Procedure - Stovetop

Proceed as above, saute the garlic and chicken on medium-high heat. Add all other ingredients, and add water to cover all ingredients, bring to a boil. Reduce the heat to a simmer and cook until the potatoes are soft (check by poking them with a fork).

-

July 10, 2018

Beaches

I recently returned from a week of camping and swimming with my family in northern Michigan. We had a good time, and part of that was the excellent beaches we found. We have set a family goal to try to set foot in all of the Great Lakes during this summer, and we were able to check off three of the five lakes on just this trip. We camped at Straits State Park, located on the Upper Peninsula side of the Straits of Mackinac.

The first beach we visited was at the campsite; this was Lake Huron, but within the shadow of the Mackinaw Bridge. The water was cold but refreshing compared to the summer heat. This beach had some sand, but was mostly rocks. It was a perfectly clear day, with no wind, and so there were very little waves (perhaps 6 inches). It should be noted that the water here is amazingly clear, such that you can stand in water up to your shoulder and still see every detail on the bottom.

The next day we traveled north into the Upper Peninsula. We visited Tahquemenon Falls. It was a nice ten minute hike in the woods to see the falls, which were fun to see but I feel they are a bit over-hyped. We stopped at the first little beach area we came to on Lake Superior, but the beach was entirely make of very sharp rocks, so we didn't stay long. We then had lunch at a little diner in Paradise, MI, where we were directed by the waitress to a beach a bit further down the coast. This turned out to be on the south shore of Whitefish Bay, and it was a beautiful beach made entirely of amazingly soft sand. We had the beach almost to ourselves and played for several hours. The water was cold but bearable, with about one to two foot waves. Being on the south side of the lake, the trees here give shade onto the beach, which is nice for those of us like my family who are pasty white and sunburn easily.

The next beach we visited was on Lake Michigan. We drove about ten miles west of St. Ignace on US 2, at which point the highway runs right along the lake shore. We parked on the side of the highway and jumped in the water. This beach is entirely made of very fine sand, which is fun to play in but gets everywhere: into your clothes, into your towel, into the baby diaper, into the bag of chips, etc. There were also no trees here, the closet trees were about 100 meters the other way from the highway (the water is about 20 meters from the road), and so sunscreen is a necessity here. The sky was cloudless, but the wind had picked up some and so we spent all afternoon playing in the two to three foot waves.

-

June 4, 2018

V-tronics

I have been thinking about v-tronics lately, that is the mechanisms of the versioning system used with The Most Serene Republic, and variously expounded upon here and there and most recently here.

One problem that has been seen is bifurcation of the patch tree, when two patches are created for a project which touch non-overlapping sets of files.  This can be seen most easily if you imagine a genesis with two files, A and B. If patch P1 makes a change to file A, and patch P2 makes a change to file B, then (the way v currently works) the user has to manually apply one of the patches if they want both to apply.

A proposed solution is to add a "manifest" file, which is touched by every patch applied to the project. This adds a nifty way to easily graft two projects together: you just need a patch which touches the manifest file for both projects (in project A manifest: "+added project B", and in project B manifest "+added this to project A") and keeps the v-patches small and readable. That way, even if no changes are made to the substance of the project that is pulled in, the addition will be applied to all later presses.

While I was composing this post, Trinque added a specification for the V manifest.

-

May 29, 2018

Lawnmowers

Some people go running for exercise, but not my neighbor. He mows his lawn three times a week. Usually it is in the evening as my toddler is trying to get to sleep. Sometimes I let my lawn go a couple extra days between mowing just to spite him.

Last weekend I was mowing my lawn and I realized that I had different height settings on the front and rear wheels. I set them to the same level, and was amazed that the result seemed so much more even than the previous week. And so I stated paying more attention to the height setting on my mower.

It is actually quite easy to set the height on this mower, it has levers on the front and back wheels, and if you get down close to it there are numbers on the side so you can easily set it where you want. This comes in handy if you happen to be mowing a thick, wet lawn; I have found that my mower will stall out on such a lawn when on a low setting, but if you raise the mower to a higher setting then it will power on through.

The mower has settings from 1 to 6. I used it set at 3 on my front yard, and set at 4 on the back yard, and it looks nice. The front is crisp and low, and is even with my neighbors, so it looks nice. I let the back be a bit longer because the kids like to run around with bare feet and this makes it a bit softer for them.

I read an article a while back (I will link it if I ever find it again) that suggested an easy way to help a lawn that is being choked out by leafy weeds: set your lawn mower to the highest setting for a few weeks and mow a bit more frequently than usual. This will let the grass grow taller and out-compete the weeds, which spread sideways. Then after the grass is nice and thick you can go back to the normal mowing height.


May 19, 2018

lamport.py

This is a script I wrote in Python to use the ideas expressed by Lamport and Stanislav.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

#!/usr/bin/python

#
# (C) 2016 Peter Lambert. 
# You do not have, nor can you ever acquire the right to use, copy or distribute this software; 
# should you use this software for any purpose, or copy and distribute it to anyone or in any manner,
# you are breaking the laws of whatever soi-disant jurisdiction, and you promise to continue doing
# so for the indefinite future.
#

import hashlib
import os
import sys

#
# Comment out the line below with the hash you do not want to use

# sha = hashlib.sha256
sha = hashlib.sha512


def binmessagehash(filename):
    m = open(filename, 'r')
    messagehash = sha(m.read()).hexdigest()
    m.close()    
    return bin(int(messagehash, 16))[2:].zfill(len(messagehash) * 4)
    
def decode(pubkeyfile, sigfile):
    kf = open(pubkeyfile, 'r')
    pubkey = [line.strip().split() for line in kf.readlines()]
    kf.close()
    
    sf = open(sigfile, 'r')
    sig_keys = [line.strip() for line in sf.readlines()]
    sf.close()
    
    binmessage = ''
    
    for k in range(len(sig_keys)):
        key_hash = sha(sig_keys[k].decode('hex')).hexdigest()
        if key_hash in pubkey[k]:
            binmessage += str(pubkey[k].index(key_hash))
        else:
            return 'Bad signature, hash not found for %s' % sig_keys[k]
    
    hexmessage = '%x' % (int(binmessage, 2))
    return hexmessage
    
def encode(privkeyfile, messagefile):
    pkf = open(privkeyfile, 'r')
    key = [line.strip().split() for line in pkf.readlines()]
    pkf.close()
    
    bmess = binmessagehash(messagefile)
    for k in range(len(bmess)):
        print key[k][int(bmess[k])]

def generate_key(payloadbits, strengthbits):
    if '-s' in sys.argv:
        rs = randstr
    else:
        rs = os.urandom
    key = [[rs(int(strengthbits) / 8) for n in [0, 1]] for m in range(int(payloadbits))]
    for k in key:
        print ' '.join(kp.encode('hex') for kp in k)
            
def output_help():
    print '''Usage: 
        ./lamport.py -g PAYLOADBITS STRENGTHBITS > PRIVKEYFILE  
            generates a key
            
        ./lamport.py -g -s PAYLOADBITS STRENGTHBITS > PRIVKEYFILE
            generates a key with the slower, more secure /dev/random
            
        ./lamport.py -p PRIVKEYFILE > PUBKEYFILE
            creates a pubkey from a privkey file
            
        ./lamport.py -e PRIVKEYFILE MESSAGE > ENCODED.TXT
            creates a digital signature
            
        ./lamport.py -d PUBKEYFILE ENCODED.TXT
            decode the digital signature
            
        ./lamport.py -v PUBKEYFILE ENCODED.TXT MESSAGE
            check that encoded is the correct signature for message
    ''' 

def priv_to_pubkey(privkeyfile):
    pkf = open(privkeyfile, 'r')
    for line in pkf.readlines():
        print ' '.join(sha(k.decode('hex')).hexdigest() for k in line.strip().split())
    pkf.close()
    
def randstr(num_bytes):
    stream = open('/dev/random', 'rb')
    res = stream.read(num_bytes)
    stream.close()
    return res

def verify(pubkeyfile, sigfile, messagefile):
    decoded = decode(pubkeyfile, sigfile)
    print decoded
    
    m = open(messagefile, 'r')
    messagehash = sha(m.read()).hexdigest()
    m.close()
    
    if decoded == messagehash:
        print 'Good signature'
    else:
        print 'Bad signature'

if __name__ == "__main__":
    if '-g' in sys.argv and sys.argv[-2].isdigit() and sys.argv[-1].isdigit():
        generate_key(sys.argv[-2], sys.argv[-1])
    elif '-p' in sys.argv:
        priv_to_pubkey(sys.argv[-1])
    elif '-e' in sys.argv:
        encode(sys.argv[-2], sys.argv[-1])
    elif '-d' in sys.argv:
        print decode(sys.argv[-2], sys.argv[-1])
    elif '-v' in sys.argv:
        verify(sys.argv[-3], sys.argv[-2], sys.argv[-1])
    else:
        output_help()
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJX89k8AAoJELTi4Nystj0llqwQAJpubTEEl4VysaO/IlPExNFl
mQ+md7cBEAmK3ithZcJSS5XsKXhSWs+w6b0IJRQB0r2XMHu4hZUiRicVubkiKtwc
jqZ8ots+Pr9mzcuw4dlVNH6Avr0WPpcObwCEWXzlLVP27kEeXCPSwPTp0Eh3YAgv
YGOkMvu4Yw2HmzwfNlHAdhdAPuNpW7dOHGwZAzBkeWegZDK/urDp7oEIw8D/DBBz
FbH/eXsRcHzmjk1cOi9lgQyaTZ3qSA+ULriSDM/LCjMNso+fKcxO0Pi7MpdNnxTj
l0KMHndWWaJkiROZ6M9zMyUt68/y4F1sJ0T/qy07msVYC8D7p+hEtOOJfAJuWiZL
VgLZzi5WiV93QwnKrJCrRR72SbPyAL9YGFbS5vBbilxv7dktoXUXnTeUP3Ddvn4B
4rW19wha3AZ5AT+ssuC8TggLzlDKlPLsGQmXEtyk7HAN+ynXnQ3ioHwwPOePzGHG
UfNIoXQnXDTLS4jLD09VXf3gYP27gb3ouT7dhOYQ0yignuE/5vvJ2UuneI52VV0i
pupS/vJ4h7qaKFJfhQmsczGkN0SnhyKjjE5Xi4A0NWHLKtaKU9Wxs0f/xA9b8sJg
hLjf2x1+3bHZeMsIPoxjd3z3xeHOgLj+BRSZTUxTmEZnlz6IaTzjNe5iSHL8ucef
tilzFtS1wA4DSSWPDbOg
=WGyj
-----END PGP SIGNATURE-----

May 18, 2018

Constructing Digital Signatures from One Way Functions

This is something I pulled from a pdf a while ago. It was referenced on Loper-OS, and so I thought it would be worthwhile to de-pdf-enate it.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Op. 52

Constructing Digital Signatures from One Way Function

Leslie Lamport
Computer Science Laboratory
SRI International

18 October 1979
CSL 98

333 Ravenswood Ave. Menlo Park, California 94025
(415) 326-6200 Cable: SRI INTL MPK TWX: 910-373-1246

1. Introduction

A digital signature created by sender P for a document m is data
item o_p(m) having the property that upon receiving m and o_p(m) one can
determine (and if necessary prove in court of law) that P generated the
document m .

A one way function is function that is easy to compute, but whose
inverse is difficult to compute [1]. More precisely one way function T is
a function from set of data objects to a set of values having the following
two properties:

        1. Given any value v , it is computationally infeasible to find a
        data object d such that T(d) = v .
        2. Given any data object d , it is computationally infeasible to find
        a different data object d' such that T(d') = T(d) .

If the set of data objects is larger than the set of values, then such a
function is sometimes called one way hashing function.

We will describe a method for constructing digital signatures from such a
one way function T . Our method is an improvement of a method devised by
Rabin [2]. Like Rabin's, it requires the sender P to deposit a piece of
data o in some trusted public repository for each document he wishes to
sign. This repository must have the following properties:

        - o can be read by anyone who wants to verify P's signature.
        - It can be proven in court of law that P was the creater of o .

Once o has been placed in the repository, P can use it to generate a
signature for any single document he wishes to send.

Rabin's method has the following drawbacks not present in ours.

        1. The document must be sent to single recipient Q , who then
        requests additional information from P to validate the signature.
        P cannot divulge any additional validating information without
        compromising information that must remain private to prevent
        someone else from generating new document m' with valid
        signature o_p(m') .

        2. For a court of law to determine if the signature is valid, it is
        necessary for P to give the court additional private information.

This has the following implications.
        - P -- or a trusted representative of P must be available
        to the court.
        - P must maintain private information whose accidental
        disclosure would enable someone else to forge his signature on
        a document.

With our method, P generates a signature that is verifiable by anyone,
with no further action on P's part. After generating the signature, P can
destroy the private information that would enable someone else to forge his
signature. The advantages of our method over Rabin's are illustrated by the
following considerations when the signed document m is a check from P
payable to Q .

        1. It is easy for Q to endorse the check payable to third party
        R by sending him the signed message "make m payable to R ".
        However, with Rabin's scheme, R cannot determine if the check m
        was really signed by P , so he must worry about forgery by Q as
        well as whether or not P can cover the check. With our method,
        there is no way for Q to forge the check, so the endorsed check
        is as good as check payable directly to R signed by P .
        (However, some additional mechanism must be introduced to prevent
        Q from cashing the original check after he has signed it over to
        R .)

        2. If P dies without leaving the executors of his estate the
        information he used to generate his signatures, then Rabin's method
        cannot prevent Q from undetectably altering the check m -- for
        example, by changing the amount of money payable. Such posthumous
        forgery is impossible with our method.

        3. With Rabin's method, to be able to successfully challenge any
        attempt by Q to modify the check before cashing it, P must
        maintain the private information he used to generate his signature.
        If anyone (not just Q ) stole that information, that person could
        forge a check from P payable to him. Our method allows P to
        destroy this private information after signing the check.

2. The Algorithm

We assume a set M of possible documents, set K of possible keys [footnote 1],
and set V of possible values. Let S denote the set of all subsets of
{1, ... , 40} containing exactly 20 elements. (The numbers 40 and 20 are
arbitrary, and could be replaced by 2n and n. We are using these numbers
because they were used by Rabin, and we wish to make it easy for the reader to
compare our method with his.)

We assume the following two functions.
        1. function F : K -> V with the following two properties:
                a. Given any value v in V , it is computationally infeasible
                to find a key k in K such that F(k) = v .
                b. For any small set of values v_1, ... , v_m , it is easy to
                find a key such that F(k) is not equal to any of the
                v_i .
        2. A function G : M -> S with the property that given any document
        m in M , it is computationally infeasible to find document
        m' /= m  such that G(m') = G(m)
        
For the function F , we can use any one way function T whose domain is
the set of keys. The second property of F follows easily from the second
property of the one way function T . We will discuss later how the function
G can be constructed from an ordinary one way function.

For convenience, we assume that P wants to generate only a single
signed document. Later, we indicate how he can sign many different documents.
The sender P first chooses 40 keys k_i such that all the values F(k_i) are
distinct. (Our second assumption about F makes this easy to do.) He puts
in public repository the data item o = (F(k_1), ... , F(k_40)) . Note that
P does not divulge the keys k_i , which by our first assumption about F
cannot be computed from o .

To generate a signature for a document m , P first computes G(m) to
obtain a set [i_1, ... , i_20] of integers. The signature consists of the 20
keys k_i_1, ... , k_i_20 . More precisely, we have o_p(m) =  (k_i_1, ... , k_i_20) ,
where the i_j are defined by the following two requirements:
        (i) G(m) =  {i_1, ... , i_20}
        (ii) i_1 < ... < i_20
After generating the signature, P can destroy all record of the 20 keys k_s
with s not in G(m) .

To verify that 20-tuple (h_1, ... , h_20) is valid signature o_p(m)
for the document m, one first computes G(m) to find the i_j and then uses
o to check that for all j , h_j is the i_j^th key. More precisely, the
signature is valid if and only if for each j with 1 _< j _< 20 :
F(h_j) o_i_j , where o_i denotes the i^th component of o , and the i_j are 
defined by the above two requirements.

To demonstrate that this method correctly implements digital signatures,
we prove that it has the following properties.
        1. If P does not reveal any of the keys k_i , then no-one else can
        generate valid signature o_p(m) for any document m .
        2. If P does not reveal any of the keys k_j except the ones that
        are contained in the signature o_p(m) , tnen no-one else can
        generate valid signature o_p(m') for any document m' /= m .

The first property is obvious, since the signature o_p(m) must contain
20 keys k_i such that F(k_i) = o_i , and our first assumption about F states
that it is computationally infeasible to find the keys k_i just knowing the
values F(k_i) .

To prove the second property, note that since no-one else can obtain any
of the keys k_i , we must have o_p(m') = o_p(m) . Moreover, since the o_i are
all distinct, for the validation test to be passed by o_p(m') we must also
have G(m') = G(m) . However, our assumption about G states that it is
computationally infeasible to find such document m' . This proves the
correctness of our method.

For P to send many different documents, he must use a different o for
each one. This means that there must be sequence of 40-tuples o_1, o_2, ...
and the document must indicate which o_i is used to generate that document's
signature. The details are simple, and will be omitted.

3. Constructing the Function G

One way functions have been proposed whose domain is the set of documents
and whose range is a set of integers of the form {0, ... , 2^n - 1} for any
reasonably large value of n . (It is necessary for n to be large enough to
make exhaustive searching over the range of T computationally infeasible.)
Such functions are described in [1] and [2]. The obvious way to construct the
required function G is to let T be such a one way function, and define
G(m) to equal R(T(m)) , where R : {0, ... , 2^n - 1} -> S .

It is easy to construct function R having the required range and
domain. For example, one can compute R(s) inductively as follows:
        1. Divide s by 40 to obtain quotient q and a remainder r
        2. Use r to choose an element x from {1, ... , 40} (This is
        easy to do, since 0 _< r _< 40 .)
        3. Use q to choose 19 elements from the set {1, ... , 40} - {x} as
        follows:
                a. Divide q by 39 to obtain quotient ...
It requires careful analysis of the properties of the one way function T
to be sure that the resulting function G has the required property. We
suspect that for most one way functions T , this method would work. However,
we cannot prove this.

The reason constructing G in this manner might not work is that the
function R from {0, ... , 2^n} into S is a many to one mapping, and the
resulting "collapsing" of the domain might defeat the one way nature of T .
However, it is easy to show that if the function R is one to one, then
property (ii) of T implies that G has the required property. To construct
G we need only find an easily computable one to one function R from
{0, ... , 2^n - 1} into S , for a reasonably large value of n .

We can simplify our task by observing that the function G need not be
defined on the entire set of documents. It suffices that for any document
m , it is easy to modify m in a harmless way to get new document that is
in the domain of G. For example, one might include meaningless number as
part of the document, and choose different values of that number until he
obtains a document that is in the domain of G . This is an acceptable
procedure if (i) it is easy to determine whether a document is in the domain,
and (ii) the expected number of choices one must make before finding a
document in the domain is small.

With this in mind, we let n = 40 and define R(s) as follows: if the
binary representation of s contains exactly 20 ones, then R(s) = {i : the
i^th bit of s equals one} , otherwise R(s) is undefined. Approximately
13% of all 40 bit numbers contain exactly 20 ones. Hence, if the one way
function T is sufficiently randomizing, there is a 0.13 probability that any
given document will be in the domain of G . This means that randomly
choosing documents (or modifications to a document), the expected number of
choices before finding one in the domain of G is approximately 8. Moreover,
after 17p choices, the probability of not having found document in the
domain of G is about 1/10^p. (If we use 60 keys instead of 40, the expected
number of choices to find document in the domain becomes about 10, and 22p
choices are needed to reduce the probability of not finding one to 1/10^p.)

If the one way function T is easy to compute, then these numbers
indicate that the expected amount of effort to compute G is reasonable.
However, it does seem undesirable to have to try so many documents before
finding one in the domain of G . We hope that someone can find more
elegant method for constructing the function G , perhaps by finding a one to
one function R which is defined on a larger subset of {0, ... , 2^n} .

Note; We have thus far insisted that G(m) be a subset of
{1, ... , 40} consisting of exactly 20 elements. It is clear that the
generation and verification procedure can be applied if G(m) is any proper
subset. An examination of our correctness proof shows that if we allow G(m)
to have any number of elements less than 40, then our method would still have
the same correctness properties if G satisfies the following property:
        - For any document m , it is computationally infeasible to find a
        different document m' such that G(m') is a subset of G(m) .
By taking the range of G to be the collection of 20 element subsets, we
insure that G(m') cannot be proper subset of G(m) . However, it may be
possible to construct a function G satisfying this requirement without
constraining the range of G in this way.

REFERENCES

[1] Diffie, W. and Hellman, M. "New Directions in Cryptography".
_IEEE Trans. on Information Theory IT-22_ (November 1976),
644-654.

[2] Rabin, M. "Digitalized Signatures", in _Foundations of
Secure Computing_, Academic Press (1978), 155-168.

FOOTNOTES

[1] The elements of K are not keys in the usual cryptographic sense, but are
arbitrary data items. We call them keys because they play the same role as
the keys in Rabin's algorithm.

- ---

Editor's note: 

Some characters in the original paper were changed to members of the 
Roman alphabet. 

/= takes the place of the "not equal" symbol.
_< takes the place of the "less than or equal" symbol.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJX8l0SAAoJELTi4Nystj0lHlcP/jfrI7hl6urPXXh3dShYxN62
vY/NfuL2WDK0bjHA65EoDN0u8MEZ7CuVtm+Rzh6GRYyUTLyZtowWFNy3mDD5aMl0
zePELZ4w6aOr7zRcwnBF5v+tHV7y3YL8yyforLYU6+1CYRwqu/1UZRyeaV9QfBA+
jYDEyxuR8zVTJ+JKlM8PtAGEi96KsuZiajP21jlvm0lN4/5bJ7ASBFYTqYiI6pwH
QOE1QaBKFHmTKZTcF/BkrE1J13ewgpqNu4as2aepexsSW7hadbQRVNl5r3lABohd
3bDyPYlUcZHf/XZSQX+u0oxLUkdjKhDGyNDQXIdBisNU04jqxwN1wZ+IvZYLRH25
u7IkSq+cCwaA8vpDHzviRV+Hp+9u4GAqsJo5TYuavQ8mMQDjN93ji1M0CHM54E96
nFUIvAHNbdsyaQlNuFek+/xFinhFiAERbO1c9SggyxAB1Ct6uyOycgTW5WYfFZrR
wiQ9Q9YYVX2CqciERj/AUiliSF/tM50+bEJdrHdA2CASlUKDrTmPtiidV9HNvNjE
efakV7MsKytCjNJM3Ay6Wtm5nd36YmBOKu4g3PtG8huUr/EXYEeIPGaVWUn3tKQF
X2SvUjnHBj6XU8oe7X3ZKGO/iNYYzCyE9FfrE/Dqu4FZbg9YdJL0fPMX9Ad3GM5A
7f97Wy9HTnjzyuL1IVwF
=VRzi
-----END PGP SIGNATURE-----

Movie Review - Deadpool 2

Deadpool 2 is a good comic book movie.

If you have not seen the first Deadpool (What are you doing, go watch it, it is really funny!), the premise is that Deadpool (played by Ryan Reynolds) is a contract killer with a sense of humor, he participated in some experimentation which activated his "mutant powers" (this is the X-men universe) so he can move with almost-as-fast-as-a-speeding-bullet speed and he heals at an extraordinary rate (like Wolverine).

There were quite a few funny moments, many of them references to other comic book franchises. There was some well-executed breaking of the fourth wall, which is nice to see as that is one of the things the character of Deadpool is known for. I like that the Deadpool movies have accepted the 'R' rating, it lets them go all out in their fights; sometimes other comic book movies seem to be pulling their punches a bit to avoid that "violence" tag. There was some blood, Deadpool is a contract killer who really enjoys killing people, but it was not overdone.

The plot was fairly simple, and some of the plot points seemed to be telegraphed from a ways away, but there was enough room for the main character to develop a bit while retaining his bawdy humor.

And there is a character named Peter, which is always a good thing :)

-


May 16, 2018

Oo De Lally - Guitar Chords

Oo De Lally
By Roger Miller

G              .            C                   G
Robin Hood and Little John, walkin’ through the forest

G               .                 D               G   . . .
Laughin’ back-n-forth at what the other’ne has to say

G           .               C                  G
Reminiscin’ this-n-that an’ havin’ such a good time

G           .           D            G   . . .
Oo-De-Lally Oo-De-Lally golly what a day


G
Never ever thinkin’ there was danger in the water they were

C                                  
Drinkin’ they just guzzled it down

A
Never dreamin’ that a schemin’ sheriff and his posse was a 

D7                .                \ \ \ \
Watching them and gatherin’ around


G              .            C                   G
Robin Hood and Little John, runnin’ through the forest

G              .            D             G   . . .
Jumpin’ fences dogin’ trees tryin’ to get away

G             .          C                G
Contemplatin’ nothin but escapin’ finally making it

G           .           D            G   . . .
Oo-De-Lally Oo-De-Lally golly what a day


G           C           D7           G   . . .
Oo-De-Lally Oo-De-Lally golly what a day
-

May 14, 2018

Gorsuch and Trump

Back in 2017, when President Trump took office and nominated Neil Gorsuch to fill the vacancy in the supreme court, I noted that Gorsuch had a much more restrained outlook on federal power than Trump. I even predicted (if only I had this blog going at the time so I could link it ... oh well, maybe next time!) that at some point during Trump's tenure he would be trying to do something controversial and the man he nominated would be the swing vote to say "No, you really don't have the power to do that."

Well, it has happened. Just a couple weeks ago I saw the news Neil Gorsuch joins liberals in 5-4 decision. I like that Gorsuch is already asserting his ability to make decisions based on his own principles rather than just following the party line. It looks like the nomination of Gorsuch to the Supreme Court may be one of the best things to come out of the Trump Presidency.

-

May 8, 2018

A Return to Blogging

Some years ago I started this blog. The vague memories let me know that it did not last long, and I do not think there was much lost in its passing. The posts are all gone, I suppose I deleted them, or they got lost somewhere? Anyway, the important thing is that this is an empty slate.

Recently I have been thinking that I should start a blog, and I have been considering the ways to go about doing that. I happened to stumble upon this blog that I had forgotten about, and it seems like a convenient place to start. In the future, if this goes well (or rather, if I can stick with it), I will consider setting up an actual blog somewhere like Pizarro.

Welcome to my new adventure!

-

Fried Chicken Tenders

This is one of my favorite ways to make chicken. It is a bit time consuming and messy to make, but the chicken comes out tender and delicious at the end.

Ingredients:
  • 1-2 pounds chicken tenders (you can substitute chicken breast cut into tender-sized strips if that is all you have)
  • 2 cups cooking oil (or however much you need to get about 1/2 inch oil in the bottom of your frying pan)
  • 1/2 cup flour
  • 1/2 cup bread crumbs
  • 1/2 tablespoon salt
  • 1/2 tablespoon pepper
  • 1 tablespoon paprika
  • 1 tablespoon dried parsley
  • 1 egg
Put the oil into the frying pan, heat to medium/medium-high. The oil should be hot enough to sizzle when you put the chicken in, but if it spatters any then you have it too high.

Crack the egg into a bowl, beat, set aside.

In another bowl, mix the flour, bread crumbs, salt, pepper, paprika, and parsley. Pour the mix onto a plate.

Rinse the chicken in cold water, pat dry with paper towel. Dip the chicken in the egg, then roll it in the flour mix. Place the chicken in the pan, a couple pieces at a time (do not crowd the chicken or it won't cook evenly) for a couple minutes per side, until golden brown. Remove to a plate.

Enjoy!

-

May 4, 2018

Genji's Steakhouse

Today for lunch I went with a couple co-workers to the Genji's Steakhouse. Genji's is one of these Japanese styled places where they cook the food on a grill in front of you. This is the first time I have been to this location. I ordered the lunch chicken teriyaki. It came with a nice set of courses, starting with soup and then salad, followed by some grilled vegetables with a ginger sauce to dip them in, a bowl of rice, and then the meat entree.

While the food was filling, and the vegetables were nicely done, I was a bit underwhelmed. I was expecting more flair from the cook from the hype I had been given about eating here, but he basically came in, silently cooked the food, and left. The rice was a bit dry for my taste. And the chicken sauce seemed much saltier than I cared for.

Overall, I did not think the experience was worth the price; the lunch serving was about $14, I would say it would be worth more like $8. Dinner servings are in the $20-30 range. As my other co-worker Duong put it: "If I want to eat stir fried meat on fried rice, there are lots of other places to get it for much cheaper."

-

May 2, 2018

Korihor

The teachings of Korihor (Book of Mormon, The Book of Alma, Chapter 30):
O ye that are bound down under a foolish and a vain hope, why do ye yoke yourselves with such foolish things? Why do ye look for a Christ? No man can know of anything which is to come.

Behold, these things which ye call prophecies, which ye say are handed down by holy prophets, behold, they are foolish traditions of your fathers.

How do ye know of their surety? Behold, ye cannot know of things which ye do not see; therefore ye cannot know that there shall be a Christ.

Ye look forward and say that ye see a remission of your sins. But behold, it is the effect of a frenzied mind; and this derangement of your minds comes because of the traditions of your fathers, which lead you away into a belief of things which are not so.

There can be no atonement made for the sins of men, but every man fares in this life according to the management of the creature; therefore every man prospers according to his genius, and every man conquers according to his strength; and whatsoever a man does is no crime.

When a man is dead, that is the end thereof.

Why do I go about perverting the ways of the Lord? Why do I teach this people that there shall be no Christ, to interrupt their rejoicings? Why do I speak against all the prophecies of the holy prophets? Because I do not teach the foolish traditions of your fathers, and because I do not teach this people to bind themselves down under the foolish ordinances and performances which are laid down by ancient priests, to usurp power and authority over them, to keep them in ignorance, that they may not lift up their heads, but be brought down according to thy words.

Ye say that this people is a free people. Behold, I say they are in bondage. Ye say that those ancient prophecies are true. Behold, I say that ye do not know that they are true.

Ye say that this people is a guilty and a fallen people, because of the transgression of a parent. Behold, I say that a child is not guilty because of its parents.

And ye also say that Christ shall come. But behold, I say that ye do not know that there shall be a Christ.

And ye say also that he shall be slain for the sins of the world — And thus ye lead away this people after the foolish traditions of your fathers, and according to your own desires; and ye keep them down, even as it were in bondage, that ye may glut yourselves with the labors of their hands, that they durst not look up with boldness, and that they durst not enjoy their rights and privileges.

Yea, they durst not make use of that which is their own lest they should offend their priests, who do yoke them according to their desires, and have brought them to believe, by their traditions and their dreams and their whims and their visions and their pretended mysteries, that they should, if they did not do according to their words, offend some unknown being, who they say is God — a being who never has been seen or known, who never was nor ever will be.

This seems to make logical sense. But, sadly, in the Book of Mormon this man is cast as a villain and his teachings are rejected.

-

May 1, 2018

The Problem with the World Today

I give you a picture:

Here is a baby who just wants some attention, and there is her dad, the center of her mortal attention, who is completely ignoring her and dinking on his phone instead.

And that is what is wrong with the world today: the older generation is focused on themselves instead of interacting with the upcoming generation. There are too many people who would rather stare unblinking into the glowing device in their hand than interact with other people. And society as a whole is suffering.

Now, the question is: what can I do differently? Are there times that I could put down the phone, turn off that video game, put down the TV remote, and have human interaction with my children to help them grow into productive members of society?

-

April 27, 2018

Baby Movement

Babies are cute. Here are some videos for you to enjoy, this is my daughter Henny when she was about 9-12 months old and just figuring how to move around.

First she learned to spin in circles:


Then she used that to move around a little:

She did what we call "the butt-skootch" for a couple months before she started walking:

Isn't she adorable?

-

April 24, 2018

Talking

There is a saying often uttered by characters in George R.R. Martin's A Song of Ice and Fire series (Game of Thrones on TV) which I find very apt for the world today: "Words are Wind."

Recently, I overheard a conversation where two people were discussing the "rape problem" our society has. You know the one, where every girl out there has been raped by guys repeatedly since she was old enough to talk? Well, their solution to this societal problem is to "talk about it more". This struck me as absurd, talking about things will not fix anything; but in the minds of these socialists that is the solution to everything.

I wonder why they think this way? Is it because our news organizations focus our attention on what is being said instead of what is being done? Let's take a quick look at todays headlines:
  • Trump talks with Macron and Merkel - Talk!
  • Stephen Colbert Explains Trump Tweets - Talk!
  • Michael Cohen Has Said He Would Take a Bullet for Trump. Maybe Not Anymore. - Talk!
  • Stormy Daniels' Lawyer Michael Avenatti Challenges Sean Hannity to On-Air Face-Off - Talk!
  • Yeti calls NRA claims 'inaccurate' says it has 'unwavering' belief in Second Amendment - Talk!
I just want to put it out there, somebody saying something is not news. I do not want to read quotes from twitter in a newspaper. News should cover actions, things that happen, things people do. If somebody uses twitter to announce a change of government policy, that is news but still a horrible choice of venue for the announcement.

And of course, the honorable mention of the worst set of offenders is given to Reddit, where people sit around talking about what other people said about what some other people said. And then my co-worker comes by and tries to start a conversation about what he read those guys on Reddit saying, and I really have to hold down the urge to break into the action of smashing his computer over his head.

-

April 20, 2018

Book Review: The Hunger Games

I recently read The Hunger Games, by Suzanne Collins. The story is set in a distopian future, where one city conquered the world and reminds all their subjects of their place once a year by forcing each city to send a couple children as tribute to play in a deathmatch contest.

The underlying idea has potential to be turned into a good book, unfortunately this is not it. This is a world with the political depth of a twelve-year old girl. The remaining population of the world seems to be less than you would find in Delaware. And to make the whole thing even less believable, the whole world consists of the current United States. Yet these down-trodden people never even consider the idea that they could just leave the stupid place they are in.

The whole story shoehorns the characters into a vicious gladiatorial contest where a bunch of children are thrown into a wilderness and have to kill each other to win. But the problem is that we know that is where we are going and the journey there is too railroaded, and once we get there, the kids don't seem to want to do it, and so we get a boring series of scenes with the main character hiding in the wilderness. And then they go and change the rules to ex machina allow the budding romance to proceed, letting there be two winners instead of just one. At that point the reader knows what is going to happen: main character is going to survive and take her boyfriend with her. The whole book seems to be trying to give you a sense of danger, but it never quite gets there.

I guess you might like this book if you are a ten-year-old boy, but there are so many book out there that are so much better, so don't waste your time.

-

April 17, 2018

Allowable Boy and Girl Names

From the Logs:
Mircea Popescu: Names like "Trace Mayer" SHOULD be obsolete. Get a fucking human name why don't you. What is this Mug Costanza and Rifling Jones bs. Unless of course there's some King Trace in the glorious history of that great nation of Africa that I'm unfamiliar with.
Asciilifeform: Hey, if we had a Joe Stack, why not king trace. (is there a, e.g., Henry Heap?)
MP: Joe is fine. what the fuck reason did Mrs Mayer have to eschew calling her boy Rachel or whatever the fuck they do in her tribe.

PeterL: What kind of funny name is "Mircea"?
MP: PeterL ah, but in the god forsaken country of Romania, there's a bunch of kings called that.

PeterL: So you can only name people after kings?
MP: PeterL yes. You may only name kids after famous dead people. Either kings or saints. Pick.

PeterL: How about family members?
MP: PeterL well family members were named through the same process, so...

So, to build on the wisdom of Mircea Popescu, I figure it would be nice to have a baby name book made not with definitions of the names but with historical instances of the names. Here I list all the boy names which are presidents of the US, Kings of England or Scotland (which is where my family came from before moving to the US), governors of Michigan (where I currently live), and my own family names. The girls are mostly wives of those listed above, the list would only be about three names else-wise.

Here is a complete list of the boy names of my tribe:

Aaron Abraham Albert Alexander Alfred Andrew Arthur Austin
Barak Benjamin Brigham
Calvin Charles Chester
David Donald Duncan Dwight
Edgar Edmund Edward Edwin Elliott Elwood Ezra
Franklin
George Gerald Gordon Grover
Harold Harry Heber Henry Herbert
James John Joseph Josiah
Kenneth Kinsley
Lorenzo Lyndon
Macbeth Malcomb Martin Maurice Millard Moses
Peter
Reed Richard Robert Ronald Russel Rutherford
Spencer Stephen
Theodore Thomas
Ulysses
Ward Warren Wilber Wilford William Woodrow
Zachary

And here is a complete list of the girl names of my tribe:

Abigail Adelaide Alexandra Anna Anne Augusta
Barbara Bess Beth Betty
Camilla Caroline Catherine Charlotte Clara Clarissa Cora
Dantzel Diane Dolley
Edith Eleanor Eliza Elizabeth Ellen Elva Emily Emma
Frances Flora Florence
Grace Gretchen
Hannah Helen Henrietta Hillary
Ida Ila
Jane Janeen Jacqueline Jennifer Julia
Lady Laura Lou Louisa Louise Lucia Lucretia Lucy
Mamie Margaret Maria Marjorie Martha Mary Melania Michelle Miriam
Nancy
Patricia
Rachel Rosalynn
Sarah Sophia
Theresa
Victoria
Wendy

You may note that this list is segregated by boys/girls. I do not agree with the current trend of having gender neutral names.

If you think of an obvious name I missed, please comment and I will add it to the list!

-

April 16, 2018

Caffeine

This post is just me trying some stuff out to test how the blogging platform works. Rather than just saying "testing, testing", I thought I would include a nice picture I drew of a molecule I like to consume.

Caffeine

Shown above is the molecular structure of the caffeine molecule, also known as 1,3,7-trimethylxanthene. It is a stimulant found naturally in plants such as coffee and tea.

-

Contact Information

As this is a blogger.com hosted blog, you can probably guess, but I will say it explicitly: You can send email correspondence to my gmail account, PeterMLambert@gmail.com. Please send important or confidential information encrypted to my GPG public key.

It is important to use encryption. Some people say, "If you are not doing something wrong, you have nothing to hide", which it total baloney. Instead, I believe that all communication should be kept private by default, and if the government wants to see what I am saying then they will have to come ask me with a properly constructed warrant.

-

April 15, 2018

Programming

I just thought I would link to my GitHub account. There are just a couple projects there, I think the most interesting one is the implementation of the Keccak hash function in Ada.

A little background about me and programming:

When I was in college, I took a semester class in the C programming language. That was a long time ago, and I don't use C much, but I can mostly understand what programs written in C are doing.

Later on, a friend suggested that I check out the Python programming language. I dove into Python, and I found it much more accessible than C. It helped me understand more concepts and abstractions used in programming.

More recently, I was introduced to the Ada programming language. This is an elegant language, with a published specification, and the things like type safety force you to be more methodical than Python. Programming remains a hobby for me, and I don't have much time to do it, but so far Ada is the most satisfying programming language I have used.

-