Jump to content
Sign in to follow this  
Asterisk Propernoun

A Flaw in the One-Time Pad?

Recommended Posts

There are two statements people often make about the one-time pad that I believe are contradicting each other. The two statements are:

 

"The key should use truly random letters, which means that each letter in the alphabet has an equal chance of occuring."

 

"When Eve attempts cryptanalysis with unlimited computing power, she will recieve the plaintext instantly. However, she will notice that the message 'WINTER' is just as likely to occur as the message 'SUMMER'."

 

Alright, if the one-time pad's key is supposed to have truly random letters that all have an equal chance of occuring, then won't that mean the key will most likely have an equal combination of all of the letters in the alphabet? Let's say we have a ciphertext that is 2600 letters long, so would the most likely keys be the keys that have 100 of each letter in the alphabet?

 

If the above is answered with a yes, then wouldn't that also mean the odds of what the plaintext is will also be inequal? If that's answered with a yes, then wouldn't the second statement listed above be false?

Edited by Asterisk Propernoun

Share this post


Link to post
Share on other sites

"Alright, if the one-time pad's key is supposed to have truly random letters that all have an equal chance of occuring, then won't that mean the key will most likely have an equal combination of all of the letters in the alphabet?"

 

The key is just as likely to be "AAAAAAAAAA" as "SFHIURGMOLO"

Share this post


Link to post
Share on other sites

"Alright, if the one-time pad's key is supposed to have truly random letters that all have an equal chance of occuring, then won't that mean the key will most likely have an equal combination of all of the letters in the alphabet?"

 

The key is just as likely to be "AAAAAAAAAA" as "SFHIURGMOLO"

 

But doesn't expiremental probability tend towards theoretical probability as you run more and more expirements? Or does the key not generate one letter at a time with equal chances for each letter like I explained?

Share this post


Link to post
Share on other sites

I decided to collect some data so I can show you what I mean.

 

The one-time pad generator I used.

 

The python script I used will be in an attached file. The script will include the keys I used.

 

The script's output:

 

1.
a: 100
b: 122
c: 97
d: 83
e: 104
f: 104
g: 117
h: 100
i: 105
j: 87
k: 93
l: 112
m: 88
n: 76
o: 118
p: 113
q: 107
r: 105
s: 94
t: 96
u: 99
v: 90
w: 99
x: 86
y: 89
z: 116

2.
a: 85
b: 129
c: 102
d: 113
e: 84
f: 93
g: 116
h: 91
i: 120
j: 98
k: 99
l: 105
m: 101
n: 96
o: 99
p: 101
q: 100
r: 103
s: 84
t: 111
u: 94
v: 92
w: 82
x: 103
y: 105
z: 94

3.
a: 90
b: 119
c: 94
d: 89
e: 97
f: 102
g: 78
h: 123
i: 118
j: 104
k: 93
l: 92
m: 99
n: 98
o: 106
p: 95
q: 107
r: 108
s: 96
t: 104
u: 117
v: 102
w: 98
x: 111
y: 87
z: 73

4.
a: 104
b: 105
c: 93
d: 110
e: 89
f: 99
g: 92
h: 87
i: 93
j: 105
k: 98
l: 99
m: 97
n: 121
o: 104
p: 103
q: 103
r: 100
s: 98
t: 100
u: 110
v: 94
w: 84
x: 115
y: 98
z: 99

5.
a: 112
b: 90
c: 101
d: 98
e: 103
f: 113
g: 83
h: 96
i: 102
j: 99
k: 94
l: 100
m: 104
n: 99
o: 86
p: 80
q: 95
r: 112
s: 113
t: 107
u: 96
v: 96
w: 126
x: 107
y: 92
z: 96

6.
a: 119
b: 100
c: 97
d: 85
e: 94
f: 107
g: 103
h: 98
i: 100
j: 89
k: 90
l: 120
m: 102
n: 107
o: 104
p: 81
q: 99
r: 108
s: 101
t: 92
u: 96
v: 94
w: 117
x: 98
y: 115
z: 84

7.
a: 94
b: 84
c: 94
d: 87
e: 98
f: 90
g: 117
h: 93
i: 110
j: 125
k: 85
l: 98
m: 94
n: 103
o: 125
p: 129
q: 105
r: 91
s: 95
t: 103
u: 90
v: 90
w: 107
x: 90
y: 113
z: 90

8.
a: 85
b: 105
c: 105
d: 88
e: 99
f: 89
g: 99
h: 111
i: 93
j: 104
k: 100
l: 100
m: 113
n: 101
o: 105
p: 107
q: 74
r: 107
s: 102
t: 101
u: 95
v: 106
w: 86
x: 117
y: 106
z: 102

9.
a: 98
b: 118
c: 98
d: 80
e: 108
f: 104
g: 109
h: 95
i: 94
j: 82
k: 103
l: 100
m: 103
n: 88
o: 96
p: 109
q: 110
r: 104
s: 104
t: 84
u: 102
v: 104
w: 107
x: 101
y: 110
z: 89

10.
a: 103
b: 92
c: 90
d: 105
e: 98
f: 121
g: 104
h: 104
i: 111
j: 103
k: 103
l: 108
m: 103
n: 107
o: 99
p: 87
q: 110
r: 94
s: 96
t: 95
u: 100
v: 100
w: 86
x: 94
y: 81
z: 106

 

The ten keys I tested where all 2600 letters long. It looks like I was correct in thinking that each of the letters would tend towards 100 since 2600/26=100, and each letter in the key had an equal chance of occurring. Of course, I could've just used a generator that wasn't any good, but I believe this counts for at least something.

 

EDIT: Wait a minute. :doh:

 

Okay, I see what John Cuthber means. I may be correct in my statement, but something important to realize is that there are more possible combinations of letters when they're equal in quantity. When the key is basically a Julius Caesar cipher and all of the letters are the same, there are only 26 different possibilities. However, a key that's 2600 letters long and has 100 of each letter may have thousands of possible combinations. Although, on average, the key will have an equal amount of each letter, there are more equal letter combinations than any other combination that isn't equal. So, although my observation was correct, it didn't have the effect on one-time pad cryptanalysis that I thought it had.

Counter.txt

Edited by Asterisk Propernoun

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.