Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

the /prog/ pact

Name: Anonymous 2011-11-16 5:27

if 4chan ever goes down (and stays down) we reconvene on freenode #/prog/

Name: Anonymous 2011-11-16 6:12

>/prog/ down
and nothing of value was lost

Name: Anonymous 2011-11-16 6:54

not a chance, I wouldn't want to be in the same chat room as any of you

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-16 7:56

I'm considering writing a BBS in C, though i'm not sure how it would be hosted.

Name: FrozenVoid!!mJCwdV5J0Xy2A21 2011-11-16 8:00

Oh, it should be a P2P BBS of course.

Name: Anonymous 2011-11-16 8:11

>>4
It's simple: instead of using CGI, just make a HTTP server as a part of the website program.
Otherwise, you can still use CGI and get worse performance.

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2011-11-16 8:15

>>5
I would make one, but who will use p2p network for one site? It could be something much more.
Layers:
1.Darknet encryption using latest crypteria(its unbreakable, since it random)
2.Random routing via nearest nodes(using something like netsukuku fractal routing)
3.Packet obfuscation(make it appear like standard TCP traffic)
4.App layer - Software signed by public keys(so author can distibute a BBS patch or update)
5.User level - Access either anonymously or use sha256 tripcode

Name: Anonymous 2011-11-16 8:19

Reinvent Usenet

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2011-11-16 8:22

>>8
Unmoderated spam pit with 1 message/month?

Name: Anonymous 2011-11-16 8:26

>>9
Not if you add spambots!

Name: Anonymous 2011-11-16 8:29

>>7
Crypteria, what is that?

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2011-11-16 8:31

>>11
Encryption algorithm which i wrote. Several version are available.
http://www.reddit.com/r/Crypteria

Name: Anonymous 2011-11-16 8:43

>>12
Several versions? i see only one?

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2011-11-16 8:46

>>13
Here is one from the archived blog posts. there 7 of which 3 are notable.
Crypteria4.c Cipher
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ull unsigned long long
#define ll long long int
#define ui unsigned int
#define lu unsigned long
#define li long int
#define ch char
#define uc unsigned char
#define chp char*
#define ucp unsigned char*
#define stdargs int argc,char **argv
//==DEBUG
#define thisline ;printf("%d,",__LINE__); //debug scan,print number of last executed line
//==ASM
#define rdt(timer) ;asm volatile("rdtsc\n\t":"=A"(timer));
// unsigned long long timer
//==Bitutil//byte rotate left/right
#define brol(value,shift)  ((value << shift) | (value >> (8 - shift)))
#define getbit(byte,place) (byte&(1<<place))
#define delbit(byte,place) (byte&(0xFF^(1<<place)))//get 2chunks of byte
#define byte04(bt) bt&0xc0   //chunk[11000000]
#define byte14(bt) bt&0x30   //chunk[00110000]
#define byte24(bt) bt&0xc   //chunk[00001100]
#define byte34(bt) bt&0x3   //chunk[00000011]
//erase 2chunks of byte
#define byte40(bt) bt&0x3f   //chunk[00111111]
#define byte41(bt) bt&0xcf  //chunk[11001111]
#define byte42(bt) bt&0xf3  //chunk[11110011]
#define byte43(bt) bt&0xfc  //chunk[11111100]
//get 1bit from byte#define gbit0(bt) bt&0x80
#define gbit1(bt) bt&0x40
#define gbit2(bt) bt&0x20
#define gbit3(bt) bt&0x10
#define gbit4(bt) bt&0x8
#define gbit5(bt) bt&0x4
#define gbit6(bt) bt&0x2
#define gbit7(bt) bt&0x1
//erase 1 bit from byte
#define cbit0(bt)  bt&0x7f
#define cbit1(bt)  bt&0xbf
#define cbit2(bt) bt&0xdf
#define cbit3(bt) bt&0xef
#define cbit4(bt) bt&0xf7
#define cbit5(bt) bt&0xfb
#define cbit6(bt)  bt&0xfd
#define cbit7(bt)  bt&0xfe
//==File IO
#define fseekend(file) ;fseek(file,0,SEEK_END);
#define fseekstart(file) ;fseek(file,0,SEEK_SET);
#define rfp(pointer,filename) ;FILE* pointer=fopen(filename,"rb");
#define srfp(pointer2,file) ;FILE* pointer2=fopen(file,"rb");if(!pointer2){printf("%s",file);perror("<=srfp:");exit(1);};
#define wfp(pointer,filename) ;FILE* pointer=fopen(filename,"wb");
#define swfp(pointer2,file) ;FILE* pointer2=fopen(file,"wb");if(!pointer2){printf("%s",file);perror("<=swfp:");exit(1);};
#define fsize(name,rsize) ;srfp(temp_1,name);fseekend(temp_1);rsize=ftell(temp_1);fclose(temp_1);
#define rdf(pointer3,name,rsize) ;srfp(temp_2,name);fseekend(temp_2);li rsize=ftell(temp_2);rewind(temp_2);uc* pointer3=malloc(rsize);fread(pointer3,1,rsize,temp_2);fclose(temp_2);
#define wrf(pointer,name,size) ;swfp(temp_3,name);fwrite(pointer,1,size,temp_3);fclose(temp_3);
#define FILESIZEMULT 31 //howmuch bytes max+8 is added to each input byte(defines enc format)
#define SYNTAX ;printf("Syntax : %s inputfile password [-decode]\n .ecf files are encrypted, .src files are decrypted",argv[0]);
inline uc rndbyte(void){ull tmp;rdt(tmp);uc a,c,b,d;a=tmp&0xFF;d=a%5;if(d<3){d++;}rdt(tmp);b=tmp&0xFF;d=(d*(b%5))^a;if(d>10){d-=10;};rdt(tmp);c=tmp&0xFF;if(d%2){return a^b^c;}else{return b^c^a;}}
void main(stdargs){if(argc<3){SYNTAX;return;}rdf(input,argv[1],inpsize);int pwlen=strlen(argv[2]);uc pwshift=(pwlen%8)+1;chp outputname=malloc(512);sprintf(outputname,"%s%s",argv[1],argv[3]?".src":".ecf");printf("%s '%s' to '%s'",argv[3]?"Decoding":"Encoding",argv[1],outputname);swfp(output,outputname);li loop=0;uc curgap;li gapbyte=0;uc bitarr[8];uc curgaph,bytec0,bytec1,bytec2,bytec3,bytec4,bytec5,bytec6,bytec7,s1,s2;uc endbyte=0;if(!argv[3]){for(loop=0;loop<inpsize;loop++){curgap=argv[2][loop%pwlen];curgaph=(brol(curgap,pwshift))%FILESIZEMULT ;for(gapbyte=0;gapbyte<(curgaph);gapbyte++){fputc(rndbyte(),output);};//rotate back bitarr[x] =8-rotates2=((pwshift+0)^curgap)%8;s1=(brol(curgap,s2))%8;bytec0=((gbit0(input[loop]))|(cbit0(rndbyte())))^(brol(curgap,s1));fputc(brol(bytec0,(8-s1)),output);s2=((pwshift+1)^curgap)%8;s1=(brol(curgap,s2))%8;bytec1=((gbit1(input[loop]))|(cbit1(rndbyte())))^(brol(curgap,s1));fputc(brol(bytec1,(8-s1)),output);s2=((pwshift+2)^curgap)%8;s1=(brol(curgap,s2))%8;bytec2=((gbit2(input[loop]))|(cbit2(rndbyte())))^(brol(curgap,s1));fputc(brol(bytec2,(8-s1)),output);s2=((pwshift+3)^curgap)%8;s1=(brol(curgap,s2))%8;bytec3=((gbit3(input[loop]))|(cbit3(rndbyte())))^(brol(curgap,s1));fputc(brol(bytec3,(8-s1)),output);s2=((pwshift+4)^curgap)%8;s1=(brol(curgap,s2))%8;bytec4=((gbit4(input[loop]))|(cbit4(rndbyte())))^(brol(curgap,s1));fputc(brol(bytec4,(8-s1)),output);s2=((pwshift+5)^curgap)%8;s1=(brol(curgap,s2))%8;bytec5=((gbit5(input[loop]))|(cbit5(rndbyte())))^(brol(curgap,s1));fputc(brol(bytec5,(8-s1)),output);s2=((pwshift+6)^curgap)%8;s1=(brol(curgap,s2))%8;bytec6=((gbit6(input[loop]))|(cbit6(rndbyte())))^(brol(curgap,s1));fputc(brol(bytec6,(8-s1)),output);s2=((pwshift+7)^curgap)%8;s1=(brol(curgap,s2))%8;bytec7=((gbit7(input[loop]))|(cbit7(rndbyte())))^(brol(curgap,s1));fputc(brol(bytec7,(8-s1)),output);}}else{while(1){if(gapbyte==pwlen){gapbyte=0;};curgap=argv[2][gapbyte++];loop+=((brol(curgap,pwshift))%FILESIZEMULT);if(loop>inpsize){break;};endbyte=0;s2=((pwshift+0)^curgap)%8;bitarr[0]=input[loop++];s1=(brol(curgap,s2))%8;bytec0=gbit0((brol(bitarr[0],s1)^brol(curgap,s1)));s2=((pwshift+1)^curgap)%8;bitarr[1]=input[loop++];s1=(brol(curgap,s2))%8;bytec1=gbit1((brol(bitarr[1],s1)^brol(curgap,s1)));s2=((pwshift+2)^curgap)%8;bitarr[2]=input[loop++];s1=(brol(curgap,s2))%8;bytec2=gbit2((brol(bitarr[2],s1)^brol(curgap,s1)));s2=((pwshift+3)^curgap)%8;bitarr[3]=input[loop++];s1=(brol(curgap,s2))%8;bytec3=gbit3((brol(bitarr[3],s1)^brol(curgap,s1)));s2=((pwshift+4)^curgap)%8;bitarr[4]=input[loop++];s1=(brol(curgap,s2))%8;bytec4=gbit4((brol(bitarr[4],s1)^brol(curgap,s1)));s2=((pwshift+5)^curgap)%8;bitarr[5]=input[loop++];s1=(brol(curgap,s2))%8;bytec5=gbit5((brol(bitarr[5],s1)^brol(curgap,s1)));s2=((pwshift+6)^curgap)%8;bitarr[6]=input[loop++];s1=(brol(curgap,s2))%8;bytec6=gbit6((brol(bitarr[6],s1)^brol(curgap,s1)));s2=((pwshift+7)^curgap)%8;bitarr[7]=input[loop++];s1=(brol(curgap,s2))%8;bytec7=gbit7((brol(bitarr[7],s1)^brol(curgap,s1)));endbyte|=bytec0;endbyte|=bytec1;endbyte|=bytec2;endbyte|=bytec3;endbyte|=bytec4;endbyte|=bytec5;endbyte|=bytec6;endbyte|=bytec7;fputc(endbyte,output);}}}

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2011-11-16 8:49

its slightly messed up since blog merge all lines, but you can sort it out easily.

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2011-11-16 8:50

Crypteria3.c Cipher#include <stdio.h>#include <stdlib.h>#include <string.h>#define ull unsigned long long#define ll long long int#define ui unsigned int#define lu unsigned long#define li long int#define ch char#define uc unsigned char #define chp char*#define ucp unsigned char*#define stdargs int argc,char **argv//==DEBUG#define thisline ;printf("%d,",__LINE__); //debug scan,print number of last executed line//==ASM#define rdt(timer) ;asm volatile("rdtsc\n\t":"=A"(timer)); // unsigned long long timer//==Bitutil//byte rotate left/right#define brol(value,shift)  ((value << shift) | (value >> (8 - shift)))#define getbit(byte,place) (byte&(1<<place))#define delbit(byte,place) (byte&(0xFF^(1<<place)))//get 2chunks of byte#define byte04(bt) bt&0xc0   //chunk[11000000]#define byte14(bt) bt&0x30   //chunk[00110000]#define byte24(bt) bt&0xc   //chunk[00001100]#define byte34(bt) bt&0x3   //chunk[00000011]//erase 2chunks of byte#define byte40(bt) bt&0x3f   //chunk[00111111]#define byte41(bt) bt&0xcf  //chunk[11001111]#define byte42(bt) bt&0xf3  //chunk[11110011]#define byte43(bt) bt&0xfc  //chunk[11111100]//get 1bit from byte#define gbit0(bt) bt&0x80#define gbit1(bt) bt&0x40#define gbit2(bt) bt&0x20#define gbit3(bt) bt&0x10#define gbit4(bt) bt&0x8#define gbit5(bt) bt&0x4#define gbit6(bt) bt&0x2 #define gbit7(bt) bt&0x1//erase 1 bit from byte#define cbit0(bt)  bt&0x7f#define cbit1(bt)  bt&0xbf#define cbit2(bt) bt&0xdf#define cbit3(bt) bt&0xef#define cbit4(bt) bt&0xf7#define cbit5(bt) bt&0xfb#define cbit6(bt)  bt&0xfd#define cbit7(bt)  bt&0xfe//==File IO#define fseekend(file) ;fseek(file,0,SEEK_END);#define fseekstart(file) ;fseek(file,0,SEEK_SET);#define rfp(pointer,filename) ;FILE* pointer=fopen(filename,"rb"); #define srfp(pointer2,file) ;FILE* pointer2=fopen(file,"rb");if(!pointer2){printf("%s",file);perror("<=srfp:");exit(1);}; #define wfp(pointer,filename) ;FILE* pointer=fopen(filename,"wb"); #define swfp(pointer2,file) ;FILE* pointer2=fopen(file,"wb");if(!pointer2){printf("%s",file);perror("<=swfp:");exit(1);}; #define fsize(name,rsize) ;srfp(temp_1,name);fseekend(temp_1);rsize=ftell(temp_1);fclose(temp_1);#define rdf(pointer3,name,rsize) ;srfp(temp_2,name);fseekend(temp_2);li rsize=ftell(temp_2);rewind(temp_2);uc* pointer3=malloc(rsize);fread(pointer3,1,rsize,temp_2);fclose(temp_2); #define wrf(pointer,name,size) ;swfp(temp_3,name);fwrite(pointer,1,size,temp_3);fclose(temp_3); #define SYNTAX ;printf("Syntax : %s inputfile password [-decode]\n .ecf files are encrypted, .src files are decrypted",argv[0]);inline uc rndbyte(void){ull tmp;rdt(tmp);return (uc)(tmp&0xFF);}void main(stdargs){if(argc<3){SYNTAX;return;}rdf(input,argv[1],inpsize);int pwlen=strlen(argv[2]);chp outputname=malloc(512);sprintf(outputname,"%s%s",argv[1],argv[3]?".src":".ecf");printf("%s '%s' to '%s'",argv[3]?"Decoding":"Encoding",argv[1],outputname);swfp(output,outputname);li loop=0;uc curgap;li gapbyte=0;uc bitarr[8];uc curgaph,bytec0,bytec1,bytec2,bytec3,bytec4,bytec5,bytec6,bytec7,endbyte,s1,shift2;if(!argv[3]){for(loop=0;loop<inpsize;loop++){curgap=argv[2][loop%pwlen];curgaph=curgap&0x1e;for(gapbyte=0;gapbyte<(curgaph);gapbyte++){fputc(rndbyte(),output);};//rotate back bitarr[x] =8-rotates1=(brol(curgap,0))%8;bytec0=((gbit0(input[loop]))|(cbit0(rndbyte())))^(brol(curgap,s1));fputc(brol(bytec0,(8-s1)),output);s1=(brol(curgap,1))%8;bytec1=((gbit1(input[loop]))|(cbit1(rndbyte())))^(brol(curgap,s1));fputc(brol(bytec1,(8-s1)),output);s1=(brol(curgap,2))%8;bytec2=((gbit2(input[loop]))|(cbit2(rndbyte())))^(brol(curgap,s1));fputc(brol(bytec2,(8-s1)),output);s1=(brol(curgap,3))%8;bytec3=((gbit3(input[loop]))|(cbit3(rndbyte())))^(brol(curgap,s1));fputc(brol(bytec3,(8-s1)),output);s1=(brol(curgap,4))%8;bytec4=((gbit4(input[loop]))|(cbit4(rndbyte())))^(brol(curgap,s1));fputc(brol(bytec4,(8-s1)),output);s1=(brol(curgap,5))%8;bytec5=((gbit5(input[loop]))|(cbit5(rndbyte())))^(brol(curgap,s1));fputc(brol(bytec5,(8-s1)),output);s1=(brol(curgap,6))%8;bytec6=((gbit6(input[loop]))|(cbit6(rndbyte())))^(brol(curgap,s1));fputc(brol(bytec6,(8-s1)),output);s1=(brol(curgap,7))%8;bytec7=((gbit7(input[loop]))|(cbit7(rndbyte())))^(brol(curgap,s1));fputc(brol(bytec7,(8-s1)),output);}}else{while(1){if(gapbyte==pwlen){gapbyte=0;};curgap=argv[2][gapbyte++];loop+=(curgap&0x1e);if(loop>inpsize){break;};endbyte=0;bitarr[0]=input[loop++];s1=(brol(curgap,0))%8;bytec0=gbit0((brol(bitarr[0],s1)^brol(curgap,s1)));bitarr[1]=input[loop++];s1=(brol(curgap,1))%8;bytec1=gbit1((brol(bitarr[1],s1)^brol(curgap,s1)));bitarr[2]=input[loop++];s1=(brol(curgap,2))%8;bytec2=gbit2((brol(bitarr[2],s1)^brol(curgap,s1)));bitarr[3]=input[loop++];s1=(brol(curgap,3))%8;bytec3=gbit3((brol(bitarr[3],s1)^brol(curgap,s1)));bitarr[4]=input[loop++];s1=(brol(curgap,4))%8;bytec4=gbit4((brol(bitarr[4],s1)^brol(curgap,s1)));bitarr[5]=input[loop++];s1=(brol(curgap,5))%8;bytec5=gbit5((brol(bitarr[5],s1)^brol(curgap,s1)));bitarr[6]=input[loop++];s1=(brol(curgap,6))%8;bytec6=gbit6((brol(bitarr[6],s1)^brol(curgap,s1)));bitarr[7]=input[loop++];s1=(brol(curgap,7))%8;bytec7=gbit7((brol(bitarr[7],s1)^brol(curgap,s1)));endbyte|=bytec0;endbyte|=bytec1;endbyte|=bytec2;endbyte|=bytec3;endbyte|=bytec4;endbyte|=bytec5;endbyte|=bytec6;endbyte|=bytec7;fputc(endbyte,output);}}}

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2011-11-16 8:51

Crypteria2.c Cipher#include <stdio.h>#include <stdlib.h>#include <string.h>#include <limits.h>//===TYPE 3char#define ull unsigned long long#define ll long long int#define ui unsigned int#define lu unsigned long#define li long int#define ch char#define uc unsigned char #define chp char*#define ucp unsigned char*#define stdargs int argc,char **argv//==DEBUG#define thisline ;printf("%d,",__LINE__); //debug scan,print number of last executed line//==ASM#define rdt(timer) ;asm volatile("rdtsc\n\t":"=A"(timer)); // unsigned long long timer//==Bitutil//get 2chunks of byte#define byte04(bt) bt&0xc0   //chunk[11000000]#define byte14(bt) bt&0x30   //chunk[00110000]#define byte24(bt) bt&0xc   //chunk[00001100]#define byte34(bt) bt&0x3   //chunk[00000011]//erase 2chunks of byte#define byte40(bt) bt&0x3f   //chunk[00111111]#define byte41(bt) bt&0xcf  //chunk[11001111]#define byte42(bt) bt&0xf3  //chunk[11110011]#define byte43(bt) bt&0xfc  //chunk[11111100]//get 1bit from byte#define gbit0(bt) bt&0x80#define gbit1(bt) bt&0x40#define gbit2(bt) bt&0x20#define gbit3(bt) bt&0x10#define gbit4(bt) bt&0x8#define gbit5(bt) bt&0x4#define gbit6(bt) bt&0x2 #define gbit7(bt) bt&0x1//erase 1 bit from byte#define cbit0(bt)  bt&0x7f#define cbit1(bt)  bt&0xbf#define cbit2(bt) bt&0xdf#define cbit3(bt) bt&0xef#define cbit4(bt) bt&0xf7#define cbit5(bt) bt&0xfb#define cbit6(bt)  bt&0xfd#define cbit7(bt)  bt&0xfe//==File IO#define fseekend(file) ;fseek(file,0,SEEK_END);#define fseekstart(file) ;fseek(file,0,SEEK_SET);#define rfp(pointer,filename) ;FILE* pointer=fopen(filename,"rb"); #define srfp(pointer2,file) ;FILE* pointer2=fopen(file,"rb");if(!pointer2){printf("%s",file);perror("<=srfp:");exit(1);}; #define wfp(pointer,filename) ;FILE* pointer=fopen(filename,"wb"); #define swfp(pointer2,file) ;FILE* pointer2=fopen(file,"wb");if(!pointer2){printf("%s",file);perror("<=swfp:");exit(1);}; #define fsize(name,rsize) ;srfp(temp_1,name);fseekend(temp_1);rsize=ftell(temp_1);fclose(temp_1);#define rdf(pointer3,name,rsize) ;srfp(temp_2,name);fseekend(temp_2);li rsize=ftell(temp_2);rewind(temp_2);uc* pointer3=malloc(rsize);fread(pointer3,1,rsize,temp_2);fclose(temp_2); #define wrf(pointer,name,size) ;swfp(temp_3,name);fwrite(pointer,1,size,temp_3);fclose(temp_3); #define SYNTAX ;printf("Syntax : %s inputfile password [-decode]\n .ecf files are necrypted, .src files are decrypted",argv[0]);inline uc rndbyte(void){ull tmp;rdt(tmp);return (uc)(tmp&0xFF);}void main(stdargs){if(argc<3){SYNTAX;return;}rdf(input,argv[1],inpsize);int pwlen=strlen(argv[2]);chp outputname=malloc(512);sprintf(outputname,"%s%s",argv[1],argv[3]?".src":".ecf");printf("%s '%s' to '%s'",argv[3]?"Decoding":"Encoding",argv[1],outputname);swfp(output,outputname);li loop=0;uc curgap;li gapbyte=0;uc curgaph,bytec0,bytec1,bytec2,bytec3,bytec4,bytec5,bytec6,bytec7,endbyte;if(!argv[3]){for(loop=0;loop<inpsize;loop++){curgap=argv[2][loop%pwlen];curgaph=curgap&0xf;for(gapbyte=0;gapbyte<(curgaph);gapbyte++){fputc(rndbyte(),output);};bytec0=((gbit0(input[loop]))|(cbit0(rndbyte())))^curgap;fputc(bytec0,output);bytec1=((gbit1(input[loop]))|(cbit1(rndbyte())))^curgap;fputc(bytec1,output);bytec2=((gbit2(input[loop]))|(cbit2(rndbyte())))^curgap;fputc(bytec2,output);bytec3=((gbit3(input[loop]))|(cbit3(rndbyte())))^curgap;fputc(bytec3,output);bytec4=((gbit4(input[loop]))|(cbit4(rndbyte())))^curgap;fputc(bytec4,output);bytec5=((gbit5(input[loop]))|(cbit5(rndbyte())))^curgap;fputc(bytec5,output);bytec6=((gbit6(input[loop]))|(cbit6(rndbyte())))^curgap;fputc(bytec6,output);bytec7=((gbit7(input[loop]))|(cbit7(rndbyte())))^curgap;fputc(bytec7,output);}}else{while(1){if(gapbyte==pwlen){gapbyte=0;};curgap=argv[2][gapbyte++];loop+=(curgap&0xF);if(loop>inpsize){break;};endbyte=0;bytec0=gbit0(((input[loop++])^curgap));bytec1=gbit1(((input[loop++])^curgap));bytec2=gbit2(((input[loop++])^curgap));bytec3=gbit3(((input[loop++])^curgap));bytec4=gbit4(((input[loop++])^curgap));bytec5=gbit5(((input[loop++])^curgap));bytec6=gbit6(((input[loop++])^curgap));bytec7=gbit7(((input[loop++])^curgap));endbyte|=bytec0;endbyte|=bytec1;endbyte|=bytec2;endbyte|=bytec3;endbyte|=bytec4;endbyte|=bytec5;endbyte|=bytec6;endbyte|=bytec7;fputc(endbyte,output);}}}

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2011-11-16 8:53

This is last one i've actively coded:
Crypteria5.c Cipher
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ull unsigned long long
#define ll long long int
#define ui unsigned int
#define lu unsigned long
#define li long int
#define ch char
#define uc unsigned char
#define chp char*
#define ucp unsigned char*
#define stdargs int argc,char **argv
//==DEBUG
#define thisline  ;printf("%d,",__LINE__) ;
//debug scan,print number of last executed line
//==ASM
#define rdt(timer)  ;asm volatile("rdtsc\n\t":"=A"(timer)) ;
// unsigned long long timer
//==Bitutil//byte rotate left/right
#define brol(value,shift)  ((value << shift) | (value >> (8 - shift)))
#define getbit(byte,place) (byte&(1<<place))
#define delbit(byte,place) (byte&(0xFF^(1<<place)))
//get 2chunks of byte
#define byte04(bt) bt&0xc0  
//chunk[11000000]
#define byte14(bt) bt&0x30  
//chunk[00110000]
#define byte24(bt) bt&0xc  
//chunk[00001100]
#define byte34(bt) bt&0x3  
//chunk[00000011]
//erase 2chunks of byte
#define byte40(bt) bt&0x3f  
//chunk[00111111]
#define byte41(bt) bt&0xcf 
//chunk[11001111]
#define byte42(bt) bt&0xf3 
//chunk[11110011]
#define byte43(bt) bt&0xfc 
//chunk[11111100]
//get 1bit from byte
#define gbit0(bt) bt&0x80
#define gbit1(bt) bt&0x40
#define gbit2(bt) bt&0x20
#define gbit3(bt) bt&0x10
#define gbit4(bt) bt&0x8
#define gbit5(bt) bt&0x4
#define gbit6(bt) bt&0x2
#define gbit7(bt) bt&0x1
//erase 1 bit from byte
#define cbit0(bt)  bt&0x7f
#define cbit1(bt)  bt&0xbf
#define cbit2(bt) bt&0xdf
#define cbit3(bt) bt&0xef
#define cbit4(bt) bt&0xf7
#define cbit5(bt) bt&0xfb
#define cbit6(bt)  bt&0xfd
#define cbit7(bt)  bt&0xfe
//==File IO
#define fseekend(file)  ;fseek(file,0,SEEK_END) ;
#define fseekstart(file)  ;fseek(file,0,SEEK_SET) ;
#define rfp(pointer,filename)  ;FILE* pointer=fopen(filename,"rb") ;
#define srfp(pointer2,file)  ;FILE* pointer2=fopen(file,"rb") ;if(!pointer2){printf("%s",file) ;perror("<=srfp:") ;exit(1) ;}
#define wfp(pointer,filename)  ;FILE* pointer=fopen(filename,"wb") ;
#define swfp(pointer2,file)  ;FILE* pointer2=fopen(file,"wb") ;if(!pointer2){printf("%s",file) ;perror("<=swfp:") ;exit(1) ;}
#define fsize(name,rsize)  ;srfp(temp_1,name) ;fseekend(temp_1) ;rsize=ftell(temp_1) ;fclose(temp_1)
#define rdf(pointer3,name,rsize)  ;srfp(temp_2,name) ;fseekend(temp_2) ;li rsize=ftell(temp_2) ;rewind(temp_2) ;uc* pointer3=malloc(rsize) ;fread(pointer3,1,rsize,temp_2) ;fclose(temp_2) ;
#define wrf(pointer,name,size)  ;swfp(temp_3,name) ;fwrite(pointer,1,size,temp_3) ;fclose(temp_3) ;
#define SYNTAX  ;printf("Syntax : %s inputfile password [-decode]\n .ecf files are encrypted, .src files are decrypted",argv[0]) ;
inline uc rndbyte(void){ull tmp ;rdt(tmp) ;uc a,c,b,d ;a=tmp&0xFF ;d=a%5 ;if(d< ;3){d++ ;}rdt(tmp) ;b=tmp&0xFF ;d=(d*(b%5))^a ;if(d> ;10){d-=10 ;} ;rdt(tmp) ;c=tmp&0xFF ;if(d&1){return a^b^c ;}else{return b^c^a ;}}
void main(stdargs){
if(argc<3){SYNTAX ;return ;};
rdf(input,argv[1],inpsize) ;
int pwlen=strlen(argv[2]) ;
if(pwlen<8){printf("Password too short!\n") ;exit(1) ;}
uc pwshift=((pwlen%256)^(argv[2][0])) ;
chp outputname=malloc(512) ;
sprintf(outputname,"%s%s",argv[1],argv[3]?".src":".ecf") ;
printf("%s '%s' to '%s'",argv[3]?"Decoding":"Encoding",argv[1],outputname) ;
swfp(output,outputname) ;
li loop=0 ;
li gapbyte=0 ;
uc bitarr[8] ;
uc bitpos,byten,curgap,curgaph,s1,s2,endbyte ;
if(!argv[3]){for(loop=0 ;loop<inpsize ;loop++){
curgap=argv[2][loop%pwlen] ;
s2=((pwshift++)^curgap)%8 ;
curgaph=(brol(curgap,s2))%(((pwshift++)%16)+16)  ;
for(gapbyte=0 ;gapbyte< (curgaph) ;gapbyte++){
fputc(rndbyte(),output) ;} ;
for(bitpos=0 ;bitpos< 8 ;bitpos++){
s2=((pwshift++)^curgap)%8 ;
s1=(brol(curgap,s2))%8 ;
s1+=((pwshift++)|curgap) ;
s1%=8 ;
bitarr[bitpos]=((getbit(input[loop],(7-bitpos)))|(delbit(rndbyte(),(7-bitpos))))^(brol(curgap,s1))^((s1+s2)*(s1-s2)) ;
fputc(brol(bitarr[bitpos],(8-s1)),output) ;
}}}else{
while(1){
if(gapbyte==pwlen){gapbyte=0 ;} ;
curgap=argv[2][gapbyte++] ;
s2=((pwshift++)^curgap)%8 ;
loop+=((brol(curgap,s2))%(((pwshift++)%16)+16)) ;
if(loop> inpsize){break ;} ;
endbyte=0 ;
for(bitpos=0 ;bitpos< 8 ;bitpos++){
s2=((pwshift++)^curgap)%8 ;
bitarr[bitpos]=input[loop++] ;
s1=(brol(curgap,s2))%8 ;
s1+=((pwshift++)|curgap) ;
s1%=8 ;
byten=(brol(bitarr[bitpos],s1))^(brol(curgap,s1))^((s1+s2)*(s1-s2)) ;
endbyte|=(getbit(byten,(7-bitpos))) ;}
fputc(endbyte,output) ;}}}

Name: Anonymous 2011-11-16 9:07

>>14
I prefer your newer type defines.

Name: Anonymous 2011-11-16 9:09

#define stdargs int argc,char **argv
What's the purpose of this?

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2011-11-16 9:12

>>19
its code from 2008-2009 period, which i never updated. The type system of u1-u8/s1-s8/f2-f10 came later, to make the type more self-descriptive(since i've changed the meanings several times already).

Name: Anonymous 2011-11-16 9:14

>>21
Everybody else puts the numbers in the types as bits, but no, you have to be an autist and confuse people, by defining u8 as uint64_t, when people expect it to be uint8_t. Fucking troll autist.

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2011-11-16 9:14

>>20
Its standard line from void.h to reduce typing
all these includes, are merged from void.h
it would be typically
#include "void.h"
void main(stdargs){code;}

Name: Anonymous 2011-11-16 9:15

>>21
Why don't you use the code tag, disgusting furfag?

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2011-11-16 9:21

>>24
I recommend switching to verdana and stopping using monospaced text as aid for coding process.

Name: Anonymous 2011-11-16 9:50

>>23
Could you post your whole "void.h"?

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2011-11-16 10:01

>>26
I didn't keep all old revisions, and void.h is modified often.
You probably mean version for tcc, which was used for crypteria, it is present in archives of tcc progs, but i'm not sure its complete.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>
#include <math.h>
#define ull unsigned long long
#define ll long long int
#define ui unsigned int
#define lu unsigned long
#define li long int
#define ch char
#define dd double
#define uc unsigned char
#define ru register unsigned int
#define ri register int
#define rd register double
//=======funcs
#define P printf
#define stdargs int argc,char **argv
#define thisline ;printf("%d,",__LINE__); //debug scan,print number of last executed line
#define cputime(timer) ;asm volatile("rdtsc\n\t":"=A"(timer)); // unsigned long long timer
//==bitutil
#define byterotleft(byte,shift)  ((byte << shift) | (byte >> (8 - shift)))
#define byterotright(byte,shift) ((byte <<(8-shift)) | (byte >> ( shift)))
#define getbit(byte,place) (byte&(1<<place))
#define delbit(byte,place) (byte&(0xFF^(1<<place)))
//=FILES
#define fseekend(file) ;fseek(file,0,SEEK_END);
#define fseekstart(file) ;fseek(file,0,SEEK_SET);
#define rfp(pointer,filename) ;FILE* pointer=fopen(filename,"rb");
#define srfp(pointer2,file) ;FILE* pointer2=fopen(file,"rb");if(!pointer2){printf("%s",file);perror("<=srfp:");exit(1);};
#define wfp(pointer,filename) ;FILE* pointer=fopen(filename,"wb");
#define swfp(pointer2,file) ;FILE* pointer2=fopen(file,"wb");if(!pointer2){printf("%s",file);perror("<=swfp:");exit(1);};
#define fsize(name,rsize) ;srfp(temp_1,name);fseekend(temp_1);rsize=ftell(temp_1);fclose(temp_1);
#define rdf(pointer3,name,rsize) ;srfp(temp_2,name);fseekend(temp_2);li rsize=ftell(temp_2);rewind(temp_2);uc* pointer3=malloc(rsize);fread(pointer3,1,rsize,temp_2);fclose(temp_2);
#define wrf(pointer,name,size) ;swfp(temp_3,name);fwrite(pointer,1,size,temp_3);fclose(temp_3);


//Inline comparision square root.
rd ddsqrt_guess,ddsqrt_guessold,ddsqrt_min,ddsqrt_max,ddsqrt_cmp;  union{int tmp;float val;}float_sqrt;
#define ddvsqrt(dest,src) ;ddsqrt_guess=-1.0;ddsqrt_guessold=0.0;if(src<0){goto ddsqrt_end;};\
float_sqrt.val=src;float_sqrt.tmp-=1<<23;float_sqrt.tmp>>=1; float_sqrt.tmp += 1<<29;ddsqrt_min=float_sqrt.val*0.9;\
ddsqrt_max=float_sqrt.val;ddsqrt_loop:\
if(ddsqrt_guess==ddsqrt_guessold){goto ddsqrt_end;}else{ddsqrt_guessold=ddsqrt_guess;};\
ddsqrt_guess=(ddsqrt_min+ddsqrt_max)/2;ddsqrt_cmp=ddsqrt_guess*ddsqrt_guess;\
ddsqrt_cmp>src?ddsqrt_max=ddsqrt_guess:ddsqrt_min=ddsqrt_guess;\
ddsqrt_guess=(ddsqrt_min+ddsqrt_max)/2;ddsqrt_cmp=ddsqrt_guess*ddsqrt_guess;\
ddsqrt_cmp>src?ddsqrt_max=ddsqrt_guess:ddsqrt_min=ddsqrt_guess;goto ddsqrt_loop;ddsqrt_end:;dest=ddsqrt_guess;

//write args

Name: Anonymous 2011-11-16 10:09

code style, heard of it?

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2011-11-16 10:12

>>28
I prefer function over form. I don't need styles

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2011-11-16 10:14

If ask "What is void.h used for?" its not a central library of everything i code.
Its used more a common utility to reduce typing the same stuff every time i open notepad2

Name: Anonymous 2011-11-16 10:17

>>27
I meant the most recent version.

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2011-11-16 10:21

>>31
Currently there is none, since about a few months ago i just copypaste the define from a few files(its easier to distribute).

Name: Anonymous 2011-11-16 10:23

The connection has timed out

The server at freenode.net is taking too long to respond.

The site could be temporarily unavailable or too busy. Try again in a few moments.

If you are unable to load any pages, check your computer's network connection.

If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.

IMAGEBOARD QUALITY

Name: Anonymous 2011-11-16 10:26

>>32
Ah, forget about it then.
Why did you name it void.h and not, say, mydefines.h?

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2011-11-16 10:27

The void.h approach had few flaws
1.void.h new version changes can break old code
2.its impossible to transfer as single file to pastebin, it need to be merged with main file
3.i often have the habit of moving functions into void.h, which aren't used much(like ddsqrt one)

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2011-11-16 10:29

>>34
I wanted a short name, typing #include "void.h" is short and disambiguates from other headers

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2011-11-16 10:36

Also these are bithacks which were removed from one version since they're unused(they're from main "Bithacks" page at http://graphics.stanford.edu/~seander/bithacks.html )
#define haszero(v)  (~((((v & 0x7F7F7F7F) + 0x7F7F7F7F) | (v)) | 0x7F7F7F7F))
#define hasvalue(x,n) (haszero(((x)^((((~0UL)/255) * (n))))))
#define hasless(x,n) (((x)-(((~0UL)/255)*(n)))&(~(x))&(((~0UL)/255)*128))
#define countless(x,n)\
(((((~0UL)/255)*(127+(n))-((x)&(((~0UL)/255)*127)))&(~(x))&~0UL/255*128)/128%255)
#define hasbetween(x,m,n) ((~0UL/255*(127+(n))-((x)&~0UL/255*127)&~(x)&((x)&(~0UL/255*127))+(~0UL/255*(127-m)))&(~0UL/255*128))
#define countbetween(x,m,n) ((hasbetween(x,m,n)/128)%255)
//supplemental bithacks
#define unordered_match(num,chars) (hasvalue((num),(chars[0]))&&hasvalue((num),(chars[1]))&&hasvalue((num),(chars[2]))&&hasvalue((num),(chars[3])))
#define ordered_match(num,chars) !(((chars[0])|(chars[1]<<8)|(chars[2]<<16)|(chars[3]<<24))^num)

Name: Anonymous 2011-11-16 10:57

>>37
do you watch MLP

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2011-11-16 11:02

>>38
No, I prefer older cartoons like Tom & Jerry

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2011-11-16 11:04

I mostly watch anime from youtube and anime music videos. Cartoons aren't that interesting today(current american cartoons from 90's onward are low-quality entertainment for retards).

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List