Welcome, Guest

Author Topic: something for later  (Read 3744 times)

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
something for later
« on: November 15, 2012, 08:18:51 PM »
something to python:

this is the scenario. person a wants to tell person b a message. However, person a can't be assured that someone will not intercept the message and figure it out. to complicate things, person a and person b know nothing about each other. person a can encrypt the message but then person b cannot decrypt it; if he can, that means anyone who has intercepted the message can too.

solution: person a encrypts the message with x, sends it to person b. person b encrypts the x encrypted message with y and sends it back to person a who unencrypts x and sends it to person b to unencrypts y.

example: person a sends the number '11' to b
first a multiplies by 3
11*3=33
person b multiplies by 7
33*7=231
person b sends it back to person a
person a divides by 3
231/3=77
person b divides by 7
77/7=11
person b recieves the message

atomic7732

  • Global Moderator
  • *****
  • Posts: 3849
  • caught in the river turning blue
    • Paladin of Storms
Re: something for later
« Reply #1 on: November 15, 2012, 08:57:25 PM »
what if I wanted to send "what if I wanted to send"?

Darvince

  • *****
  • Posts: 1842
  • 差不多
Re: something for later
« Reply #2 on: November 15, 2012, 09:16:42 PM »
THEN ENCODE IN 10-BIT AND THEN NUMBER.

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: something for later
« Reply #3 on: November 16, 2012, 12:51:44 PM »
what if I wanted to send "what if I wanted to send"?

well yeah as darvince said just give all the characters a two number code which leaves plenty of space for punctuation and then convert that sentence into a number and send that

blotz

  • Formerly 'bong'
  • *****
  • Posts: 813
  • op pls
Re: something for later
« Reply #4 on: November 16, 2012, 01:25:22 PM »
oh

atomic7732

  • Global Moderator
  • *****
  • Posts: 3849
  • caught in the river turning blue
    • Paladin of Storms
Re: something for later
« Reply #5 on: November 16, 2012, 03:15:24 PM »
what if I wanted to send "what if I wanted to send"?

well yeah as darvince said just give all the characters a two number code which leaves plenty of space for punctuation and then convert that sentence into a number and send that
but how does that person know what two number code corresponds to what?

For example for "extra" security I might decide that:
01 - z
02 - y
03 - x
04 - w
...
25 - b
26 - a

while you on the receiving end might think I just encoded it alphabetically

and that's just a simple encoding difference, what if I came up with a code to encrypt the order of characters?

in that case I might want to say "hi".

hi -> 1918... but how do you encrypt these characters anyway? if you assumed 0-9 was appended to the end in order of increasing value, you would get

28372836, this sent back to me, i'd decrypt it (0-9 in decreasing order because my encoding is that way) to get

8182 which you would decrypt into nothing. and backwards it's 2818 which is "1i"

Though actually... (100-81)(100-82) = 1918 which is "hi" but how would you come to a conclusion like that with encryption made so that people couldn't actually crack the code with 3 minutes of effort?
« Last Edit: November 16, 2012, 03:19:43 PM by atomic7732 »

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: something for later
« Reply #6 on: November 16, 2012, 08:39:52 PM »
Quote
but how does that person know what two number code corresponds to what?

well in the real world everything is binary so each letter has an official binary representation. if i were to this in python i would make the encoder and decoder use a standardized number-letter code, the extra security is not needed. so a is always 01 and b is always 02 etc.


if you wanted to send 'hi' which might correspond to 0809
>multiply it by 3
2427
person b recieves it, multiplies by 4
9708
you get it back, divide by 3
3236
send it to a, who divides by 4
0809
turns it back into letters

however, by doing 9708/2427 and 9708/3236 it would be possible to figure out the multipliers used.

instead of just multiplying a better idea is to figure out two commutative functions;
f(x)=x^3
f'(x)=root3(x)
g(x)=x^5
g'(x)=root5(x)

0809
apply f(x) to 0809
529475129
person b applies g(x):
41612884801984134225475389695239054060426649
person a applies f'(x):
346531411903049
person b applies g'(x):
0809


atomic7732

  • Global Moderator
  • *****
  • Posts: 3849
  • caught in the river turning blue
    • Paladin of Storms
Re: something for later
« Reply #7 on: November 16, 2012, 08:48:03 PM »
I'm talking seriously, if someone intercepted the message, your plans are foiled.

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: something for later
« Reply #8 on: November 16, 2012, 08:48:57 PM »
how so?

Darvince

  • *****
  • Posts: 1842
  • 差不多
Re: something for later
« Reply #9 on: November 16, 2012, 08:51:22 PM »
well yes but if they receive it on the way then they get the number 529475129, 41612884801984134225475389695239054060426649, or 346531411903049 which is gibberish

atomic7732

  • Global Moderator
  • *****
  • Posts: 3849
  • caught in the river turning blue
    • Paladin of Storms
Re: something for later
« Reply #10 on: November 16, 2012, 08:53:56 PM »
how so?
because a-01 b-02 is kind of extremely simple?

unless your functions are like 8th degree polynomials with decimals and radicals...

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: something for later
« Reply #11 on: November 16, 2012, 08:58:31 PM »
well the functions thing can be debated.

"because a-01 b-02 is kind of extremely simple?"
well if you think this is simple you might as well think security is a joke because this is how pretty much all data is stored no matter what the encryption.
changing this would make the code a one-time pad which cannot be broken by anyone at all unless they have the key (and they don't have the key, thats the point).

atomic7732

  • Global Moderator
  • *****
  • Posts: 3849
  • caught in the river turning blue
    • Paladin of Storms
Re: something for later
« Reply #12 on: November 16, 2012, 09:05:10 PM »
quantum key distribution

Darvince

  • *****
  • Posts: 1842
  • 差不多
Re: something for later
« Reply #13 on: November 16, 2012, 09:15:51 PM »
use atmospheric noise encryption
or just use the inverse of x^5 - x^4 + 5