Encryption algorithm that can be used without a computer

234 Views Asked by At

SIM cards have a PIN and a PUK numbers. Since PINs are used frequently, I know it by heart. I want to write down the PUK to a paper, but I don't want to do it in plaintext, but in a way only I can read it.

With a computer, there are several algorithms readily available to encrypt a number with a key. But can I do it on paper, or better yet, in my head?

Since the PIN is known only to me, it is a good candidate for a key. Can I somehow encrypt the PUK so that it can only be decrypted with this key, all without using a computer? What is my best bet regarding computational complexity and security?

4

There are 4 best solutions below

1
On BEST ANSWER

Let $a=a_3 a_2 a_1 a_0$ be the digits of the PIN, and similar let $b_i$ the digits of the PUK. First, you repeat the PIN so often that the PIN and the PUK have the same length. (i will call this repeated PIN still $a$ with digits $a_i$).

Then, for each digit, you can use addition $\mod 10$ to get the encrypted PUK:

$$c_i = a_i + b_i \mod 10$$

This is easy to calculate in your head.

For decryption you have to use substraction: $$b_i = c_i-a_i \mod 10$$

Assuming both PIN and PUK are drawn from a uniformly random distribution, this encryption has the same security as your PIN (e.g. 4 decimal digits), and the encrypted PUK $c$ is uniformly randomly distributed.

0
On

If your PIN is 4321 and if you are born in 1987 here is a way:

Enc(PUK) = PUK + 4321 + 7891

0
On

This is going to depend a lot of your abilities at mental arithmetic. Here's one idea. I think that a PUK is 8 digits. Split it into two groups of 4. Add your PIN to each in modulo 10000 arithmetic and put it back together. If we assume that the PUKs are random and your PIN is secret then this should be moderately secure.

2
On

Write the PUK on a paper with an "invisible pen" and have a UV light handy when needed-they come in the form of pens for example. Highly unlikely that anyone will find it without knowing very specifically what they are searching for.

If you still want to go with a more mathematical approach, try this-

As far as I know most (all?) PUK numbers have eight digits and usually PIN numbers consist of four. Let $i_1i_2i_3i_4$ be your PIN number and $u_1u_2\cdots u_8$ the digits of your PUK number.

For the first digit of you PUK number, $u_1$, add the digits of your PIN number and divide their sum by $8$. If the remainder is greater than $9$ divide it with $8$ and so on until you reach a remainder $\le8$ which will be your $u_1$.

So, $i_1+i_2+i_3+i_4\equiv u_1\operatorname{mod} 8$

For the second number do the same but divide it by $7$ and so on.

That gives us the formula $i_1+i_2+i_3+i_4\equiv u_r\operatorname{mod} (8-r+1)$