One-Time Pad Encryption: Example & Definition

Instructor: David Gloag

David has over 40 years of industry experience in software development and information technology and a bachelor of computer science

With the increased use of the Internet, there is a corresponding need for security. In this lesson, we'll take a look at one type of security measure, one-time pad encryption, and how it works.

Saving Our Souls

You don't have to think very hard to realize that in this day and age, we have a significant need for security. We live on the Internet. We buy things from ecommerce websites like Amazon and Staples, we communicate through email websites like Google and Outlook, and we post details about our lives on social media websites like Facebook and LinkedIn. The fact is we could potentially bare our souls to the world. So what's stopping this information from being exploited? What is it that stops the unthinkable from happening? Well, there are many technologies in place that do just that. One of the most important is encryption, and a specific type is one-time pad.

What is Encryption?

Simply put, Encryption is about conversion. Information in one form (usually human-readable) is converted to another (not usually human-readable). The process is mathematically based, and makes use of some external information, known as a key, to perform the conversion. There are several different types of encryption, and they are used for many things. Common examples include protecting the password on your cell phone, securing the communications between yourself and ecommerce websites, and hiding sensitive email. In each case, it quietly does its thing, behind the scenes.

What is One-Time Pad Encryption?

One-time pad is a unique encryption process. Like most, it uses a key to encrypt and decrypt. However, in this process, a key is generated randomly to encrypt the messages for a specific session. To decrypt, the same key is used. Once the session is complete, a new key is generated. This gives the algorithm a random element that ensures that there is no relationship between the key, and consecutive encrypted messages. As a result, this process is considered mathematically unbreakable. So far, this has proven to be true, but with one major caveat, which we'll get to in a moment.

How Does One-Time Pad Encryption Work?

The process starts by generating a sequence of random numbers or characters, the length of which is determined by the size of the messages to be sent. This sequence is then written down on a pad (which is where the name comes from), or some recording device in today's world. It is then forwarded to anyone that may need to decrypt the messages. To prepare a message for transmission, each number or character in the message gets encrypted with the key, using a bit-wise exclusive-OR (XOR) operation. The encrypted message is then sent, and the receiving party decrypts using the same key and bit-wise XOR operation.

Bit-wise XOR works on the output one bit at a time, and behaves in the following fashion:

To unlock this lesson you must be a Member.
Create your account

Register to view this lesson

Are you a student or a teacher?

Unlock Your Education

See for yourself why 30 million people use

Become a member and start learning now.
Become a Member  Back
What teachers are saying about
Try it now
Create an account to start this course today
Used by over 30 million students worldwide
Create an account