As we enter week six of the Covid-19 lockdown here in the UK I am still ‘between contracts’. I’ve had a handful of video interviews but these haven’t led anywhere yet – but I’m not sitting around idle.
Notwithstanding the decorating, gardening and spring-cleaning (of office and summerhouse – I’m not trusted to attack the house itself) I have been hitting Pluralsight online tech training hard for the past few weeks.
Taking the time to get up to speed with the most recent changes in .NET Core, Blazor and Xamarin were an initial target for my attention but I’ve subsequently moved on to those courses that I had bookmarked thinking – “that would be interesting/useful to look into if I ever get time”. Well now I have the time.
Following on from my post about the UK Governments campaign to erode our privacy by demanding that tech companies put back doors in their encrypted products, I have created a simple utility to demonstrate how easy it is for a reasonably competent developer to create their own using standard development tools and libraries.
Now, I’m not expecting the UK Government to take a blind bit of notice but the fact is that encryption is out there, it’s only mathematics after all, and it’s not going away. You cannot feasibly make maths illegal – although the US did classify encryption as a weapon until 2000 (and to some degree still does).
The course was a minute under four hours and took me a couple of evenings to get through, Cryptography is not the most stimulating subject but Stephen did his best to key the information flowing. At times I did feel frustrated at how he seemed to labour some points but the upshot is that by doing this the information did seem to get through and stick. During the course he slowly increased the complexity, developing and enhancing C# code to demonstrate the principles.
It is this code which I have used as a base to create the ‘Personal Encryptor’ (hereafter referred to as PE) – a command line application that can be used to generate encryption keys, encrypt and, of course, decrypt data into files that can be safely sent over the Internet. Only someone with the required public and private keys will be able to decrypt the file and view the original data.
I’ll probably put another post together shortly diving a bit deeper into the functionality and explain the contents of the output file – but I highly recommend you watch the above course as Stephen know the subject inside out and does a great job of explaining it.
Why would I need/want to encrypt a file?
Imagine the following scenario;
Alice and Bob want to exchange private messages with each other; maybe they are planning a surprise birthday party or sharing ideas about a new business venture. Whatever the messages contain, they are Alice and Bobs business and nobody elses.
Alice and Bob both download the PE application and copy it to a location on their Windows PC (Mac version coming soon).
They then use the utility to generate a Public and Private key pair – which will create two XML files.
They each send each other their PUBLIC keys (this is just an XML file and can be freely sent over the Internet or via Email).
Both Alice and Bob copy their PRIVATE keys to a safe location (maybe a secure USB key – or a normal USB key which is stored in a safe)
Now Alice wants to encrypt a file, a PowerPoint presentation for their new product, and send it to Bob
Alice uses the PE application to encrypt the file using Bobs PUBLIC key.
The PE application Digitally Signs the encrypted data using Alices PRIVATE key.
A text file is created containing the encrypted data and everything needed to verify the contents has not been tampered with and to confirm that Alice encrypted it.
Alice then emails the file to Bob as she normally would if she was sending a photo of her cat!
Bob receives the message and downloads the encrypted file to his computer.
Bob uses PE to decrypt the file by specifying the location of his PRIVATE key and Alice’s PUBLIC key.
The PE utility will check the digital signature using Alice’s PUBLIC key to confirm that it was signed with her PRIVATE key.
It will then check the integrity of the package to ensure that it has not been tampered with in transit
If all is well then the PE application will decrypt the file and write the contents out to a location that Bob has specified.
Bob can now endure enjoy Alice’s PowerPoint presentation.
Of course if Alice (or Bob) just wanted to encrypt a file for their own personal use and not for sharing it is perfectly feasibly to provide their own Private AND Public keys to encrypt the data. These keys will be required to decrypt the data.
And that’s it, privacy restored/reclaimed.
I can now safely download my Lastpass vault in plain text, encrypt it and save it to any cloud drive I like, secure in the knowledge that, as long as my private key remains under my control, nobody can decrypt it to access it’s contents. Nothing illegal there – these are passwords to legitimate sites (Amazon, Pluralsight, Microsoft, Apple etc) and need to be protected. A valid use of The Personal Encryptor.
Yes, at the moment it requires the users to have some familiarity with the Command Line but this project was always intended to be a proof of concept. The original aim was to explore encryption to enable me to implement it in an existing mobile Chat application.
Creating a simple GUI would certainly be possible – a simple Winforms or WPF application to collect file paths and call out to the command line utility shouldn’t take too long for a competent developer to write. That said, I’m probably going to focus my attention elsewhere.
While using the Microsoft libraries is perfectly valid in my opinion, I am aware that many people will wince just a little bit. With this in mind I intend to investigate using the libSodium Crypto Library which Steve Gibson is such a fan of – so that’s good enough for me.
I receive regular email updates from the Simple Programmer website and the one I received on 27th December caused me to stop and think.
Probably based on one of John’s blogs posts from 2016, the subject of the email was ‘Dont make resolutions the New Year, make a commitment’. Now I initially thought that these amounted to the same thing but changed my mind after reading the parting shot of the email which read:
Let me put it this way, when you need to take a taxi to the airport, do you want your taxi driver to resolve to be there at 8:30 AM or do you want him to commit to being there at that time?
The answer is obvious (hopefully) so I’ve decided to make some commitments for 2018:
I will watch at least one Pluralsight course a month
My technology focus will be .NET Core, Azure, ReactJs
I will watch at least one Xamarin University session (attending those required to maintain my certification)
I will blog twice a month (not including the Online Tool of the Month posts)
To keep me honest I will probably post findings from my Pluralsight courses and Xamarin investigations (proving that I’ve actually honoured the above commitments)
Other topics will include Privacy and Encryption which seem to be bad words these days
So that’s what I will commit to this year – maybe I’ll be in a position to commit to more but I’ll review my progress mid-2018 and see how I’m doing.