One-Time Pad Encryption: Example & Definition

Instructor: David Gloag
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 risk-free for 30 days

Earning College Credit

Did you know… We have over 200 college courses that prepare you to earn credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the first two years of college and save thousands off your degree. Anyone can earn credit-by-exam regardless of age or education level.

To learn more, visit our Earning Credit Page

Transferring credit to the school of your choice

Not sure what college you want to attend yet? has thousands of articles about every imaginable degree, area of study and career path that can help you find the school that's right for you.

Create an account to start this course today
Try it risk-free for 30 days!
Create an account