Monday, June 20, 2016

pgp gpg signatures and the like

PGP and GPG are, respectively:
  • Pretty Good Privacy, an open standard software design and architecture for encryption using the public key / private key model. (link)
  • GnuPG aka Gnu Privacy Guard, a Free Software / Open Source implementation of the PGP standard. (link)
The key to it all is key exchange. You may exchange keys in a number of ways:
  • By sending it via e-mail to a 'correspondence partner'. 
  • By publishing the key on a website for everyone to access.
  • By uploading a key to a keyserver.

Q: Someone has sent me an email and it has an attachment 'signature.asc' so that is that all about?
A: A dot '.asc' file simply indicates that the file contains plain (ASCII) text. An ASC file
  • A so-called 'inline armour' signature file '*.asc' is a static file containing a public key. 
  • A PGP/MIME signature file is a bit like a checksum, it is the result of a unique calculation based on the message content and the sender's PGP key. In this case the '.asc' file contains the output of a function that uses the original document content, the sender's private key, the time etc. This works by virtue of the fact that any particular digital file has a numeric/binary representation, basically a very long number, and can therefore have math performed on it.
Q: You visit a website and where each contact person includes a seemingly random string of 40 hexadecimal characters labelled 'GPG key' otherwise known as the 'fingerprint'.
A: A fingerprint links to a downloadable version of a public key, a file such as 'somefilename.asc' containing more random  letters and numbers e.g. file contents looking somewhat like the following
----BEGIN PGP PUBLIC KEY BLOCK-----
fall34saLKU877lkdkmQENBE8e3CIBCACeeMFj0mrmp66lKg4u1yBCxZLKd6gbjOjAW6JoCmIBemOnH3yR6f4XQwpO3wcvuK1NAyV6XvjN7kg/eRwjzjKr3Ro9k+l7kk2EuTSAwEX2rudWEXdr5OCFob6ag4osic8+jajM/VAFYw3S1tPW+Jmf8FddcpXyy9yeKsDYDYbFKUPOvNwoH2qHPY4wTVi2QcsDuaHjRCqi
-----END PGP PUBLIC KEY BLOCK-----


Q: Can you suggest basic exercises to follow to learn how to use PGP signing and encryption?
A: Try attaining the following goals in order of increasing difficulty...
  1. Install PGP / GPG or use webmail extension/add-on like Mailvelope (works for Chrome or Firefox only), you should then be able to verify other people's signatures and collect their public keys.
  2. Generate your own key files, and store them locally initially.
  3. Sign an email (doesn't encrypt the content) and send it to me (like I did above) so I can verify the signature.
  4. I think signing is also a way of sharing your public key via email. After which I should be able to encrypt something intended for you.
  5. Practice encrypting/decrypting
  6. Publish your public key on a key server to make accessing your public key easier.


Notes:

Using Mailvelope for in browser webmail (Chrome and Firefox).


Wednesday, June 8, 2016

Springer manuscript preparation for editors

In this example I will configure the templates for a "contributed book", that is, a book comprised of individually authored chapters or sections, compiled by a small editorial team whose names will be attributed to the book itself. A "contributed book" is a kind of collection. Various copyright situations can arise: the simplest where the authors retain copyright of their personal contributions and the editors copyright pertains to the arrangement of the collection; through to a book in which the copyright for the whole and its parts are 'assigned' to the publisher.

First, your authors will prepare individual manuscripts conforming with the specified guidelines.
Second, incorporate the authors' contributions into the book structure.
Typeset/compile and forward to Springer.

The defined templates, for both Word and LaTeX work pretty much as documented!

In order to compile separate bibliographies chapter by chapter I used chapterbib which allows typesetting of separate chapter level references.
\usepackage{chapterbib}
Using the Springer template the following example assumes editor.tex is the organising structure:
\mainmatter %%%%%%%%%
\include{part}
\include{author_01}
\include{author_02}
Run typesetting from the commandline for each chapter as in the controlling editor.tex; you will need to introduce additional bibtex commands to the usual process e.g.:
latex editor
bibtex author_01
bibtex author_02
latex editor
latex editor
Just to note, ensure each author uses different label names for figures, tables, crossrefs etc. to avoid name clashes on typesetting the entire book. Similarly they should use unique bibliography filenames so that these files can coexist in a shared folder. Subfolders for figures etc will need to be accessible at the level of editor.tex.

Further reading
The Springer guidelines


On verifying a signature file...

A detached signature file, as opposed to signatures that are encrypt-signed or clear-signed (link), is a separate file that may be used to verify the associated document, that is, both the signature.sig and the original_document.txt (or other file) are processed for verification. This can be a bit confusing for an email because it may be unclear which text file is referred to; this isn't usually an obvious problem if your pgp/gpg is integrated with your email software.

You will need to have installed GnuPG. Once installed import the signature (command line example)
$ gpg --import GPGTools-00D026C4.asc gpg: key 00D026C4: "GPGTools Team <team@gpgtools.org>" 1 new signaturegpg: Total number processed: 1gpg:         new signatures: 1gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust modelgpg: depth: 0  valid:   1  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 1ugpg: next trustdb check due at 2018-08-19

If you run this more than once you'll see (command line example)
$ gpg --import GPGTools-00D026C4.asc gpg: key 00D026C4: "GPGTools Team <team@gpgtools.org>" not changedgpg: Total number processed: 1gpg:              unchanged: 1

Now verify the signature/file combination (command line example)
$ gpg --verify GPG_Suite-2015.09.dmg.sig GPG_Suite-2015.09.dmggpg: Signature made Wed 23 Sep 18:56:37 2015 IST using RSA key ID 0D9E43F5gpg: Good signature from "GPGTools Team <team@gpgtools.org>" [ultimate]gpg:                 aka "GPGMail Project Team (Official OpenPGP Key) <gpgmail-devel@lists.gpgmail.org>" [ultimate]gpg:                 aka "GPGTools Project Team (Official OpenPGP Key) <gpgtools-org@lists.gpgtools.org>" [ultimate]gpg:                 aka "[jpeg image of size 5871]" [ultimate]

Further reading

gnupg.org and the GPG Suite Quickstart Tutorial
kp.mit.edu
www.openoffice.org

Monday, June 6, 2016

Notes for King Lear

Nature imagery in King Lear

The concept of nature is wide ranging in this drama and this is manifested by the extensive use of nature imagery throughout the entire course of the play's action.
Indeed nature is at the very heart of the 'word world' of King Lear.

Heavenly nature:

The most cursory scrutiny of the play will reveal just how varied is the imagery associated with the concept of nature. In act 1 for instance we find Lear as king swear by the power of light and darkness:
"Lear: Let it be so. Thy truth then be thy dower. For by the sacred radiance of the sun, The mysteries of Hecate and the night, By all the operation of the orbs From whom we do exist and cease to be—" (1.1.109-13)
This is an appropriate approach to nature given the pagan setting of the play. Later in this act, Gloucester claims:
 "Gloucester: These late eclipses in the sun and moon portend no good to us. Though the wisdom of nature can reason it thus and thus, yet nature finds itself scourged by the sequent effects. Love cools, friendship falls off, brothers divide, in cities mutinies, in countries discord, in palaces treason, and the bond cracked ’twixt son and father. This villain of mine comes under the prediction—there’s son against father. The king falls from bias of nature—there’s father against child." (1.2.99-108)

In essence, the supernatural powers of nature may exert ill effects on the world of man. Here Gloucester refers to the belief current in Shakespeare's day and centuries before, that events in the 'macrocosm'; the celestial spheres, were reflected in the 'microcosm'; the little world of man. Edmund mocks at this approach to nature, dismissing it as mere superstition.
"we make guilty of our disasters the sun, the moon, and the stars: as if we were villains by necessity; fools by heavenly compulsion; knaves, thieves, and treachers, by spherical predominance; drunkards, liars, and adulterers, by an enforced obedience of planetary influence; and all that we are evil in, by a divine thrusting on: an admirable evasion of whoremaster man, to lay his goatish disposition to the charge of a star!"(1.2.127-35)
 Lear in referring to "our nature" is obviously commenting on his own kingly nature, together with his instinct for power
That thou hast sought to make us break our vows, Which we durst never yet, and with strained pride To come betwixt our sentence and our power, Which nor our nature nor our place can bear, Our potency made good, take thy reward: (1.1.171-75)
This is obviously not the nature referred to by Lear addressing Regan on the subject of his knights, appeals to her to understand what lies behind his need for his retinue of knights. "Allow not nature more than nature needs, man's life is cheap as beasts" (2.4.264-5).
Nor is the goddess 'nature' invoked by Edmund to be identified with either of the above interpretations; "Thou, nature, art my goddess. To thy law My services are bound." (1.2.1-2)

Perverted nature

Suggestions of the unnatural, the perversion of what is normal or natural is evident in Lear's appalling outbursts when he disowns Cordelia or when he curses Goneril:
Hear, Nature, hear, dear goddess, hear! Suspend thy purpose if thou didst intend To make this creature fruitful. Into her womb convey sterility. Dry up in her the organs of increase, And from her derogate body never spring A babe to honor her. If she must teem, Create her child of spleen, that it may live And be a thwart disnatured torment to her. (1.4.268-76) 
Later, addressing Regan:
You nimble lightnings, dart your blinding flames Into her scornful eyes! Infect her beauty, You fen-sucked fogs drawn by the powerful sun, To fall and blister! (2.4.159-63)
Lear calls upon nature's destructive power to strike at the very heart of created matter "Crack nature’s molds, all germens spill at once That make ingrateful man!" (3.2.9-10).

Primal nature 

Storm imagery is used by Lear and those associated with him throughout the storm episodes in act 3.
Gentlemen: Contending with the fretful elements. Bids the winds blow the earth into the sea Or swell the curlèd water 'bove the main, That things might change or cease. Strives in his little world of man to outscorn The to-and-fro–conflicting wind and rain. (3.1.4-12)
Then Lear:
Blow, winds, and crack your cheeks! Rage, blow! You cataracts and hurricanoes, spout Till you have drenched our steeples, drowned the cocks! You sulfurous and thought-executing fires, Vaunt-couriers of oak-cleaving thunderbolts, Singe my white head! And thou, all-shaking thunder, Smite flat the thick rotundity o' th' world, (3.2.1-8)
And Kent:
Such sheets of fire, such bursts of horrid thunder, Such groans of roaring wind and rain I never Remember to have heard. (3.2.45-7)

This imagery of primal nature serves many purposes. Lear's language together with his actions 'minds' the fury of the physical storm, which in itself is a symbol of the tempest in his mind: he is thus himself the 'spirit' of the storm and a reminder to us of the intimate interconnection between the cosmic and the terrestrial, which would have been taken for granted in Shakespeare's' day. The 'storm imagery' insists on man's vulnerability in the face of the fury of nature. In soliloquy with Fool, Lear railing in the storm says:
Rumble thy bellyful! Spit, fire! Spout, rain! Nor rain, wind, thunder, fire are my daughters. I tax not you, you elements, with unkindness. I never gave you kingdom, called you children. You owe me no subscription. Why then, let fall Your horrible pleasure. Here I stand, your slave— (3.2.14-9)
While later Kent seeks to calm and comfort Lear in the storm;
Here is the place, my lord. Good my lord, enter. The tyranny of the open night’s too rough For nature to endure. (3.4.1-3). 
The emphasis throughout is on the destructive power of elemental nature.

Healing nature

Elsewhere however nature imagery is used more positively to suggest the benevolent aspect of the natural world in its influence on man's life. The reference to Lear in his madness, wandering about, crowned with garlands of weeds and wildflowers.

Cordelia: Crowned with rank fumiter and furrow-weeds, With burdocks, hemlock, nettles, cuckoo-flowers, Darnel, and all the idle weeds that grow In our sustaining corn (4.4.4-6)
This quote is more significant than might at first appear since all the plants mentioned in this catalogue of Lear's garlands have curative properties and were commonly used in the treatment of mental illness.

Cordelia herself, urges the doctor to use all of his powers to cure her father, saying;
All blessed secrets, All you unpublished virtues of the earth, Spring with my tears. Be aidant and remediate In the good man’s distress. Seek, seek for him, Lest his ungoverned rage dissolve the life That wants the means to lead it. (4.4.16-20)

Imagery of spring and of harvest is associated with Cordelia herself, as a means linking her with all that is most positive in the natural cycle, through the symbolic associations of spring with the promise of a world new-made and of autumn's bounty with richness and fertility.

Animal nature

The forces of nature are also present in Shakespeare's use of 'animal imagery'. For example, man is constantly compared to the beasts.
Lear: O, reason not the need! Our basest beggars Are in the poorest thing superfluous. Allow not nature more than nature needs, Man’s life’s as cheap as beast’s. (2.4.261-4)
Lear in dialogue with Edgar, seeing that he (Edgar) is barely clothed, living wild 'unburdened by the trappings of civilization', Lear tears at this own clothes:
Lear: Why, thou wert better in thy grave than to answer with thy uncovered body this extremity of the skies.—Is man no more than this? Consider him well.—Thou owest the worm no silk, the beast no hide, the sheep no wool, the cat no perfume. Ha! Here’s three on ’s are sophisticated. Thou art the thing itself. Unaccommodated man is no more but such a poor, bare, forked animal as thou art.— Off, off, you lendings! Come. Unbutton here. (tears at his clothes) (3.4.93-101)

Without his "lendings" the trappings of civilisation, which cushion him against exposure to the "raw nature" of the heath and the storm, man is merely the poor, bare, forked animal (two-legged) that Edgar has become in his role as 'poor Tom'.

Animal imagery is also used to emphasise the horror to which Lear was subjected in the night of the storm;
"The lion and the belly-pinched wolf Keep their fur dry, unbonneted he runs, And bids what will take all."
Nature as a jungle world where human predators stalk one another in a war of all on all is epitomised in the beast 'imagery' used of Goneril and Regan; "detested kite" those "pelican daughters"; "dog-hearted daughters"; "boarish fangs"; "tigers, not daughters".
Ultimately they become 'monsters of the deep' preying on each other.
This type of 'natural imagery' is intended to suggest human nature at its most 'unnatural', that is at a level below that of the beasts.
Hence, comparisons between the behaviour of the 'derogate' human and wild beasts work to the disadvantage of the former; "whose reverence ever the head lugged bear would lack"; "If wolves had at thy gate howled that stern time, Thou shouldst have said, “Good porter, turn the key,”"

The animal references in the utterances of Poor Tom/Edgar on the one hand, reflect the moral emphasis on the beastal in mankind, already discussed "hog in sloth, fox in stealth, wolf in greediness, dog in madness, lion in prey" but on the other, they simply emphasise the reality of what it is like to live the life of "houseless poverty" at the level of hardest subsistence.
Poor Tom, that eats the swimming frog, the toad, the tadpole, the wall newt, and the water; that in the fury of his heart, when the foul fiend rages, eats cow dung for salads, swallows the old rat and the ditch-dog, drinks the green mantle of the standing pool; who is whipped from tithing to tithing and stocked, punished and imprisoned; who hath had three suits to his back, six shirts to his body, Horse to ride and weapon to wear. But mice and rats and such small deer Have been Tom’s food for seven long year. (3.4.120-30)
The emphasis on man's existence as precarious, exposed and wretched is to be found also in Edgar's speech to Gloucester at Dover in act 4, where he presents what seems a God's eye view of the world;
How fearful And dizzy ’tis to cast one’s eyes so low! The crows and choughs that wing the midway air Show scarce so gross as beetles. Halfway down Hangs one that gathers samphire—dreadful trade! Methinks he seems no bigger than his head. The fishermen that walk upon the beach Appear like mice. And yon tall anchoring bark, (4.6.12-19)
From this perspective "poor, bare, forked animal" (poor, naked, two-legged) that Lear had found in Poor Tom and by application, also in himself in the course of the storm episodes.

These passages illustrate the extraordinary variety and range of nature imagery and point to the ubiquity their use, the contrastingly vulgar and subtle uses to convey meaning. The dramatic value of Shakespeare's approach is in this knowledge of the world, shared with the audience, of using multi-various facets nature as conceptual dramatic devices in his plays. Nature extends from the sublime and the base; it accounts for and encompasses, yet transcends all points in between.

Thursday, June 2, 2016

SHA256 Wha?

What to do if you see instructions like...
 "You can find the SHA256 checksums for xxx online and you can verify the checksums signature file which has been signed using xxx's GPG key"
A SHA is a Secure Hash Algorithm (link), a one-way function of which it is difficult if not impossible to compute its inverse. I think its called an injective non-surjective function.
Anyway, online, we use SHA checksums to verify file integrity.

On Checksums...

For example: from the command line in the folder of the file you need to check thus:
$ shasum -a 256 -c vagrant_1.8.1.dmg
1bda0aed9691145a97cb5a8ae7b3492cc5e15a03  vagrant_1.8.1.dmg
Verify manually by inspection with a published copy of the checksums e.g.
vagrant_1.8.1_SHA256SUMS.txt
Or verify automatically if you have the published copy of the checksums file in the same directory as the file you need to check:
$ shasum -a 256 -c vagrant_1.8.1_SHA256SUMS.txt vagrant_1.8.1.dmg: OK 

Using the example of GPGTools and downloading the GPG Suite for Mac as of today (https://releases.gpgtools.org/GPG_Suite-2015.09.dmg). Without having GunPG installed you need to verify the downloaded file using the checksum and comparing against the published value for that file (as of today) i.e. comparing the published value to that calculated by shasum
SHA-1: f1fd930144720e70bd4c809dd36ac0573b0a7be2
$ shasum GPG_Suite-2015.09.dmg f1fd930144720e70bd4c809dd36ac0573b0a7be2  GPG_Suite-2015.09.dmg

Further reading

gnupg.org
kp.mit.edu
www.openoffice.org

(New Section) Diving into virtual machines with VirtualBox and Vagrant

1. VirtualBox
2. Vagrant

Sharing 360° video?

So, you've got a 360 degree video file from your GoPro. What to do with it? Well, share it on YouTube. YouTube supports uploading and pl...