Thursday, May 21, 2009

How to securly encrypt your emails.

I had trouble finding a good online tutorial walking one through all of the steps necessary to set up gpg, set up private/public keys, and use that to communicate securely with a friend. Anyhow the following is a quick tutorial of how to do this on Mac and Linux. If you are on windows try: http://www.gpg4win.org/ and see if you can use my tutorial along with whatever how-to guides they have to get it working.

If both you and your friend are new to Gnu Privacy Guard, then both of you should do the following.

1. install gnu privacy guard:
mac: http://macgpg.sourceforge.net/ and download current version
linux: it may already be installed in your system, on the command line type: gpg and see if anything happens. If not google "install gnu privacy guard [the name of your linux distro]" and there will surely be a tutorial.

On the command line:
2. type gpg --gen-key

3. I would select the first option DSA/emgammal or whatever

4. Choose the highest available encryption

5. Follow the rest of the instructions to finish generating a key. Your passphrase should be a longer sentence like "oh no i do not know how to type anymore after that accident"(please not that sentence though) and somehow remember that sentence.

6. type gpg --list-keys

7. You will have something that looks like:
pub 1024D/F217E383 2009-05-04
uid John St John (my launchpad key)
sub ******************************
****** (I blanked out my secret key info)

In the above example, the underlined text portion (F217E383) is my public key's ID. To upload that key to a keyserver so anyone can send you an encrypted file type:

gpg --send-key Your Key ID

8. To get my key so you can send me an encrypted file type in:

gpg --search-keys 'your_friend's_email_address@whatever.com'

and double check with your friend on phone or in person that the key you see is in fact theirs. You can also do the search by name, or probably key ID.

9. Now make a text file say "secret.txt" for example and type whatever message you want in it.

10. When you are in that folder on the command line type:

gpg --encrypt --sign --recipient 'your_friend's_email@whatever.com' secret.txt (or whatever your file is called)

follow the instructions...

11. you should have a file now called secret.txt.gpg that is an encrypted file that is impossible to decrypt by anyone who doesn't have access to your friend's private key.

12. add that file as an attachment to an email to your friend.

13. Have you friend download the attachment, then on the command line change to the directory that the file was downloaded to, and type:
gpg --decrypt file_name


Tuesday, March 24, 2009

Dividing Fractions in the Real World

Let me preface this by stating that I learned the trick for dividing fractions, simply multiplying one of the terms by the other's inverse, a long time ago. However I always find things more understandable when I have a good concrete example of how something works. My girlfriend is very strong in math, and wants to be an elementary or middle school math teacher, and she gave me the following example to think about. Say for example you have 4 quarts of ice cream, and you want to split it up into cups that each hold 2/3 of a quart. First you take 2/3 of each quart of ice cream, leaving 1/3 quarts in each ice cream container. Since you started with the 4, you have now filled up 4 cups. You have four 1/3 quart portions left and you want to fill up 2/3 quart cups with that portion, so two of those 1/3 quart portions will fill each cup, meaning two more cups are needed. 

I thought it was a very good way to think about division. Perhaps I was taught an example like that in school, but all I remember was the simple inversion trick. I didn't get a really good understanding for what I was doing. 

Another thing that helps with fractions is to change what I subvocalize when I see one. I was taught to think "two thirds" when I see 2/3 for example. If on the other hand I think "out of three parts, take two", when I see 2/3, I get a much better understanding for what the fraction actually means.

Monday, March 16, 2009

fonolo 4 Android: A look back at Software Engineering


This term taking Software Engineering with professor Anthony Hornof (credit him for the image to the right) was a great experience. My team developed an application for the Android phone which we subsequently distributed on the Android marketplace, and is downloadable in the US on any Android based cell phone. Learning how to develop this type of application, with the end user in mind, and also working on managing the team was definitely a valuable experience in the long run. If any future developers are interested in checking out the source code for this application, it is available at http://code.google.com/p/fonolo4android/ Perhaps I will crank out another Android based application in my free time in the near future.

Saturday, January 24, 2009

My Android App

Now that I have the critical aspect of my group's Android app up and running, I wanted to say a little about how cool it could be. It is an application that integrates with an external service called fonolo, and will provide a clean Android specific user interface for working with fonolo.

What fonolo does is really cool. They eliminate the need to navigate those annoying phone menus when you call a typical large corporation. Instead they maintain a text representation of the options, and you can quickly skim through to select the exact location you want to get to. When you submit the request to fonolo they place the call on their end, automatically navigate the phone menus, and then call your phone with the company and department you want on the other end. The android app makes it even cooler because rather than having to navigate to the website and log into that, you can do it directly from the application in your Android based phone!

One big thing I am learning from this project is how cool of an operating system Android is. It is incredibly easy to write programs for the system, and you can write code on any operating system that supports Java(unlike the iPhone which requires OSX and XCode as far as I know). Additionally to deploy your application on the Android marketplace, you only have to pay a one time fee of $25 as a developer. For the same privalege you have to pay $99 for the iPhone marketplace. Once more Android based handsets come out I am sure Android will be very competitive in the internet phone marketplace.

Monday, December 22, 2008

Winter Break

I just finished a very stressful term that involved applying to grad school, and three tough computer science classes. Now that it is over, I am already getting ready for next term and a whole new set of challenges. This coming term I will be writing up and presenting my undergraduate thesis based on work that I have done on and off since September 2007 under Joe Thornton and Bryan Kolaczkowski. Additionally I will be working on Software Methodology, a demanding Computer Science course that centers around a group programming project. I already have some ideas of what I would like to work on for that course. I am getting interested in Android, Google's new open source mobile phone OS. Developing apps for it seems pretty straight forward. Also once the apps are done, marketing them is as easy as uploading them to the Android marketplace. Although Android doesn't currently reach as broad an audience as the iPhone, I believe that it will eventually overtake the iPhone in the global marketplace. Additionally while the iPhone requires programming in objective C, which I have no experience with, Android is built on Java which I am fairly comfortable with. All in all Android seems a much better investment of my time and energy.

Hope everyone is having a happy holiday season.
-John

Tuesday, September 30, 2008

Eukaryotic cell organelles

In preparation for the biology GRE subject test I need to re-learn (or learn) general biology. My upper division work has been focused on evolution and computational techniques, so I am very rusty on most other biological topics.

Today I went over organelle structure and function in eukaryotes (organisms that have membrane enclosed structures within their cells such as animals, plants, protists, and fungi). As well as containing the chromosomes, the nucleus contains the nucleolus which is the production site for ribosomal subunits. These subunits are then shipped out of the nucleolus, then the nucleus and into the cytoplasm. The ribosomal subunits are destined to either float freely in the cytoplasm where they eventually link up over messenger RNA (mRNA) to make proteins destined for the cytoplasm, or they attach to the walls of the endoplasmic reticulum (ER) where they produce proteins that are destined for a membrane or export out of the cell. It is also interesting to note that the mitochondria and chloroplast produce their own set of robosomes that more closely resembles procharyotic(bacteria, archea, etc) ribosomes.

The destination of proteins is determined by their amino acid sequence, structure, and sometimes post-translational modifications. Proteins that are to be secreted out of the cell have a hydrophobic signal sequence called the signal peptide.

Lysosomes are interesting. They have enzymes inside of them which digest proteins, carbohydrates and nucleic acids. These enzymes function well in an acidic environment where the pH is about 5 (a cell's pH is closer to 7 meaning it is neutral). This fact keeps the overall cell safe because the enzymes aren't able to digest the cell in its higher pH environment. However inside the lysosome, the pH is kept at 5 so that the enzymes are able to do their work. That is a very interesting adaptation.

Peroxisomes are similar and break down fats and harmful chemicals like alcohal. These organelles do so through the production and degredation of peroxide, which if allowed to come in contact with DNA would be very dangerous. Thus the reactions are kept within the peroxisome.

The mitochondria and chloroplast are cool. They have their own DNA, and produce many of their own proteins. They are basically like a small unicellular organism that lives within the cell and produces the energy needed for the cellular function. Biologists theorize that these organelles were once seperate organisms that entered into a symbiotic relationship where they exchanged energy production for protection and a stable environment.

Monday, September 29, 2008

Programming languages

We covered some of the basic programming language types today. The imperative type is the most commonly used one. It is characterized by assignments and statements following a sequential order. C and Java are examples of this. The functional type is less common and includes languages such as scheme, lisp, ML, and Haskell. In its purest form the functional language contains no assignments. The entire program is defined by function definitions, and the invocations of those functions. This idea of a language is called lambda calculus. Logic languages seem pretty interesting. The idea of a logic language is that you define logic relations between variables, and then when you implement the program, you can have it solve for any number of variables. The simple example of this we got in class was say you have a function called append. Rather than defining the function like one would in C where you take in two things and spit out the appended result, in a Logic language like Prolog you have the relational function append that has three things as arguments and the function returns true if the three things satisfy the defined requirement of the first two being subsets of the third. If you pass in a variable you want the function to solve for it will do that for you and spit out all of the solutions. For example ?append([1,2],[3,4],X) would spit out [1,2,3,4]. If you give it ?append(X, [3,4], [1,2,3,4]) it would spit out [1,2]. It seems like logic languages could, in theory, simplify programming.