Game Maker's Garage Forum

Game Maker's Garage => Trash Talk => Topic started by: Circuit on August 06, 2012, 07:07:10 PM

Title: Looking for a special type of program
Post by: Circuit on August 06, 2012, 07:07:10 PM
I need a program that can compare two files and report what consecutive sequences of bytes they have in common, and how long the sequences are.  I also need to be able to analyze a file and determine if it contains a looping sequence of bytes.  These are similar tasks, so I suppose that there might be a program that can do both.  Do you guys know of any programs that can do the job?
Title: Re: Looking for a special type of program
Post by: Gan on August 06, 2012, 07:29:14 PM
That sounds intense.

I've never read individual bytes before. Just text. Afraid I can't help ya there.

Bytes they have in common... that sounds extensive. Would that be big chunks, small chunks, is there a set size the in-common bytes have to be, is it based on similar location or anywhere in the file?
All that comparison seems like it would take a long while to analyze every combination of bytes of every type of length from one file compared to the other file.
Title: Re: Looking for a special type of program
Post by: Connors on August 06, 2012, 09:14:00 PM
Sounds like a very interesting way to encrypt something though. You could set it up so that to decipher something people have to compare two files.
Title: Re: Looking for a special type of program
Post by: Circuit on August 07, 2012, 08:41:27 PM
Yep, you guessed it Connors, this is for an encryption program.   ;D  I'm attempting to write an algorithm which will use a short password to generate a sequence of bytes which is as long as the file being encrypted.  Each byte in the generated sequence will encrypt a byte in the plaintext.  If the encrypting sequence is unique, non-repetitive, and seemingly random, then the ciphertext will be very hard to crack, at least in theory.  A derivative sequence isn't as good as a truly random sequence, but it's much better than my previous method (Vigenere substitution).

I want to test the sequences to determine if they eventually repeat themselves.  I also want to compare sequences to determine if different sequences can converge into a common sequence.  A convergence would probably be a large chunk in both files, and it would have to continue to the end of the files.  The longer the common sequence is, the more likely it's a true convergence.