Greatest Programming Achievement
1
Name:
Anonymous
2012-01-27 19:55
So /prog/ , if your meant to be these l337 programmers what have you got to show for it? Name your greatest programming achievements. And if you can show proof do so by providing a link to your project somewhere like github or sourceforge.
2
Name:
Anonymous
2012-01-27 20:19
but i only do scientific code.
which doesn't belong to me after finished
3
Name:
Anonymous
2012-01-27 20:19
I can't, I'm a gentleman
4
Name:
Anonymous
2012-01-27 21:13
Can't, NDA.
5
Name:
Anonymous
2012-01-27 21:17
6
Name:
Anonymous
2012-01-27 22:45
hows a -NASA inspired- / -factorial based- / Keyed (cryptographic?) Hash function family...?
...i thought i already posted it up here, couldn't find it though, must've just mentioned it =)
7
Name:
Anonymous
2012-01-27 22:47
stalks can find it in my hotmail / skydrive (public access) ^^
8
Name:
Anonymous
2012-01-27 22:47
LISP
9
Name:
Anonymous
2012-01-27 23:08
Does nobody remember me posting that Lotus / vX code?
Or was it censored??
On /prog no less!?
btw it wasn't even the best version =D
Jar / Axis / Cell / ... hmm what other (buzz/key)words did i use..?
hashi ?? =D
10
Name:
Anonymous
2012-01-27 23:09
like a copY?
hang on a sec ;)
11
Name:
Anonymous
2012-01-27 23:11
Part I of II
//---------------// DEF //---------------//
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <io.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <errno.h>
//---------------
#define NumBase 256
#define DuoBase NumBase + NumBase
//#define RoundXBase 3
#define iToHex "?0123456789ABCDEF!"
#define ChopBit 128
#define ShiftBits 1+2+4+8
#define ValMax 256
#define BlockMax 256
//---------------// GLOBAL //---------------//
short b_Duo[DuoBase];
short A_Jar[NumBase];
short B_Jar[NumBase];
short C_Jar[NumBase];
short D_Jar[NumBase];
short E_Jar[NumBase];
short F_Jar[NumBase];
short G_Jar[NumBase];
short xK_Jar[NumBase];
short xI_Jar[NumBase];
short xO_Jar[NumBase];
short xV_Jar[NumBase];
short Out_Lx[NumBase];
short Out_Fx[NumBase];
//short Out_Fy[NumBase];
short Out_Fz[NumBase];
char XHash[1000];
char *buffer;
clock_t timeX, timeY, timeZ;
FILE *FX;
short XB1, XB2;
short iHX2;
int ibM=0, ibN=0, ibO=0, ibP=0, ibQ=0, ibR=0, ibS=0, ibT=0;
long l_KeepVal=0;
short s_KeepVal=0;
//-----------------------------------------------------------//
/*---Original Code by n3n7i ~'05-onward----------------------*/
/*-----------------------------------------------------------*/
/*----(Lotus [vX4i(/i+)]/</ Nonentity /</ Hive vX)-----------*/
//-----------------------------------------------------------//
/*----Free to use/modify/distribute/etc----------------------*/
/*------Please retain / append this Comment as Required------*/
//-----------------------------------------------------------//
//---------------// AXIS //---------------//
void InitDuo(){
short iDo=0;
for(iDo=0;iDo<NumBase;iDo++){
b_Duo[iDo] = iDo;
b_Duo[iDo+NumBase] = iDo;
}
}
//--------------
//---------------// JAR //---------------//
void ResetA(){
int Ri=0;
for (Ri=0;Ri<NumBase;Ri+=2){ A_Jar[Ri]=Ri; A_Jar[Ri+1]=Ri+1;}
}
//---------------
int ModX(int ValM, int ByValM){
int V=ValM;
int BV=ByValM;
if (BV==0){ BV++;}
while (V>=BV){ V-=BV;}
return V;
}
//---------------
int NewKeyByte(int NewBase){
int x=rand();
int y=ModX(x, NewBase);
return y;
}
//---------------
int ShiftA(int ByValS, int LessVals){
int Si=ByValS;
//if (Si==0){ Si++;}
int SA=A_Jar[Si];
for (Si=ByValS;Si<LessVals;Si++){ A_Jar[Si]= A_Jar[Si+1];}
return SA;
}
//---------------
void PrintKey(short X_Jar[]){
int PKey=0;
for (PKey=0;PKey<NumBase;PKey++){
printf("%i,", X_Jar[PKey]);
}
printf("\n");
}
//---------------
void PrintKeyX(short X_Jar[], char XStr[]){
int PKey=0;
for (PKey=0;PKey<NumBase;PKey++){
printf("%c", iToHex[X_Jar[PKey]+1]);
}
printf(" %s\n", &XStr[0]);
}
//---------------
void NewKey(short Nin_Jar[]){
int Ni=0;
int iKey=0;
ResetA();
for (Ni=0;Ni<NumBase;Ni++){
iKey = NewKeyByte(NumBase-Ni);
Nin_Jar[Ni] = ShiftA(iKey, NumBase - Ni);
}
//PrintKey(Nin_Jar);
}
//---------------// JAR-E //---------------//
void KeySquare(short Val_Jar[], short By_Jar[]){
int Ki=0;
for (Ki=0;Ki<NumBase;Ki+=4){
A_Jar[Ki] = Val_Jar[By_Jar[Ki]];
A_Jar[Ki+1] = Val_Jar[By_Jar[Ki+1]];
A_Jar[Ki+2] = Val_Jar[By_Jar[Ki+2]];
A_Jar[Ki+3] = Val_Jar[By_Jar[Ki+3]];
}
for (Ki=0;Ki<NumBase;Ki+=4){
Val_Jar[Ki] = A_Jar[Ki];
Val_Jar[Ki+1] = A_Jar[Ki+1];
Val_Jar[Ki+2] = A_Jar[Ki+2];
Val_Jar[Ki+3] = A_Jar[Ki+3];
}
}
//---------------
void DblKS(short Out_Jar[], short By_Jar1[], short By_Jar2[]){
int Ki=0;
for (Ki=0;Ki<NumBase;Ki+=4){
A_Jar[By_Jar1[Ki]] = By_Jar2[Out_Jar[Ki]];
A_Jar[By_Jar1[Ki+1]] = By_Jar2[Out_Jar[Ki+1]];
A_Jar[By_Jar1[Ki+2]] = By_Jar2[Out_Jar[Ki+2]];
A_Jar[By_Jar1[Ki+3]] = By_Jar2[Out_Jar[Ki+3]];
}
for (Ki=0;Ki<NumBase;Ki+=4){
Out_Jar[Ki] = A_Jar[Ki];
Out_Jar[Ki+1] = A_Jar[Ki+1];
Out_Jar[Ki+2] = A_Jar[Ki+2];
Out_Jar[Ki+3] = A_Jar[Ki+3];
}
}
//---------------
void KeySet(short Val_JarKS[], short By_JarKS[]){
int Ki=0;
int KS=0;
for (Ki=0;Ki<NumBase;Ki++){ Val_JarKS[Ki] = By_JarKS[Ki];}
}
//---------------
//---------------
void KGenI(int SVal){
srand(SVal);
NewKey(B_Jar);
NewKey(C_Jar);
NewKey(D_Jar);
NewKey(E_Jar);
NewKey(F_Jar);
NewKey(G_Jar);
}
//---------------
void KShift(){
int iKS;
for (iKS=0;iKS<NumBase;iKS+=4){
xV_Jar[iKS] = xO_Jar[iKS]; xO_Jar[iKS] = xI_Jar[iKS];
xI_Jar[iKS] = xK_Jar[iKS]; xK_Jar[iKS] = E_Jar[iKS];
xV_Jar[iKS+1] = xO_Jar[iKS+1]; xO_Jar[iKS+1] = xI_Jar[iKS+1];
xI_Jar[iKS+1] = xK_Jar[iKS+1]; xK_Jar[iKS+1] = E_Jar[iKS+1];
xV_Jar[iKS+2] = xO_Jar[iKS+2]; xO_Jar[iKS+2] = xI_Jar[iKS+2];
xI_Jar[iKS+2] = xK_Jar[iKS+2]; xK_Jar[iKS+2] = E_Jar[iKS+2];
xV_Jar[iKS+3] = xO_Jar[iKS+3]; xO_Jar[iKS+3] = xI_Jar[iKS+3];
xI_Jar[iKS+3] = xK_Jar[iKS+3]; xK_Jar[iKS+3] = E_Jar[iKS+3];
}
}
//---------------
void KSched(){
KShift();
//DblKS(D_Jar, C_Jar, B_Jar);
KeySquare(G_Jar, F_Jar);
DblKS(E_Jar, D_Jar, G_Jar);
//PrintKeyX(E_Jar, "E_Jar");
//PrintKeyX(xK_Jar, "k_Jar");
//PrintKeyX(xI_Jar, "i_Jar");
//PrintKeyX(xO_Jar, "o_Jar");
//PrintKeyX(xV_Jar, "v_Jar");
//printf("\n");
}
//---------------
void PrimeCell(){
int iKV;
for (iKV=1;iKV<=5;iKV++){ KSched();}
KeySet(Out_Fx, xK_Jar);
KeySet(Out_Fz, xO_Jar);
}
//---------------// HAshI //---------------//
//---------------
short H_Axis1(short HKey, short HInput){
return xK_Jar[ (xO_Jar[HKey] ^ xV_Jar[HInput]) ];
}
//---------------
short H_Axis2(short HKey, short HInput){
return xO_Jar[ (xK_Jar[HKey] ^ xI_Jar[HInput]) ];
}
//---------------
short H_Axis3(short HKey, short HInput){
return xI_Jar[ (xV_Jar[HKey] ^ xK_Jar[HInput]) ];
}
//---------------
//---------------
short H_Axis4(short HKey, short HInput){
return xV_Jar[ (xI_Jar[HKey] ^ xO_Jar[HInput]) ];
}
//---------------
short H_Axis5(short HKey, short HInput){
return xK_Jar[ (xV_Jar[HKey] ^ xI_Jar[HInput]) ];
}
//--------------- Buffer //---------------
12
Name:
Anonymous
2012-01-27 23:13
II of II
long mainBuff(char *Fin){
FILE *file;
char *name;
unsigned long fX=0, fileLen=0;
long OutLen=0;
printf("open..");
file = fopen(Fin, "rb+");
if (!file){
printf("fOpen Failed!! ");
return 0;
}
printf("seek..");
fseek(file, 0, SEEK_END);
printf("tell..");
fileLen = ftell(file);
printf("seek..");
fseek(file, 0, SEEK_SET);
printf("malloc..");
buffer = (char *)malloc(fileLen+1);
if (!buffer){
printf("Mem Failed!!");
fclose(file);
return 0;
}
printf("read..");
fread(buffer, fileLen, 1, file);
printf("close..");
fclose(file);
OutLen = (long) fileLen;
l_KeepVal = OutLen;
printf("-%i- ",(int) OutLen);
return OutLen;
}
//---------------//---------------//---------------
//---------------
void ModXToHex(int ValM){
int V=ValM;
int BV=16;
int DivVal=0;
if (ValM>=ValMax){ printf("OverSize Input Error! [%i]",ValM);}
while (V>=BV){ V-=BV; DivVal++;}
XB1 = DivVal+1;
XB2 = V+1;
}
//---------------
void HashiFOut(char Fstr[]){
int iFO=0;
int iHsh=0;
short iFX=0;
short xCount=0;
char c;
FILE *fout;
if((fout=fopen(Fstr,"w"))==NULL){
perror("fopen fileoUT");
exit(0);
}
for (iFO=0;iFO<NumBase;iFO++){
iFX = Out_Lx[iFO];
ModXToHex(iFX);
iHsh++;
XHash[iHsh] = iToHex[XB1];
iHsh++;
XHash[iHsh] = iToHex[XB2];
iHsh++;
XHash[iHsh] = ' ';
xCount++;
if (xCount==16){
iHsh++;
XHash[iHsh] = '\n';
xCount=0;
}
}
fwrite(&XHash[1], iHsh, 1, fout);
printf("\n%s\n", &XHash[1]);
fclose(fout);
}
//---------------
void AddFPadding(int FPx){
int iAP=0;
if (FPx==NumBase) return 0;
//Out_Lx[iAP] = 0;
for (iAP=FPx;iAP<NumBase;iAP++) Out_Lx[iAP] = iAP;
}
//---------------
long HashiBR(long FXR, long FXEnd){
int TestVal=1, Lp=0;
long FXR2 = FXR, FXEnd2= FXEnd;
while(TestVal){
Out_Lx[Lp] = (int) buffer[FXR2];
Lp++;
FXR2++;
TestVal = (Lp<BlockMax) && (FXR2<FXEnd2);
}
s_KeepVal = Lp-1;
if (FXR2==FXEnd2){
AddFPadding(Lp);
}
return FXR2;
}
//---------------
int TestJARSHIFT(short x_Jar[], int Xi){
short b_Block[BlockMax];
int i=0, Yi=0;
for(i=0;i<Xi;i++){
Out_Lx[i]=x_Jar[Out_Lx[i]];
b_Block[i] = Out_Lx[i] & ShiftBits;
Out_Lx[i]-=b_Block[i];
}
for (i=Xi;i<BlockMax;i++){
Out_Lx[i]=x_Jar[Out_Lx[i]];
b_Block[i] = Out_Lx[i] & ShiftBits;
Out_Lx[i] += b_Block[Yi]-b_Block[i];
Yi++;
}
for(i=0;i<Xi;i++){
Out_Lx[i]+=b_Block[Yi];
Yi++;
}
Out_Lx[0]-=(Yi = (Out_Lx[0] & ChopBit));
Out_Lx[0]+=Out_Lx[0]+(Yi==ChopBit);
}
//---------------
//---------------
//---------------
int TestDoubleHalfShift(short x_B[], short y_B[]){
int i=0, Xi=0, Yi=0;
for (i=0;i<BlockMax;i++){
x_B[i]-=(Xi=(x_B[i] & ShiftBits));
y_B[i]-=(Yi=(y_B[i] & ShiftBits));
x_B[i]+=Yi;
y_B[i]+=Xi;
}
}
//---------------
//---------------
void KeyFix(short hBy_JarKF[]){
int Xii=0;
for (Xii=0;Xii<NumBase;Xii+=4){
hBy_JarKF[Xii]=(Out_Lx[Xii] = A_Jar[Xii]);
hBy_JarKF[Xii+1]=(Out_Lx[Xii+1] = A_Jar[Xii+1]);
hBy_JarKF[Xii+2]=(Out_Lx[Xii+2] = A_Jar[Xii+2]);
hBy_JarKF[Xii+3]=(Out_Lx[Xii+3] = A_Jar[Xii+3]);
}
}
//---------------
//---------------
short HBI(short shByte, short b_Block[]){
return b_Block[ xK_Jar[ b_Duo[ shByte ] ] ];
}
//---------------
short HBII(short shByte, short b_Block[]){
return b_Block[ xI_Jar[ b_Duo[ shByte ] ] ];
}
//---------------
void CoreHashIII(short a_Block[], short b_Block[]){
short iXa, iXb, iXc, iXd;
int iiX=0;
for (iiX=0;iiX<NumBase;iiX++){
A_Jar[xO_Jar[iiX]] = H_Axis5(
H_Axis1( HBII(iiX + 23, a_Block), HBI(iiX + 11, b_Block) ) ^ a_Block[xI_Jar[iiX]],
H_Axis2( HBI(iiX + 28, b_Block), HBII(iiX + 50, a_Block) ) ^ b_Block[xK_Jar[iiX]]);
}
}
//---------------
//---------------
void HashiiX(short b_Block2[]){
CoreHashIII(Out_Lx, b_Block2);
KeyFix(b_Block2);
}
//---------------
//---------------
//---------------
void HRounds(){
//PrintKeyX(Out_Lx, "OutLX");
//PrintKeyX(Out_Fx, "OutFX");
TestJARSHIFT(xK_Jar, 1);
TestJARSHIFT(xI_Jar, 2);
TestJARSHIFT(xO_Jar, 4);
TestJARSHIFT(xV_Jar, 8);
KSched();
HashiiX(Out_Fx);
TestJARSHIFT(xK_Jar, 16);
TestJARSHIFT(xI_Jar, 32);
TestJARSHIFT(xO_Jar, 64);
TestJARSHIFT(xV_Jar, 128);
//HashiiX(Out_Fy);
//PrintKeyX(Out_Fz, "OutFZ");
KSched();
HashiiX(Out_Fz);
//PrintKeyX(Out_Fz, "OutfZ+h");
//PrintKeyX(Out_Fx, "Outfx");
TestDoubleHalfShift(Out_Fx, Out_Fz);
//PrintKeyX(Out_Fx, "Fx");
//PrintKeyX(Out_Fz, "Fz");
//printf("\n");
//KSched();
}
//---------------// MISC //---------------//
clock_t Tdelay(void){
clock_t time1;
time1 = clock();
return time1;
}
//---------------
void ClockedAt(char *CATstr){
timeY = Tdelay();
timeZ = timeY - timeX;
printf("\n%s ",CATstr);
printf(" [Clocked @] ");
printf("%d\n",timeZ);
timeX = timeY;
}
//---------------
//---------------
void BlockCount(){
ibM++;
if (ibM==ValMax){
ibM=0; ibN++;
if (ibN==ValMax){
ibN=0; ibO++;
if (ibO==ValMax){
ibO=0; ibP++;
if (ibP==ValMax){
ibP=0; ibQ++;
if (ibQ==ValMax){
ibQ=0; ibR++;
if (ibR==ValMax){
ibR=0; ibS++;
if (ibS==ValMax){
ibS=0; ibT++;
if (ibT==ValMax) ibT=0;
}
}
}
}
}
}
}
}
//---------------
void BlockMod(int iBX){
Out_Lx[BlockMax-9] = ibM;
Out_Lx[BlockMax-8] = ibN;
Out_Lx[BlockMax-7] = ibO;
Out_Lx[BlockMax-6] = ibP;
Out_Lx[BlockMax-5] = ibQ;
Out_Lx[BlockMax-4] = ibR;
Out_Lx[BlockMax-3] = ibS;
Out_Lx[BlockMax-2] = ibT;
Out_Lx[BlockMax-1] = iBX;
}
//-----------------
void XFinHash(){
HRounds();
HRounds();
}
//---------------// MAIN++ //---------------//
int main(int argc, char *argv[]){
int i=0;
long FXLen=0, FCount=0;
int X=0, M=0;
timeX = Tdelay();
printf("\n%d\n",timeX);
InitDuo();
KGenI(2);
PrimeCell();
FXLen = mainBuff(argv[1]);
ClockedAt("Init");
while (FXLen>FCount){
FCount = HashiBR(FCount, FXLen);
HRounds();
BlockCount();
if (M<1000000) M++;
}
AddFPadding(0);
BlockMod(s_KeepVal);
XFinHash();
HashiFOut(argv[2]);
printf("\n");
printf("\n==%i-Cycles==\n",M);
ClockedAt("Completed");
free(buffer);
return 0;
}
//---------------//
13
Name:
Anonymous
2012-01-27 23:23
...I know i did post a copy because i tweaked it especially for /prog
it was the 'Screwdriver-tweak' ^^ this is the untweaked / old version
compare if you will (/or can since it got CENSORED??)
U.S.A is scared of it?? lul must be good =)
14
Name:
Anonymous
2012-01-27 23:32
probably using it themselves the cheeky buggers ^^
lets see, Key-space was (!256)^4 [or ~7000 bit? from memory] // naive attack (purely on the key-schedule) (!256) ^ 1 or 2 (this is not assumed possible though ^^)
designed to be secure even in group-key // known-key attack environments =D it is a hash function after all...
15
Name:
Anonymous
2012-01-27 23:52
I implemented Sleepsort in Erlang.
16
Name:
Anonymous
2012-01-28 0:08
>>15 cool ;)
Without a key it's pretty much indestructable ^^ side channels notwithstanding
part of the actual structure of the compression is defined by the key =D just try getting the key from chosen inputs ^^
17
Name:
Mentifex
2012-01-28 9:21
18
Name:
Anonymous
2012-01-28 9:25
n3n7i
God fucking dammit. We already have our hands full with the Russian spammer.
19
Name:
Anonymous
2012-01-28 9:30
I just had my annual haircut ( just get it all buzzed off then let it grow for a year). And I've noticed I'm thinning a bit on top I think ;_; Feels old man. I feel like I'm going to have to lose weight and buy a sports car now
20
Name:
Anonymous
2012-01-28 9:43
>>19
I read this as "anal haircut."
21
Name:
Anonymous
2012-01-28 13:32
when I built a conditional branchless fizz buzz implementation
22
Name:
Dubs Guy
2012-03-17 15:49
D U B S , D U B S E V E R Y W H E R E !
23
Name:
VIPPER
2012-03-17 16:57
All my code is shit, but then again there is lots and lots of shitty code.
24
Name:
Anonymous
2012-03-17 22:17
a system that parsed barcodes on bills (like electricity bills) identifying the company and other data. it was not IA though; you had to teach the system about any new kind of bill. It worked remarkably well, and is still in use after 4 years