Helping people with computers... one answer at a time.

Most encryption algorithms are public knowledge. I'll look at what it is about them that keeps people from breaking the encryption.

Encryption requires algorithms, right? When is it decided what algorithm would be followed when I make payments online? Is it when I login or is it predetermined? Is it the same algorithm always or changes every time I login? If some one knows the algorithm being used; Can they break/over-ride the encryption?

The encryption algorithm you might use when connecting to your bank is typically the same each time.

And everyone in the world knows (or could know) what the algorithm is.

Obviously, it's not the algorithm alone that defines how secure your connection is; there's something else just as, if not more, important.

Of necessity, this will be over-simplified. The nitty-gritty details of encryption are the things of research papers and nightmares - not necessarily in that order.

"Data encrypted using a good encryption algorithm will be nearly impossible to recover without its password even if you know the algorithm used as long as a sufficiently complex password was used."

So please forgive me if I wave my hands a few times and gloss over some of the details.

Algorithms

First, we need to clarify just what an algorithm is. In essence, it's a set of instructions for processing information - a recipe if you like.

For example, "add 2 to a number" is an algorithm; not a terribly sophisticated algorithm, but it is one nonetheless. Give it a 7 and the algorithm produces 9. Give it a -1,009,124 and it'll produce -1,009,122.

An encryption algorithm is similar except:

  • It's way more complex than just adding two to a number

  • It takes two inputs: the data to be encrypted and an encryption key

For the moment, think of that encryption key as a kind of password. You provide the password when you encrypt, and you must provide the password again in order to decrypt. This is referred to as "symmetric" encryption since you need to use the same password at both ends.

The algorithm must be such that as long as a good password has been used then given the encrypted data without the password you can't easily recover the unencrypted data. This is a function of how good the algorithm is, not whether or not the algorithm is publicly known.

Data encrypted using a good encryption algorithm will be nearly impossible to recover without its password even if you know the algorithm used as long as a sufficiently complex password was used.

Most encryption algorithms are very publicly defined and documented. In many cases, the actual software that implements the algorithms is also open source and/or available for public inspection. The intended result is that more eyes on the problem make for a better solution.

So once you have a good algorithm - publicly known or not - the true security of any encryption is its key, or password.

But when you connect to your bank's https web site there's no password for that https connection. How's that possible?

Public Key Cryptography

To answer that we need to look at a different type of key or password.

As I mentioned above, a symmetric keys is one where you use the same key or password to decrypt the data as you did to encrypt it. This is commonly what you might use to encrypt a .ZIP file, access a TrueCrypt volume or similar tools.

Asymmetric keys are, as you can probably guess, different.

To begin with, you use software to create two keys, according to the encryption algorithm you choose. The algorithm itself and the process by which the keys are made is quite public.

The two keys have a special relationship: data that is encrypted with one key can only be decrypted with the other.

That's really worth understanding. Let's say I have a key pair, A and B. If I encrypt something using key A I can only decrypt it with its matching key B - I can't even decrypt it with the key A that I used to encrypt it - only B.

And yes, that's darned-near magical as I look at it, but it's the heart of the algorithms used in public key cryptography. These are incredibly complex algorithms we're talking about.

I did say "public key", because one of the two keys is made public - anyone can see it. The other must be kept secret. It's this secrecy - much like keeping your password a secret - that keeps the encrypted data safe from prying eyes.

Vault
by Anonymous on Flickr.

So let's look at your bank.

When you want to connect to your bank via https:

  • your browser gets the bank's public key. (There's a standard protocol in place to fetch it, and to confirm that it does, indeed, belong to your bank.)

  • your browser encrypts your data using that public key. Remember this encrypted data can now only be decrypted using the bank's private key.

  • the encrypted data is sent to your bank over the internet. Anyone watching the data on your connection can see the encrypted data, but they can't decrypt it because they don't have the bank's private key.

  • the bank decrypts the data, because it holds the secret key.

The data has been transmitted securely. Everyone who cares to can know the algorithm, and perhaps even see the encrypted data, but because they don't know the secret key they simply cannot access the encrypted data.

Article C4558 - November 12, 2010 « »

Share this article with your friends:

Share this article on Facebook Tweet this article Email a link to this article
Leo Leo A. Notenboom has been playing with computers since he was required to take a programming class in 1976. An 18 year career as a programmer at Microsoft soon followed. After "retiring" in 2001, Leo started Ask Leo! in 2003 as a place for answers to common computer and technical questions. More about Leo.

Not what you needed?

5 Comments
Ronny
November 13, 2010 5:44 AM

What about the data coming from the bank to your browser, say your balance or account number. How can they send that in such a way no one else can decrypt it since they have to send you the key.

Recall that I said I was hand waving a lot. Part of setting up the https connection is a complex hand-shake - totally secure - that sets things up such that data transfered in either direction is securely encrypted.
Leo
12-Nov-2010

sirpaul2
November 16, 2010 9:41 AM

Make sure the "https" doesn't change to "http" after you log in.
And then there's 'Firesheep'.

Sandy Smith
November 16, 2010 11:49 AM

Since we are talking about https - Hotmail now has https throughout your session - not just the log in. I found that out yesterday... just passing along good news. You have to select it by logging into your hotmail account going to "Account" and then "Connect https." The first time I logged in it said "This websites certificate has not been verified" I proceeding anyway. Obviously Microsoft has to address that. Pretty funny the browser (IE8 - Microsoft) is telling Hotmail (Microsoft) their cert is not valid. So now Google and Hotmail are https - good news for users!

Digital Artist
November 16, 2010 4:40 PM

I entered cryptography in 1958 in the US Air Force. I was going to comment extensively here about how it was done in those days, but decided to write an article for Wikipedia instead. Check for KO-6 in Wikipedia in the next few weeks.

Terry Hollett
November 17, 2010 5:32 AM

to sirpaul2: Blacksheep warns you if you are being snooped by Firesheep. Firesheep only works on unsecured wireless networks. So make sure to use only WPA secured wireless connections.

Comments on this entry are closed.

If you have a question, start by using the search box up at the top of the page - there's a very good chance that your question has already been answered on Ask Leo!.

If you don't find your answer, head out to http://askleo.com/ask to ask your question.