One Time Pad

User avatar
Pigeon
Posts: 18059
Joined: Thu Mar 31, 2011 3:00 pm

One Time Pad

Post by Pigeon » Sat Sep 07, 2013 8:54 pm

One Time Pad crypto

One Time Pad link

User avatar
Pigeon
Posts: 18059
Joined: Thu Mar 31, 2011 3:00 pm

Re: One Time Pad and modular math

Post by Pigeon » Sat Sep 07, 2013 9:17 pm

Modular arithmetic has interesting properties that play an important role in cryptography and it is essential to the security of one-time pad encryption. The result of an encryption process could reveal information about the key or the plaintext. Such information might either point to possible solutions or enable the codebreaker to discard some wrong assumptions. The codebreaker will use this information as a lever to break open the encrypted message. By using modular arithmetic on the result of a calculation we can obscure the values that were used to calculate that result.

Modular arithmetic resembles calculating with the hour hand of a clock. There are 12 positions (0 through 11) on a clock. The 12 is regarded as 0 (00:00 hours) because modular arithmetic starts counting from zero. If the clock shows 9, and you add 7 hours, the result will show 4 and not 16, because as soon as you "wrap around" the 0 hour position, you start counting again from the start. This is basically a modulo 12 calculation, written as (9 + 7) mod 12 = 4. The modulus is the value at which numbers wrap around. With modulo 30, the result becomes 0 when it reaches 30 or, if you like, after 29 will follow 0. It is important to observe that if the hour hand points to 4 o'clock, we have no idea of the initial hour nor about how many hours were added. And the great thing about modular arithmetic is that we can do this with both addition and subtraction and, even beter, we can reverse the result by respectively modular subtraction and addition.

In mathematics, modulo x is the remainder after the division of a positive number by x. Some examples: 16 modulo 12 = 4 because 16 divided by 12 is 1 and this leaves a remainder of 4. Also, 16 modulo 10 is 6 because 16 divided by 10 is 1 and thus leaves a remainder of 6. Modular arithmetic is very valuable to cryptography because the result value reveals absolutely no information about the two values that were added or subtracted. If the result of a modulo 10 addition is 4, we have no idea whether this is the result of 0 + 4, 1 + 3, 2 + 2, 3 + 1, 4 + 0, 5 + 9, 6 + 8, 7 + 7, 8 + 6 or 9 + 5. The value 4 is the result of an equation with two unknowns, which is impossible to solve.

The modulus should have the same value as the number of different elements that need to be calculated, with 0 designated to the first element. Thus, for bits (0 or 1) we use modulo 2 and for bytes (8-bit values between 0 and 255) we use modulo 256 (in boolean arithmetic, we call this an XOR operation). For digits (0 through 9) we use modulo 10. In practice, modulo 10 is easy to perform by adding without carry and subtracting without borrowing, which basically means discarding all but the most-right digit of the result. For our one-time pad encryption with numbers, it could not be easier.

Performing modulo calculations on letters needs some additional explanation. One would tend to assign the numbers 1 trough 26 to the letters and then apply modulo 26. However, because the result of a modulo calculation can be zero (26 mod 26 = 0), the first element should always be regarded as zero. Thus, we must assign the values 0 through 25 to the letters A through Z and then use modulo 26 (that's also why we used 0 through 11 on our clock, and not 1 through 12). Modulo 26 is a bit more complicated to calculate than modulo 10, but the Vigenere Square is a practical way to perform modulo 26.

We will explain the need for modular arithmetic with some small examples: with normal addition, the ciphertext result 0 can only mean that both key and plaintext have the value 0. A ciphertext result of 1 means that the two unknowns can only be 0 + 1 or 1 + 0. With result 2, the unknowns can only be 0 + 2, 1 + 1 or 2 + 0. Thus, for some ciphertext result values we can either immediately determine the unknowns or we can see which unknowns of the equation could be possible or impossible. Suppose we combine the letter X (23) with the truly randomly selected key Z (25). With modulo 26, the result would be 22 (W) because (23 + 25) mod 26 = 22. This value does not reveal anything about plaintext or key. However, with a normal calculation the result will be 48. Although both plain letter and truly random key are unknown, we can draw some important conclusions: the total of 48 is only possible with combinations X (23) + Z (25), Y (24) + Y (24) or Z (25) + X (23). By merely looking at the ciphertext, we can discard all letters A through W as possible candidates for both plaintext and key. This is an important clue for the codebreaker. Of course, there are various ways to screw up encryption by not applying modular arithmetic, but they will all create a biased ciphertext instead of a random ciphertext. To codebreakers, bias is as valuable as gold.


User avatar
Royal
Posts: 10565
Joined: Mon Apr 11, 2011 5:55 pm

Re: One Time Pad

Post by Royal » Mon Sep 09, 2013 10:20 pm

I guess NSA would be in the race with foreign countries to develop the most complex equations. This also sheds light on why they would need faster super computers to run calculations to crack a code.

User avatar
Pigeon
Posts: 18059
Joined: Thu Mar 31, 2011 3:00 pm

Re: One Time Pad

Post by Pigeon » Tue Sep 10, 2013 12:56 am

Actually encryption is written by regular people and peer reviewed, including the NSA. The government will select the best to use as a standard. No one would ever accept a secret encryption standard made by the government.

This is why some encryption is still secure.

User avatar
Royal
Posts: 10565
Joined: Mon Apr 11, 2011 5:55 pm

Re: One Time Pad

Post by Royal » Tue Sep 10, 2013 1:50 am

Is there any encryption that if calculated on a graph, would resemble the shape of a vortex.

User avatar
Royal
Posts: 10565
Joined: Mon Apr 11, 2011 5:55 pm

Re: One Time Pad

Post by Royal » Tue Sep 10, 2013 1:54 am

Pigeon wrote:Actually encryption is written by regular people and peer reviewed, including the NSA. The government will select the best to use as a standard. No one would ever accept a secret encryption standard made by the government.

This is why some encryption is still secure.
The goal being fastest and simplest way to transmit large amounts of data?

User avatar
Pigeon
Posts: 18059
Joined: Thu Mar 31, 2011 3:00 pm

Re: One Time Pad

Post by Pigeon » Tue Sep 10, 2013 2:13 am

Mainly to work (not able to find keys,etc to break it), speed does help

A lot of info here

User avatar
Royal
Posts: 10565
Joined: Mon Apr 11, 2011 5:55 pm

Re: One Time Pad

Post by Royal » Tue Sep 10, 2013 2:31 am

I imagine anything can be used for encryption. Music, art, arrangement of apples... everything has a form (or mathematical calculation) to the thing or entity, can even be space(s). The laser jet can print dots of a picture in a certain way that can be read by a advanced scanner to output data.

What is to say our entire reality is not encryption for something else?

This is why I find cracking encryption an impossible task for me, because I look through it from my design perspective- if it was me designing it, nobody will ever figure it out.

I would have the encryption multi layered so that when they cracked it, it would read out text but wouldn't be the correct text. And that's if they got that far.

SCAN SCAN READ READ SCAN SCAN READ... it can go on forever.

User avatar
Royal
Posts: 10565
Joined: Mon Apr 11, 2011 5:55 pm

Re: One Time Pad

Post by Royal » Tue Sep 10, 2013 3:14 am

But encryption based on the 12 hour clock is very interesting!

User avatar
Royal
Posts: 10565
Joined: Mon Apr 11, 2011 5:55 pm

Re: One Time Pad

Post by Royal » Tue Sep 10, 2013 4:41 am

In plain terms, what are they talking about here?
http://crypto.stackexchange.com/questio ... ga-lambda4

Post Reply