Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^8: Calculating corruption

by james28909 (Deacon)
on Oct 20, 2014 at 03:04 UTC ( [id://1104369]=note: print w/replies, xml ) Need Help??


in reply to Re^7: Calculating corruption
in thread Calculating corruption

ill give you some files and proof tomorrow if i can get some free time or the next day. and the main reason is, because i know everybody wants to see this. i may not be a seasoned professional when it comes to programming, but i am seasoned when it comes to what i have done hunndereds of times before, based off of an expected outcome.

Replies are listed 'Best First'.
Re^9: Calculating corruption
by BrowserUk (Patriarch) on Oct 20, 2014 at 06:18 UTC
    ill give you some files and proof tomorrow

    I'll be losing neither sleep nor money over this, but it would be interesting to see how you approach proving the impossible :)

    But let me see if I cannot convince you that you are wasting your time.

    Let's start with a plain text of 256 bytes. Obviously, every one of those bytes can take on any of the 256 values 0x00 thru 0xff.

    Now, in order that the encrypted text be decryptable, for any given key, every one of those 3.23e+616 plain text inputs, will need to produce a different encrypted output text. To be otherwise, would mean that one encrypted message could be decrypted as two (or more) different plain texts which would be entirely useless.

    So, the possible encrypted texts will range though a file of 256 zeros (std.dev. 0) through 256 0xffs (std.dev. also zero); and all 3.23e+616 possible combinations in between. The highest std.dev. will occur when half the 256 bytes have a value of 0, and the other half a value of 255, thus a mean of 127.5 and the greatest variance possible:

    $sum = 0; $sum += $_ for (0)x128, (255)x128; print $sum, "\t", $mean = $sum / 256;; 32640 127.5 $SoS = 0; $SoS += sqrt( ( $_ - 127.5 )**2 ) for (0)x128, (255)x128; print $SoS, "\t", $stdDev = $SoS / 256;; 32640 127.5

    So the std.devs of all 3.23e616 possible encrypted texts can vary between 0 and 127.5. And if we "corrupt" one bit in one byte:

    $sum = 0; $sum += $_ for (0)x128, (255)x127, 254; print $sum, "\t", $mean = $sum / 256;; 32639 127.49609375 $SoS = 0; $SoS += sqrt( ( $_ - $mean )**2 ) for(0)x128, (255)x127, 254; print $SoS, "\t", $stdDev = $SoS / 256;; 32639 127.49609375

    We discover a difference of 0.00390625 in the standard deviation.

    But... that is the exact expected std.dev. for the legitimate, uncorrupted encrypted text that contains 128 zeros, 127 0xffs and 1 0xfe. And also all the 3.35e+504 encrypted texts that contain those same byte values in any other order!

    The bottom line is that for any value of standard deviation you calculate for a "corrupted" text; there are 3.35e+504 ...

    3350850684932979117652665123754814942022584063591740702576779884286208 +799035732771005626138126763314259280802118502282445926550135522251856 +727692533193070412811083330325659322041700029792166250734253390513754 +466045711240338462701034020262992581378423147276636643647155396305352 +541105541439434840109915068285430675068591638581980604162940383356586 +739198268782104924614076605793562865241982176207428620969776803149467 +431386807972438247689158656000000000000000000000000000000000000000000 +000000000000000000000

    ... uncorrupted encrypted texts for which that is the correct value; and there is simply no possible way to distinguish them.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1104369]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-24 08:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found