Rotating-combination hyper-secure lock
i mentioned in post want know thinks of system have devised:
i finished writing code cool lock. takes rhythm-based code entry whole new level of awesome. unfortunately require 2 separate arduino boards; 1 of them serves lock, , other key. makes awesome current combination opens lock switches between 20 possible combinations 250,000 times per second. (there 9999 combinations, , 1 use more set of 20, didn't feel writing code more 20) the lock , key must turned on @ same time , maintain in sync within 8 microseconds of each other. means unauthorized person attempting copy key may able extract password set, case design have in mind disconnect power key if case opened. cause lock , key lose synchronization each other , key no longer function properly.
i finished writing code cool lock. takes rhythm-based code entry whole new level of awesome. unfortunately require 2 separate arduino boards; 1 of them serves lock, , other key. makes awesome current combination opens lock switches between 20 possible combinations 250,000 times per second. (there 9999 combinations, , 1 use more set of 20, didn't feel writing code more 20) the lock , key must turned on @ same time , maintain in sync within 8 microseconds of each other. means unauthorized person attempting copy key may able extract password set, case design have in mind disconnect power key if case opened. cause lock , key lose synchronization each other , key no longer function properly.
code: [select]
// lock circuit program
int codepin = 1;
int outpin = 2;
// above pins used simplicity
// 1 move them other pins if desired
long ccv = 0;
int cv = 0;
int chksm = 0;
int rsintv = 4;
//value set 100 because isnt zero
int value = 100;
int vselect = 0;
int tmhcount = 0;
long prevmicros = 0;
long tmhmicros = 0;
void setup() {
pinmode(codepin, input);
pinmode(outpin, output);
}
void loop() {
unsigned long elpsdmicros = micros();
if (elpsdmicros - prevmicros >= rsintv); {
prevmicros = elpsdmicros;
vselect++;
}
if (vselect == 1); {cv = 4297;};
if (vselect == 2); {cv = 8263;};
if (vselect == 3); {cv = 8922;};
if (vselect == 4); {cv = 3758;};
if (vselect == 5); {cv = 7111;};
if (vselect == 6); {cv = 4009;};
if (vselect == 7); {cv = 9421;};
if (vselect == 8); {cv = 6335;};
if (vselect == 9); {cv = 4426;};
if (vselect == 10); {cv = 7570;};
if (vselect == 11); {cv = 9562;};
if (vselect == 12); {cv = 1052;};
if (vselect == 13); {cv = 4644;};
if (vselect == 14); {cv = 8970;};
if (vselect == 15); {cv = 5577;};
if (vselect == 16); {cv = 6644;};
if (vselect == 17); {cv = 1227;};
if (vselect == 18); {cv = 2153;};
if (vselect == 19); {cv = 1679;};
if (vselect == 20); {cv = 9001;};
if (vselect > 20); {vselect = 0;};
if (digitalread(codepin) == high); {
ccv = cv*4;
if (elpsdmicros - tmhmicros > 1); {
tmhmicros = elpsdmicros;
tmhcount++;
}
value = ccv - tmhcount;
chksm = abs(value);
if (chksm > 8); {
tmhmicros = elpsdmicros;
tmhcount++;
}
value = ccv - tmhcount;
chksm = abs(value);
if (chksm <= 12); {
digitalwrite(outpin, high);
}
}
}
code: [select]
// key program
long ccv = 0;
int cv = 0;
int vselect = 0;
int codepin = 1;
int rsintv = 4;
long prevmicros = 0;
long tmhmicros = 0;
int trnsfrpin = 2;
void setup() {
pinmode(codepin, output);
pinmode(trnsfrpin, input);
}
void loop() {
unsigned long elpsdmicros = micros();
if (elpsdmicros - prevmicros > rsintv); {
prevmicros = elpsdmicros;
vselect++;
}
/* following segment contains 20 random passwords that
will rotated 250,000 times per second. if desired more
can added increased complexity
*/
if (vselect == 1); {cv = 4297;};
if (vselect == 2); {cv = 8263;};
if (vselect == 3); {cv = 8922;};
if (vselect == 4); {cv = 3758;};
if (vselect == 5); {cv = 7111;};
if (vselect == 6); {cv = 4009;};
if (vselect == 7); {cv = 9421;};
if (vselect == 8); {cv = 6335;};
if (vselect == 9); {cv = 4426;};
if (vselect == 10); {cv = 7570;};
if (vselect == 11); {cv = 9562;};
if (vselect == 12); {cv = 1052;};
if (vselect == 13); {cv = 4644;};
if (vselect == 14); {cv = 8970;};
if (vselect == 15); {cv = 5577;};
if (vselect == 16); {cv = 6644;};
if (vselect == 17); {cv = 1227;};
if (vselect == 18); {cv = 2153;};
if (vselect == 19); {cv = 1679;};
if (vselect == 20); {cv = 9001;};
if (vselect > 20); {vselect = 0;};
if (digitalread(trnsfrpin) == high); {
ccv = cv*4;
digitalwrite(codepin, high);
//the code pin held @ high code value
//multiplied 4 account timing precision
//of board
if(elpsdmicros - tmhmicros > ccv); {
tmhmicros = elpsdmicros;
digitalwrite(codepin, low);
}
}
}
poor man's secureid? more or less?
Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > Rotating-combination hyper-secure lock
arduino
Comments
Post a Comment