1. Re: Data Encryption
- Posted by Robert B Pilkington <bpilkington at JUNO.COM> Jun 18, 1998
- 573 views
- Last edited Jun 19, 1998
On Thu, 18 Jun 1998 23:16:41 -0400 Alan Tu <ATU5713 at COMPUSERVE.COM> writes: >>>>>> >I use integers. If the number overflows (goes beyond 255 or below 0), >then I bring the number back into range. (A remainder(new_number, 256) >should do it, but I simply subtract (or add, if it's decrypting) 256 >to >it to bring it back to it's allowed range.) ><<<<< > >Let's suppose we seed a random number generator so that it returns >these two sequential numbers: > >0, 255 > >Now you have two bytes you want to encrypt: > >239, 240 > >Add =3D to 239, and you get the encrypted byte. 240+255 =3D 495. It >overflows, so subtract 256. You get 239. So 239 could mean 239 or >240. = > >Is there any way to tell? Ok, the file would look like this (but in ASCII characters, not values): Unencrypted: 239, 240 Encrypted: 239, 239 When you decrypt, using the same password, the same set of random numbers are generated (a call to set_rand(i), with i being a number created after doing calculations on the password), the opposite happens, the same numbers are subtracted: 239-0 = 239 240-255 < 0 so add 256 = 240 And now you have the original file: 239, 240 It looks like you were thinking of a substitution type encryption (ie 255 = 34, 38 = 255, 84 = 38, etc). It's not. It's a *REALLY*NEAT* encryption. :) _____________________________________________________________________ You don't need to buy Internet access to use free Internet e-mail. Get completely free e-mail from Juno at http://www.juno.com Or call Juno at (800) 654-JUNO [654-5866]