Unlocking a Master Combination Lock
Enter the last number of your lock's combination into this applet. It will
generate the possible combinations for your lock (there are less than
100, actually, since all the mathematically correct combinations are not mechanically feasible). Please use this ONLY for locks that you own!
How it Works
The combinations of Master combination locks are based on the remainders of ordinary division. In a
Master lock, the last number of the combination is divided by 4, and the remainder of this division tells about the
possible values for the first and second numbers of the combination:
 The set of first possible numbers of the combination starts at the remainder of the division of (Last_Number / 4), and
the difference between each possible value for the first number in the combination is 4.
 The set of second possible numbers of the combination starts at the remainder of the division plus
2 [(Last_Number / 4) +2], and again goes around the lock in steps of 4.
 The arithmetic for calculating the combination must go all around the lock dial, spanning the
39  0 marks as needed.
The Java code to achieve this is quite simple:
String msg;
int nLast;
int nRem;
int nFirst;
int nCount1;
int nSec;
int nCount2;
//
// The last number of the combination must be placed in the variable 'nLast'
//
nRem = nLast % 4; // The 1st number starts at (Last % 4) and goes in jumps of 4
// The 2nd number starts at ((Last % 4) + 2 )
for(nFirst=nRem,nCount1=0;nCount1 < 10;nFirst+=4,nCount1++)
{
for(nSec = nRem+2, nCount2= 0;nCount2 < 10;nSec+=4,nCount2++)
msg = msg + "" + (nFirst%40) + "" + (nSec%40) + "" + nLast + "\r\n";
System.out.println(msg);
}
Return to N0GSG home page
