Passwords & Randomising

bmannz

New member
Joined
Feb 23, 2022
Messages
2
Hi all, I have been trying to devise a method of creating 4 digit passcodes using a known code, calendar dates and a simple math function.

Here is the scenario, my neighbour put a keypad on his gate which controls access to a community campground. The code is CAMP (2667) and thats great for this year, but it would be good to change it next year however not 2668, 2669 etc as that is too guessable.

What I was hoping to to was take the known code of 2667, multiply by this year 2022 and getting 5,392,674 take say the first or last 4 digits and theres your code

Next year the neighbour would take the known code of 2667, multiply by 2023 and use that code in the keypad for 2023 however these codes increment in a predictable way so thats no good (it obvious when you think about it)

I tried a divide function but got different precisions for different years (see sample below) so not sure if this would translate wel across different calculators ie iphone calculator app vs excel

I looked into Von Neumanns M2M randomising method but the very first time I tried it I had 01 as the middle digits so that wasn't going to work & then I had a result that had an odd number of digits. You could work around this of course but then there is more to remember about the system and it was at this point when I realised there is probably a much easier method and I need to talk to my maths friends!

Extending this principle it would be great if the pincode to your Air BNB for March could be generated in this way HOUSE (46873) x MARCH 2022 (0322) = 15,093,106, apply function and generate code

Any suggestions greatly appreciated!



Known CodeDateMultiply Method
266720225392674
266720235395341
266720245398008
2667
2667Divide Method
266720221.318991098
266720231.3183391
266720241.317687747
2667
2667MSM
266720225392674
 
Sounds to me that you have to goals which might be difficult to reconcile, i.e. the code which is a) difficult to guess, and b) easy to remember. If you can drop the second goal then why not just use a good random number generator every year?
 
Hi blamocur, thanks for the suggestion. I am looking for a code that is easy to calculate given the date you know and a code you know. The reason a random number generator isn't ideal here is these codes would be programmed into the keypad ahead of them becoming valid, as the months and years roll by the the owners can hand out codes to people who need access without having to physically get to the keypad to add them.
 
Hi blamocur, thanks for the suggestion. I am looking for a code that is easy to calculate given the date you know and a code you know. The reason a random number generator isn't ideal here is these codes would be programmed into the keypad ahead of them becoming valid, as the months and years roll by the the owners can hand out codes to people who need access without having to physically get to the keypad to add them.
Can you qualify "eazy to calculate"? I.e., in one's head? With a piece of paper? Using a computer with a fast algorithm?
 
If I understand this, the only person who needs to do any calculation is the person who hands out the codes.

Something like

[math]\left \lfloor 10^4 * \left ( \dfrac{\pi y}{\sqrt{2}} - \left \lfloor \dfrac{\pi y}{\sqrt{2}} \right \rfloor \right ) \right \rfloor, \text { where } y = \text {year.}[/math]
A computer can generate a list of effectively of 20 unguessable 4 digit codes in milliseconds.
 
Top