I'm a hobby programmer and very new to this field. I opened a bank account recently and got two pins. One for the girocard and the other for a creditcard. And I needed two more pins for the online banking account, that I could choose by myself. Just for fun I tried to come up with an algorithm, that generates each pin for me, so that I don't need to remember all.
Let's say the two predefined pins are:
The other two pins will be generated shortly.
The algorithm I came up with is the following and it operates on each digit seperately.
(x + n(k + n)) mod 10 = d
where d is one digit of the n-th pin.
Using simple arithmetic I got the following lists:
x = [9, 1, 5, 5]
k = [2, 6, 5, 6]
k is the secret key I memorize.
If I want to get the second pin for example I set n = 2 and use the first k with the first x to get the first digit of my second pin.
the other two pins my algorithm generates with n = 3 and n = 4 are
With this method I can generate up to 10 pins and need to remember only one key. I don't have any knowledge of cryptography and this is just my amateurish attempt. I'm not even sure if this has something to do with cryptography but I hope this is the write place to ask.
Is there some mysterious way someone could decrypt those pins just knowing of the algorithm and the list x?