 |
|
Static Universe
|
|
Can you PM me the key so I can take a look at it?
|
|
|  |
 |
|
Vev
|
 |
I am so out of touch
Nov 2000 time: 15:28
|
|
Here is the new encoding files
Credit goes to John, who is in the same office as I am and have very little to do with AC.
Pravda new encoding
They are NOT secure. It uses 7bit alphabet, (actually it removes the most significant bit), and is easy to break, (once you know what it does).
Use this code the spread "The Truth".
It is already compiled and run in under command prompt. It takes in 'read.txt' and outputs 'read2.txt'
to decode, it takes in 'read2.txt' and outputs 'read3.txt'.
Source code to compile on other platforms
/*
* for some reason %b isn't supported
*/
#include
#include
int main()
{
FILE *inFile;
FILE *outFile;
char ch;
inFile=fopen("read.txt", "r");
if (inFile==NULL)
{
printf ("error opening file.\n");
exit(0);
}
outFile=fopen("read2.txt", "w");
if (outFile==NULL)
{
printf ("error opening file.\n");
exit(0);
}
fprintf(outFile,"Starting Encrypted Transmission.\n");
while ( (ch=fgetc(inFile)) != EOF)
{
fprintf(outFile,"%i",((ch >> 6)&1));
fprintf(outFile,"%i",((ch >> 5)&1));
fprintf(outFile,"%i",((ch >> 4)&1));
fprintf(outFile,"%i",((ch >> 3)&1));
fprintf(outFile,"%i",((ch >> 2)&1));
fprintf(outFile,"%i",((ch >> 1)&1));
fprintf(outFile,"%i",((ch)&1));
}
fprintf(outFile,"\nTransmission Complete.\n");
return (0);
}
               
/*
* for some reason %b isn't supported
*/
#include
#include
int main()
{
FILE *inFile;
FILE *outFile;
char ch;
char chout;
int counter;
inFile=fopen("read2.txt", "r");
if (inFile==NULL)
{
printf ("error opening file.\n");
exit(0);
}
outFile=fopen("read3.txt", "w");
if (outFile==NULL)
{
printf ("error opening file.\n");
exit(0);
}
while ( (ch=fgetc(inFile)) != '\n') {}
counter=7;
chout=0;
fprintf(outFile,"Decrypting Transmission.\n");
while ( (ch=fgetc(inFile)) != EOF)
{
counter--;
if (ch == '1')
chout += (1 << counter);
if (counter == 0)
{
fprintf(outFile,"%c",chout);
counter=7;
chout=0;
}
}
fprintf(outFile,"\nTransmission Decrypted.\n");
return (0);
}
Last edited by Vev on 26-05-2003 at 10:37
|
|
|  |
 |
|  |
 |
|
Snowflake
|
 |
falling, once again
Apr 2003 time: 23:28
|
|
Also, if this code machine could be put online, then the decoding part could be made a little tricky. For example, you have to put in a few numbers or letters in front of the codes, eg. "HIVE", then the codes, and the machine will give you the correct decoded message. Otherwise the machine randomly picks up a sentence from the database.
Who has the time and ability to put it online? I believe that is a important step toward the accessbility of this function.
Last edited by Snowflake on 26-05-2003 at 12:19
|
|
|  |
 |
|  |
 |
|
Vev
|
 |
I am so out of touch
Nov 2000 time: 15:28
|
|
Here is the program to do the variable offset and bit length analysis. What is really needed is a frequency analysis.
/*
* for some reason %b isn't supported
*/
#include
#include
#define columns 4
int defcount=8;
int defoffset=3;
int main(int argc, char **argv)
{
char keypress;
while (keypress != 'q')
{
printf("BitLength: %i, BitOffset: %1\n",defcount,defoffset);
printf("q = quit, w=+length, s=-length, a=-offset,d=+offset\n");
keypress = getchar();
if (keypress == 'w')
defcount++;
if (keypress == 's' && defcount > 4)
defcount--;
if (keypress == 'a' && defoffset > 0)
defoffset--;
if (keypress == 'd' && defoffset < defcount - 1)
defoffset++;
main2(argc,argv);
}
return(0);
}
int main2(int argc, char **argv)
{
FILE *inFile;
FILE *outFile;
char ch;
unsigned int chout;
int counter;
int bits;
int ii;
int columnssplit;
// unsigned char outputch;
inFile=fopen(argv[1], "r");
if (inFile==NULL)
{
printf ("error opening file.\n");
exit(0);
}
while ( (ch=fgetc(inFile)) != '\n') {}
printf("\n\n\nFile %s, offset %i, charlength %i\n",argv[1],defoffset,defcount);
printf("Header: ");
for(ii=0;ii
{
ch=fgetc(inFile);
printf("%c",ch);
}
printf("\n");
counter=defcount;
chout=0;
columnssplit=0;
bits=0;
while ( (ch=fgetc(inFile)) != EOF)
{
counter--;
if (ch == '1')
{
chout += (1 << counter);
bits++;
}
if (ch == '0')
bits++;
printf("%c",ch);
if (counter == 0)
{
//outputch=chout;
printf(" ");
if (chout <= 0xF)
printf("0");
if (chout <= 0xFF)
printf("0");
printf("%x\t ",chout);
counter=defcount;
chout=0;
columnssplit++;
if (columnssplit == columns)
{
printf("\n");
columnssplit=0;
}
}
}
if (counter != defcount)
{
printf("Total bits %i\n",bits);
}
return (0);
}
|
|
|  |
All times are GMT. The time now is 05:28. Apolyton Time is 00:28. |
top of page
|
| archivepost |
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|